33 #include<vcg/complex/complex.h>
35 #include<wrap/io_trimesh/import_ply.h>
36 #include<wrap/io_trimesh/export_ply.h>
38 #include<vcg/complex/algorithms/implicit_smooth.h>
46 struct MyUsedTypes :
public vcg::UsedTypes< vcg::Use<MyVertex> ::AsVertexType,
47 vcg::Use<MyEdge> ::AsEdgeType,
48 vcg::Use<MyFace> ::AsFaceType>{};
50 class MyVertex :
public vcg::Vertex<MyUsedTypes, vcg::vertex::Coord3f, vcg::vertex::Normal3f, vcg::vertex::BitFlags >{};
51 class MyFace :
public vcg::Face< MyUsedTypes, vcg::face::FFAdj, vcg::face::Normal3f, vcg::face::VertexRef, vcg::face::BitFlags > {};
52 class MyEdge :
public vcg::Edge<MyUsedTypes>{};
53 class MyMesh :
public vcg::tri::TriMesh< std::vector<MyVertex>, std::vector<MyFace> , std::vector<MyEdge> > {};
56 int main(
int argc,
char **argv )
61 printf(
"Usage: trimesh_implicit_smooth mesh.ply\n");
65 int ret= tri::io::ImporterPLY<MyMesh>::Open(m,argv[1]);
68 printf(
"Unable to open %s for '%s'\n",argv[1],tri::io::ImporterPLY<MyMesh>::ErrorMsg(ret));
74 ImplicitSmoother<MyMesh>::Parameter par;
76 ImplicitSmoother<MyMesh>::Compute(m,par);
78 tri::io::ExporterPLY<MyMesh>::Save(m,
"smooth.ply",tri::io::Mask::IOM_VERTCOLOR | tri::io::Mask::IOM_VERTQUALITY);