#include #include #include #include #include #include #include class MyEdge; class MyFace; class MyVertex: public vcg::VertexSimp2{}; class MyFace: public vcg::FaceSimp2{}; class MyMesh: public vcg::tri::TriMesh< vcg::vert::vector_occ, std::vector >{}; 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.EnableAttribute(); // this allocate the memory to store the normal (*vi).N() = vcg::Point3f(1.0,1.0,1.0); // OK m.vert.DisableAttribute(); // this deallocate the memory to store the normal (*vi).N() = vcg::Point3f(1.0,1.0,1.0); // ERROR (again)! return 0; }