Added a number of 'template' and 'typename' keyword to comply clang...

This commit is contained in:
Paolo Cignoni 2015-10-21 12:01:48 +00:00
parent 3f1b4519b5
commit 9a48f16579
1 changed files with 276 additions and 274 deletions

View File

@ -57,7 +57,7 @@ private:
// Initialize the convex hull with the biggest tetraedron created using the vertices of the input mesh // Initialize the convex hull with the biggest tetraedron created using the vertices of the input mesh
static void InitConvexHull(InputMesh& mesh, CHMesh& convexHull) static void InitConvexHull(InputMesh& mesh, CHMesh& convexHull)
{ {
CMesh::PerVertexAttributeHandle<ScalarType> indexInputVertex = vcg::tri::Allocator<InputMesh>::GetPerVertexAttribute<ScalarType>(mesh, std::string("indexInput")); typename CHMesh:: template PerVertexAttributeHandle<int> indexInputVertex = Allocator<InputMesh>::template GetPerVertexAttribute<int>(mesh, std::string("indexInput"));
InputVertexPointer v[3]; InputVertexPointer v[3];
//Find the 6 points with min/max coordinate values //Find the 6 points with min/max coordinate values
InputVertexIterator vi = mesh.vert.begin(); InputVertexIterator vi = mesh.vert.begin();
@ -169,7 +169,7 @@ public:
vcg::tri::RequireFFAdjacency(convexHull); vcg::tri::RequireFFAdjacency(convexHull);
vcg::tri::RequirePerFaceNormal(convexHull); vcg::tri::RequirePerFaceNormal(convexHull);
vcg::tri::Allocator<InputMesh>::CompactVertexVector(mesh); vcg::tri::Allocator<InputMesh>::CompactVertexVector(mesh);
CMesh::PerVertexAttributeHandle<ScalarType> indexInputVertex = vcg::tri::Allocator<InputMesh>::GetPerVertexAttribute<ScalarType>(mesh, std::string("indexInput")); typename CHMesh:: template PerVertexAttributeHandle<int> indexInputVertex = Allocator<InputMesh>::template GetPerVertexAttribute<int>(mesh, std::string("indexInput"));
if (mesh.vert.size() < 4) if (mesh.vert.size() < 4)
return false; return false;
InitConvexHull(mesh, convexHull); InitConvexHull(mesh, convexHull);
@ -260,7 +260,7 @@ public:
for (int ii = 0; ii < 2; ii++) for (int ii = 0; ii < 2; ii++)
{ {
int indexE = ii * 2; int indexE = ii * 2;
std::unordered_map< CHVertexPointer, std::pair<int, char> >::iterator vIter = fanMap.find(vp[ii]); typename std::unordered_map< CHVertexPointer, std::pair<int, char> >::iterator vIter = fanMap.find(vp[ii]);
if (vIter != fanMap.end()) if (vIter != fanMap.end())
{ {
CHFacePointer f2 = &convexHull.face[(*vIter).second.first]; CHFacePointer f2 = &convexHull.face[(*vIter).second.first];
@ -277,9 +277,9 @@ public:
} }
//Build the visibility list for the new face //Build the visibility list for the new face
std::vector<InputVertexPointer> tempVect; std::vector<InputVertexPointer> tempVect;
int indices[] = { indexFace, vcg::tri::Index(convexHull, f->FFp(j)) }; int indices[2] = { indexFace, int(vcg::tri::Index(convexHull, f->FFp(j)) )};
std::vector<InputVertexPointer> vertexToTest(listVertexPerFace[indices[0]].size() + listVertexPerFace[indices[1]].size()); std::vector<InputVertexPointer> vertexToTest(listVertexPerFace[indices[0]].size() + listVertexPerFace[indices[1]].size());
std::vector<InputVertexPointer>::iterator tempIt = std::set_union(listVertexPerFace[indices[0]].begin(), listVertexPerFace[indices[0]].end(), listVertexPerFace[indices[1]].begin(), listVertexPerFace[indices[1]].end(), vertexToTest.begin()); typename std::vector<InputVertexPointer>::iterator tempIt = std::set_union(listVertexPerFace[indices[0]].begin(), listVertexPerFace[indices[0]].end(), listVertexPerFace[indices[1]].begin(), listVertexPerFace[indices[1]].end(), vertexToTest.begin());
vertexToTest.resize(tempIt - vertexToTest.begin()); vertexToTest.resize(tempIt - vertexToTest.begin());
ScalarType maxDist = 0; ScalarType maxDist = 0;
Pair newInfo = std::make_pair((InputVertexPointer)NULL , 0.0f); Pair newInfo = std::make_pair((InputVertexPointer)NULL , 0.0f);
@ -315,16 +315,18 @@ public:
{ {
if (!convexHull.face[visFace[j]].IsD()) if (!convexHull.face[visFace[j]].IsD())
{ {
std::vector<InputVertexPointer> emptyVec;
vcg::tri::Allocator<CHMesh>::DeleteFace(convexHull, convexHull.face[visFace[j]]); vcg::tri::Allocator<CHMesh>::DeleteFace(convexHull, convexHull.face[visFace[j]]);
listVertexPerFace[visFace[j]].swap(std::vector<InputVertexPointer>()); listVertexPerFace[visFace[j]].swap(emptyVec);
} }
} }
} }
} }
tri::UpdateTopology<CHMesh>::ClearFaceFace(convexHull);
vcg::tri::Allocator<CHMesh>::CompactFaceVector(convexHull); vcg::tri::Allocator<CHMesh>::CompactFaceVector(convexHull);
vcg::tri::Clean<CHMesh>::RemoveUnreferencedVertex(convexHull); vcg::tri::Clean<CHMesh>::RemoveUnreferencedVertex(convexHull);
return true; return true;
}; }
}; };