2008-05-06 16:09:50 +02:00
|
|
|
#include <vector>
|
2008-12-19 11:43:36 +01:00
|
|
|
#include <vcg/simplex/vertex/base.h>
|
|
|
|
#include <vcg/simplex/vertex/component_ocf.h>
|
|
|
|
#include <vcg/simplex/face/base.h>
|
|
|
|
#include <vcg/simplex/face/component.h>
|
2008-05-06 16:09:50 +02:00
|
|
|
|
2011-04-01 19:07:57 +02:00
|
|
|
#include <vcg/complex/complex.h>
|
2008-05-06 16:09:50 +02:00
|
|
|
|
2011-04-01 19:07:57 +02:00
|
|
|
#include<vcg/complex/algorithms/create/platonic.h>
|
2008-05-06 16:09:50 +02:00
|
|
|
|
|
|
|
class MyEdge;
|
|
|
|
class MyFace;
|
|
|
|
|
|
|
|
class MyVertex: public vcg::VertexSimp2<MyVertex,MyEdge,MyFace, vcg::vert::InfoOcf,vcg::vert::Coord3d, vcg::vert::Normal3fOcf>{};
|
|
|
|
class MyFace: public vcg::FaceSimp2<MyVertex,MyEdge,MyFace,vcg::face::VertexRef>{};
|
|
|
|
class MyMesh: public vcg::tri::TriMesh< vcg::vert::vector_ocf<MyVertex>, std::vector<MyFace> >{};
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
MyMesh m;
|
|
|
|
vcg::tri::Tetrahedron(m);
|
|
|
|
MyMesh::VertexIterator vi = m.vert.begin();
|
|
|
|
|
|
|
|
(*vi).N() = vcg::Point3f(1.0,1.0,1.0); // ERROR
|
|
|
|
m.vert.EnableNormal(); // this allocate the memory to store the normal
|
|
|
|
(*vi).N() = vcg::Point3f(1.0,1.0,1.0); // OK
|
|
|
|
m.vert.DisableNormal(); // this deallocate the memory to store the normal
|
|
|
|
|
|
|
|
(*vi).N() = vcg::Point3f(1.0,1.0,1.0); // ERROR (again)!
|
|
|
|
return 0;
|
|
|
|
}
|