<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[std::map &#x2F; OpenMesh &#x2F; Debug Error]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich habe ein Problem mit OpenMesh welches ich nicht gelöst kriege.</p>
<p>Es geht um eine eine Punkteliste im QString Format, für dich ich jeweils ein VertexHandle abspeichere und meinem Mesh hinzufüge.</p>
<p>Es erfolgt eine Prüfung auf doppelte Punkte. Jede Facette ist temporär in einem Vector bestehend aus Vertex_Handles definiert und wird darüber trianguliert.</p>
<p>In meinem Header definiert:</p>
<pre><code>typedef OpenMesh::PolyMesh_ArrayKernelT&lt;&gt;  MyMesh;
typedef pair&lt;QString, MyMesh::VertexHandle&gt; Points_pair;

class ...
{
private:
map&lt;QString,MyMesh::VertexHandle&gt; pList;
}
</code></pre>
<p>Source-Datei:</p>
<pre><code>void QtDOMParser::addPolygon(const QDomElement &amp;e, MyMesh &amp;mesh)
{
	QString content;

	QStringList coords;
	QDomNodeList childNodes = e.childNodes();

	vector&lt;MyMesh::VertexHandle&gt;  vertex_vhandles;
	MyMesh::VertexHandle vHandle;

	for (int i = 0; i &lt; childNodes.length();i++)
	{
		QDomElement temp = childNodes.at(i).toElement();
		if(temp.tagName() == &quot;pos&quot;)
		{
			content = temp.text(); //QString of Point

			map&lt;QString, MyMesh::VertexHandle&gt;::iterator iter = pList.find(content);
			if(iter != pList.end())
			{
				vertex_vhandles.push_back(pList[content]);

			}
			else //Punkt noch nicht vorhanden
			{
				coords = content.split(' ');
				vHandle = mesh.add_vertex(MyMesh::Point(coords.at(0).toDouble(),coords.at(1).toDouble(),coords.at(2).toDouble()));
				pList.insert(Points_pair(content,vHandle));
				vertex_vhandles.push_back(vHandle);
				cout &lt;&lt; &quot;kein doppelter Punkt&quot; &lt;&lt; endl;
			}
		}

	}
	mesh.triangulate(mesh.add_face(vertex_vhandles)); // In dieser Zeile stürzt er ab -&gt; Debug Error
}
</code></pre>
<p>Ich hatte sowas vorher schon in ähnlicher Form, nur ohne Überprüfung. Daher kann ich sagen, dass die Triangulierung und auch der Vector gültig sind.</p>
<p>Meine Vermutung liegt eher auf dem vHandle. Eine Überwachung zeigte nur index Werte an. VertexHandles wurden anscheinend gar nicht eingetragen. Qstring aus Punktewerten dagegen schon.</p>
<p>Versteht jmd den Fehler und kann mir sagen wie ich ihn zu lösen habe?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/221068/std-map-openmesh-debug-error</link><generator>RSS for Node</generator><lastBuildDate>Tue, 06 Oct 2026 12:08:25 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/221068.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 25 Aug 2008 10:22:22 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to std::map &#x2F; OpenMesh &#x2F; Debug Error on Mon, 25 Aug 2008 10:22:22 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich habe ein Problem mit OpenMesh welches ich nicht gelöst kriege.</p>
<p>Es geht um eine eine Punkteliste im QString Format, für dich ich jeweils ein VertexHandle abspeichere und meinem Mesh hinzufüge.</p>
<p>Es erfolgt eine Prüfung auf doppelte Punkte. Jede Facette ist temporär in einem Vector bestehend aus Vertex_Handles definiert und wird darüber trianguliert.</p>
<p>In meinem Header definiert:</p>
<pre><code>typedef OpenMesh::PolyMesh_ArrayKernelT&lt;&gt;  MyMesh;
typedef pair&lt;QString, MyMesh::VertexHandle&gt; Points_pair;

class ...
{
private:
map&lt;QString,MyMesh::VertexHandle&gt; pList;
}
</code></pre>
<p>Source-Datei:</p>
<pre><code>void QtDOMParser::addPolygon(const QDomElement &amp;e, MyMesh &amp;mesh)
{
	QString content;

	QStringList coords;
	QDomNodeList childNodes = e.childNodes();

	vector&lt;MyMesh::VertexHandle&gt;  vertex_vhandles;
	MyMesh::VertexHandle vHandle;

	for (int i = 0; i &lt; childNodes.length();i++)
	{
		QDomElement temp = childNodes.at(i).toElement();
		if(temp.tagName() == &quot;pos&quot;)
		{
			content = temp.text(); //QString of Point

			map&lt;QString, MyMesh::VertexHandle&gt;::iterator iter = pList.find(content);
			if(iter != pList.end())
			{
				vertex_vhandles.push_back(pList[content]);

			}
			else //Punkt noch nicht vorhanden
			{
				coords = content.split(' ');
				vHandle = mesh.add_vertex(MyMesh::Point(coords.at(0).toDouble(),coords.at(1).toDouble(),coords.at(2).toDouble()));
				pList.insert(Points_pair(content,vHandle));
				vertex_vhandles.push_back(vHandle);
				cout &lt;&lt; &quot;kein doppelter Punkt&quot; &lt;&lt; endl;
			}
		}

	}
	mesh.triangulate(mesh.add_face(vertex_vhandles)); // In dieser Zeile stürzt er ab -&gt; Debug Error
}
</code></pre>
<p>Ich hatte sowas vorher schon in ähnlicher Form, nur ohne Überprüfung. Daher kann ich sagen, dass die Triangulierung und auch der Vector gültig sind.</p>
<p>Meine Vermutung liegt eher auf dem vHandle. Eine Überwachung zeigte nur index Werte an. VertexHandles wurden anscheinend gar nicht eingetragen. Qstring aus Punktewerten dagegen schon.</p>
<p>Versteht jmd den Fehler und kann mir sagen wie ich ihn zu lösen habe?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1570928</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1570928</guid><dc:creator><![CDATA[nicolo]]></dc:creator><pubDate>Mon, 25 Aug 2008 10:22:22 GMT</pubDate></item></channel></rss>