first version
This commit is contained in:
parent
a02e2a7310
commit
4d435998f1
|
@ -0,0 +1,31 @@
|
|||
#include <vector>
|
||||
#include <vcg/simplex/vertexplus/base.h>
|
||||
#include <vcg/simplex/vertexplus/component_ocf.h>
|
||||
#include <vcg/simplex/faceplus/base.h>
|
||||
#include <vcg/simplex/faceplus/component.h>
|
||||
|
||||
#include <vcg/complex/trimesh/base.h>
|
||||
|
||||
#include<vcg/complex/trimesh/create/platonic.h>
|
||||
|
||||
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;
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
#include <vector>
|
||||
#include <vcg/simplex/vertexplus/base.h>
|
||||
#include <vcg/simplex/vertexplus/component_occ.h>
|
||||
#include <vcg/simplex/faceplus/base.h>
|
||||
#include <vcg/simplex/faceplus/component.h>
|
||||
|
||||
#include <vcg/complex/trimesh/base.h>
|
||||
|
||||
#include<vcg/complex/trimesh/create/platonic.h>
|
||||
|
||||
class MyEdge;
|
||||
class MyFace;
|
||||
|
||||
class MyVertex: public vcg::VertexSimp2<MyVertex,MyEdge,MyFace, vcg::vert::InfoOcf,vcg::vert::Coord3d, vcg::vert::Normal3fOcc>{};
|
||||
class MyFace: public vcg::FaceSimp2<MyVertex,MyEdge,MyFace,vcg::face::VertexRef>{};
|
||||
class MyMesh: public vcg::tri::TriMesh< vcg::vert::vector_occ<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.EnableAttribute<vcg::vert::Normal3fOcc::NormalType>(); // this allocate the memory to store the normal
|
||||
(*vi).N() = vcg::Point3f(1.0,1.0,1.0); // OK
|
||||
m.vert.DisableAttribute<vcg::vert::Normal3fOcc::NormalType>(); // this deallocate the memory to store the normal
|
||||
|
||||
(*vi).N() = vcg::Point3f(1.0,1.0,1.0); // ERROR (again)!
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue