Disable xml output temporarily

This commit is contained in:
Massimiliano Corsini 2005-12-19 15:00:53 +00:00
parent 449f8c6bfb
commit 47da0f6a24
1 changed files with 23 additions and 3 deletions

View File

@ -24,6 +24,9 @@
History History
$Log: not supported by cvs2svn $ $Log: not supported by cvs2svn $
Revision 1.22 2005/12/19 11:35:13 corsini
Add html output support
Revision 1.21 2005/12/16 11:16:36 corsini Revision 1.21 2005/12/16 11:16:36 corsini
Add manifold check to some properties Add manifold check to some properties
@ -180,6 +183,7 @@ struct MeshInfo
bool Orientable,Oriented; bool Orientable,Oriented;
int dv; int dv;
bool SelfIntersect; bool SelfIntersect;
std::vector<CMesh::FaceType *> intersections;
}; };
@ -362,6 +366,16 @@ void SaveXMLInfo(MeshInfo &mi)
doc.addNode(mi.SelfIntersect?"Yes":"No", VALUE_STRING,"Self Intersection"); doc.addNode(mi.SelfIntersect?"Yes":"No", VALUE_STRING,"Self Intersection");
doc.finalizeMain(); doc.finalizeMain();
// save xml tree
string filename = mi.FileName;
int l = static_cast<int>(filename.size());
int index = filename.find_first_of('.');
filename.erase(index, l - index);
filename.append(".xml");
doc.setName(filename.c_str());
doc.printXMLTree(); doc.printXMLTree();
} }
@ -608,6 +622,10 @@ int main(int argc, char ** argv)
tri::Inertia<CMesh> mm; tri::Inertia<CMesh> mm;
mm.Compute(m); mm.Compute(m);
mi.Volume = mm.Mass(); mi.Volume = mm.Mass();
// the sign of the volume depend on the mesh orientation
if (mi.Volume < 0.0)
mi.Volume = -mi.Volume;
} }
// GENUS // GENUS
@ -628,8 +646,7 @@ int main(int argc, char ** argv)
mi.dv = tri::Clean<CMesh>::RemoveDuplicateVertex(m); mi.dv = tri::Clean<CMesh>::RemoveDuplicateVertex(m);
// SELF INTERSECTION // SELF INTERSECTION
vector<CMesh::FaceType *> intersected; mi.SelfIntersect = tri::Clean<CMesh>::SelfIntersections(m, mi.intersections);
mi.SelfIntersect = tri::Clean<CMesh>::SelfIntersections(m, intersected);
// Mesh Information Output // Mesh Information Output
////////////////////////////////////////// //////////////////////////////////////////
@ -640,7 +657,8 @@ int main(int argc, char ** argv)
// Save mesh information in XML format // Save mesh information in XML format
if(XmlFlag) if(XmlFlag)
SaveXMLInfo(mi); printf(" This feature will be available soon.\n\n");
//SaveXMLInfo(mi);
// Save mesh information in HTML format // Save mesh information in HTML format
if (HtmlFlag) if (HtmlFlag)
@ -654,6 +672,8 @@ int main(int argc, char ** argv)
printf(" done.\n\n"); printf(" done.\n\n");
} }
mi.intersections.clear();
return 0; return 0;
} }