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
00029 #include<vcg/complex/complex.h>
00030
00031 #include <vcg/complex/algorithms/update/bounding.h>
00032 #include <vcg/complex/algorithms/update/color.h>
00033 #include <vcg/complex/algorithms/update/normal.h>
00034 #include <vcg/complex/algorithms/update/flag.h>
00035 #include <vcg/complex/algorithms/clustering.h>
00036
00037
00038 #include <wrap/io_trimesh/import.h>
00039 #include <wrap/io_trimesh/export.h>
00040
00041 class MyFace;
00042 class MyVertex;
00043
00044 struct MyUsedTypes : public vcg::UsedTypes< vcg::Use<MyVertex>::AsVertexType, vcg::Use<MyFace>::AsFaceType>{};
00045
00046 class MyVertex : public vcg::Vertex< MyUsedTypes, vcg::vertex::Coord3f, vcg::vertex::Normal3f, vcg::vertex::Color4b, vcg::vertex::BitFlags >{};
00047 class MyFace : public vcg::Face < MyUsedTypes, vcg::face::VertexRef, vcg::face::Normal3f, vcg::face::Color4b, vcg::face::BitFlags > {};
00048 class MyMesh : public vcg::tri::TriMesh< std::vector<MyVertex>, std::vector<MyFace> > {};
00049
00050
00051 int main()
00052 {
00053 MyMesh m;
00054
00055 vcg::tri::io::ImporterPLY<MyMesh>::Open(m,"../../meshes/torus_irregular.ply");
00056
00057 vcg::tri::UpdateColor<MyMesh>::PerVertexConstant(m, vcg::Color4b::LightGray);
00058 vcg::tri::UpdateColor<MyMesh>::PerFaceConstant(m, vcg::Color4b::LightGray);
00059
00060 vcg::tri::UpdateColor<MyMesh>::PerVertexPerlinNoise(m,vcg::Point3f(0.5,0.75,1.0));
00061 vcg::tri::UpdateColor<MyMesh>::PerFaceFromVertex(m);
00062
00063
00064 vcg::tri::io::ExporterPLY<MyMesh>::Save(m,"out.ply",vcg::tri::io::Mask::IOM_FACECOLOR+vcg::tri::io::Mask::IOM_VERTCOLOR);
00065 return 0;
00066 }