diff --git a/apps/sample/trimesh_intersection/trimesh_intersection.cpp b/apps/sample/trimesh_intersection/trimesh_intersection.cpp index 4ebdc8a1..2d5a6624 100644 --- a/apps/sample/trimesh_intersection/trimesh_intersection.cpp +++ b/apps/sample/trimesh_intersection/trimesh_intersection.cpp @@ -3,6 +3,8 @@ using namespace std; // VCG headers for triangular mesh processing +#include +#include #include #include #include @@ -21,6 +23,7 @@ using namespace std; // VCG File Format Importer/Exporter #include #include +#include // VCG Vertex @@ -28,23 +31,13 @@ using namespace std; using namespace vcg; -/* class MyFace; -class MyEdge; -class MyVertex : public VertexAFVN {}; -class MyFace : public FaceAFAV< MyVertex, MyEdge, MyFace > {}; -class MyEdge : public vcg::EdgeAE {}; -class MyMesh : public vcg::tri::TriMesh< vector, vector > {}; -class MyEdgeMesh: public vcg::edge::EdgeMesh< vector, vector > {}; - - */ - -class MyEdge; // dummy prototype never used class MyFace; -class MyVertex; - +class MyEdge; class MyVertex : public VertexSimp2< MyVertex, MyEdge, MyFace, vert::Coord3f, vert::BitFlags, vert::Normal3f, vert::Mark>{}; +class MyEdge : public EdgeSimp2< MyVertex,MyEdge, MyFace, edge::VertexRef, edge::EVAdj> {}; class MyFace : public FaceSimp2 < MyVertex, MyEdge, MyFace, face::VertexRef,face::FFAdj, face::BitFlags, face::Normal3f> {}; +class MyEdgeMesh: public vcg::edg::EdgeMesh< vector, vector > {}; class MyMesh : public tri::TriMesh< vector, vector >{}; @@ -110,14 +103,19 @@ int main(int argc,char ** argv) edge_mesh, avg_length, &static_grid, intersected_cells); // Compute bounding box - vcg::edge::UpdateBounding::Box(edge_mesh); + vcg::edg::UpdateBounding::Box(edge_mesh); // export the cross-section - if (vcg::edge::io::ExporterSVG::Save(&edge_mesh, "out.svg")) + vcg::edg::io::SVGProperties pr; + pr.setScale(500/(float)edge_mesh.bbox.Diag()); + pr.setDimension(500,500); + + if (vcg::edg::io::ExporterSVG::Save(&edge_mesh, "out.svg",pr)) printf(" The cross-intersection has been successfully saved (OUT.SVG).\n"); else printf(" The cross-intersection cannot be saved.\n"); + return 0; }