From 47da0f6a2477c3734f12aa3b467117fd8c20e1f5 Mon Sep 17 00:00:00 2001 From: maxcorsini Date: Mon, 19 Dec 2005 15:00:53 +0000 Subject: [PATCH] Disable xml output temporarily --- apps/trimeshinfo/trimeshinfo.cpp | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/apps/trimeshinfo/trimeshinfo.cpp b/apps/trimeshinfo/trimeshinfo.cpp index c8437e68..f57fbc4d 100644 --- a/apps/trimeshinfo/trimeshinfo.cpp +++ b/apps/trimeshinfo/trimeshinfo.cpp @@ -24,6 +24,9 @@ History $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 Add manifold check to some properties @@ -180,6 +183,7 @@ struct MeshInfo bool Orientable,Oriented; int dv; bool SelfIntersect; + std::vector intersections; }; @@ -362,6 +366,16 @@ void SaveXMLInfo(MeshInfo &mi) doc.addNode(mi.SelfIntersect?"Yes":"No", VALUE_STRING,"Self Intersection"); doc.finalizeMain(); + + // save xml tree + string filename = mi.FileName; + + int l = static_cast(filename.size()); + int index = filename.find_first_of('.'); + filename.erase(index, l - index); + filename.append(".xml"); + + doc.setName(filename.c_str()); doc.printXMLTree(); } @@ -608,6 +622,10 @@ int main(int argc, char ** argv) tri::Inertia mm; mm.Compute(m); mi.Volume = mm.Mass(); + + // the sign of the volume depend on the mesh orientation + if (mi.Volume < 0.0) + mi.Volume = -mi.Volume; } // GENUS @@ -628,8 +646,7 @@ int main(int argc, char ** argv) mi.dv = tri::Clean::RemoveDuplicateVertex(m); // SELF INTERSECTION - vector intersected; - mi.SelfIntersect = tri::Clean::SelfIntersections(m, intersected); + mi.SelfIntersect = tri::Clean::SelfIntersections(m, mi.intersections); // Mesh Information Output ////////////////////////////////////////// @@ -640,7 +657,8 @@ int main(int argc, char ** argv) // Save mesh information in XML format if(XmlFlag) - SaveXMLInfo(mi); + printf(" This feature will be available soon.\n\n"); + //SaveXMLInfo(mi); // Save mesh information in HTML format if (HtmlFlag) @@ -654,6 +672,8 @@ int main(int argc, char ** argv) printf(" done.\n\n"); } + mi.intersections.clear(); + return 0; }