Commit eec3ac3b authored by Jan Möbius's avatar Jan Möbius
Browse files

Made STL Reader work, with the clear = false flag.

Redundant lookup removed. 
( Thanks to Peter Newman for the patch)

closes #1370

git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@783 fdac6126-5c0c-442c-9429-916003d36597
parent b025acaa
......@@ -222,7 +222,6 @@ read_stla(const std::string& _filename, BaseImporter& _bi) const
unsigned int i;
OpenMesh::Vec3f v;
OpenMesh::Vec3f n;
unsigned int cur_idx(0);
BaseImporter::VHandles vhandles;
CmpVec comp(eps_);
......@@ -288,9 +287,9 @@ read_stla(const std::string& _filename, BaseImporter& _bi) const
if ((vMapIt=vMap.find(v)) == vMap.end())
{
// No : add vertex and remember idx/vector mapping
_bi.add_vertex(v);
vhandles.push_back(VertexHandle(cur_idx));
vMap[v] = VertexHandle(cur_idx++);
VertexHandle handle = _bi.add_vertex(v);
vhandles.push_back(handle);
vMap[v] = handle;
}
else
// Yes : get index from map
......@@ -330,7 +329,6 @@ read_stla(std::istream& _in, BaseImporter& _bi) const
unsigned int i;
OpenMesh::Vec3f v;
OpenMesh::Vec3f n;
unsigned int cur_idx(0);
BaseImporter::VHandles vhandles;
CmpVec comp(eps_);
......@@ -395,9 +393,9 @@ read_stla(std::istream& _in, BaseImporter& _bi) const
if ((vMapIt=vMap.find(v)) == vMap.end())
{
// No : add vertex and remember idx/vector mapping
_bi.add_vertex(v);
vhandles.push_back(VertexHandle(cur_idx));
vMap[v] = VertexHandle(cur_idx++);
VertexHandle handle = _bi.add_vertex(v);
vhandles.push_back(handle);
vMap[v] = handle;
}
else
// Yes : get index from map
......@@ -444,7 +442,6 @@ read_stlb(const std::string& _filename, BaseImporter& _bi) const
bool swapFlag;
unsigned int i, nT;
OpenMesh::Vec3f v;
unsigned int cur_idx(0);
BaseImporter::VHandles vhandles;
std::map<Vec3f, VertexHandle, CmpVec> vMap;
......@@ -485,9 +482,9 @@ read_stlb(const std::string& _filename, BaseImporter& _bi) const
if ((vMapIt=vMap.find(v)) == vMap.end())
{
// No : add vertex and remember idx/vector mapping
_bi.add_vertex(v);
vhandles.push_back(VertexHandle(cur_idx));
vMap[v] = VertexHandle(cur_idx++);
VertexHandle handle = _bi.add_vertex(v);
vhandles.push_back(handle);
vMap[v] = handle;
}
else
// Yes : get index from map
......@@ -522,7 +519,6 @@ read_stlb(std::istream& _in, BaseImporter& _bi) const
bool swapFlag;
unsigned int i, nT;
OpenMesh::Vec3f v;
unsigned int cur_idx(0);
BaseImporter::VHandles vhandles;
std::map<Vec3f, VertexHandle, CmpVec> vMap;
......@@ -564,9 +560,9 @@ read_stlb(std::istream& _in, BaseImporter& _bi) const
if ((vMapIt=vMap.find(v)) == vMap.end())
{
// No : add vertex and remember idx/vector mapping
_bi.add_vertex(v);
vhandles.push_back(VertexHandle(cur_idx));
vMap[v] = VertexHandle(cur_idx++);
VertexHandle handle = _bi.add_vertex(v);
vhandles.push_back(handle);
vMap[v] = handle;
}
else
// Yes : get index from map
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment