Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00031 #include<vcg/complex/complex.h>
00032
00033 #include<wrap/io_trimesh/export_off.h>
00034 #include <vcg/complex/algorithms/create/platonic.h>
00035
00036 #include<vcg/complex/algorithms/update/curvature.h>
00037 #include<vcg/complex/algorithms/update/normal.h>
00038
00039 class MyEdge;
00040 class MyFace;
00041 class MyVertex;
00042 struct MyUsedTypes : public vcg::UsedTypes< vcg::Use<MyVertex> ::AsVertexType,
00043 vcg::Use<MyEdge> ::AsEdgeType,
00044 vcg::Use<MyFace> ::AsFaceType>{};
00045
00046 class MyVertex : public vcg::Vertex<MyUsedTypes, vcg::vertex::Coord3f, vcg::vertex::Normal3f, vcg::vertex::BitFlags >{};
00047 class MyFace : public vcg::Face< MyUsedTypes, vcg::face::FFAdj, vcg::face::VertexRef, vcg::face::BitFlags > {};
00048 class MyEdge : public vcg::Edge<MyUsedTypes>{};
00049 class MyMesh : public vcg::tri::TriMesh< std::vector<MyVertex>, std::vector<MyFace> , std::vector<MyEdge> > {};
00050
00051 int main( int , char ** )
00052 {
00053 MyMesh m;
00054 vcg::tri::Torus(m,30,10);
00055 vcg::tri::io::ExporterOFF<MyMesh>::Save(m,"torus.off");
00056
00057 vcg::tri::UpdateTopology<MyMesh>::FaceFace(m);
00058
00059 vcg::tri::UpdateCurvature<MyMesh>::MeanAndGaussian(m);
00060 vcg::tri::UpdateCurvature<MyMesh>::PrincipalDirections(m);
00061
00062 vcg::tri::UpdateCurvature<MyMesh>::PrincipalDirectionsPCA(m,m.bbox.Diag()/100);
00063
00064 vcg::tri::UpdateNormal<MyMesh>::PerVertexNormalized(m);
00065 printf("Input mesh vn:%i fn:%i\n",m.VN(),m.FN());
00066 printf( "Mesh has %i vert and %i faces\n", m.VN(), m.FN() );
00067
00068 return 0;
00069 }