trimesh_optional_occ.cpp
Go to the documentation of this file.
00001 #include <vector>
00002 #include <vcg/simplex/vertex/base.h>   
00003 #include <vcg/simplex/vertex/component_ocf.h>  
00004 #include <vcg/simplex/face/base.h>   
00005 #include <vcg/simplex/face/component.h>   
00006 
00007 #include <vcg/complex/complex.h>   
00008 
00009 #include<vcg/complex/algorithms/create/platonic.h>
00010 
00011 class MyEdge;
00012 class MyFace;
00013 
00014 class MyVertex: public vcg::VertexSimp2<MyVertex,MyEdge,MyFace, vcg::vert::InfoOcf,vcg::vert::Coord3d, vcg::vert::Normal3fOcf>{};
00015 class MyFace: public vcg::FaceSimp2<MyVertex,MyEdge,MyFace,vcg::face::VertexRef>{};
00016 class MyMesh: public vcg::tri::TriMesh< vcg::vert::vector_ocf<MyVertex>, std::vector<MyFace> >{};
00017 
00018 int main()
00019 {
00020  MyMesh m;
00021  vcg::tri::Tetrahedron(m);
00022  MyMesh::VertexIterator vi = m.vert.begin();
00023 
00024  (*vi).N() = vcg::Point3f(1.0,1.0,1.0); // ERROR   
00025  m.vert.EnableNormal(); // this allocate the memory to store the normal
00026  (*vi).N() = vcg::Point3f(1.0,1.0,1.0); // OK
00027  m.vert.DisableNormal(); // this deallocate the memory to store the normal
00028 
00029  (*vi).N() = vcg::Point3f(1.0,1.0,1.0); // ERROR  (again)! 
00030  return 0;
00031 }


shape_reconstruction
Author(s): Roberto Martín-Martín
autogenerated on Sat Jun 8 2019 18:38:20