1 #ifndef __VCG_MESH__ 2 #define __VCG_MESH__ 3 4 #include<vcg/complex/complex.h>// 5 6 // input output 7 #include<wrap/io_trimesh/import.h> 8 #include<wrap/io_trimesh/export.h>//just in case 9 10 // topology computation 11 //#include<vcg/complex/algorithms/update/topology.h>// 12 //#include<vcg/complex/algorithms/update/flag.h>// 13 14 // half edge iterators 15 //#include<vcg/simplex/face/pos.h> 16 17 // normals and curvature 18 #include<vcg/complex/algorithms/update/bounding.h> //class UpdateNormals 19 #include<vcg/complex/algorithms/update/normal.h> //class UpdateNormals 20 #include<vcg/complex/algorithms/update/curvature.h> //class curvature 21 22 #include "../utils/release_assert.h" 23 24 extern Logging * lgn; 25 26 class vcgFace; // dummy prototype 27 class vcgVertex; 28 29 struct vcgUsedType : public vcg::UsedTypes< vcg::Use<vcgVertex>::AsVertexType,vcg::Use<vcgFace>::AsFaceType>{}; 30 31 class vcgVertex : public vcg::Vertex< vcgUsedType, vcg::vertex::InfoOcf, vcg::vertex::Coord3f, vcg::vertex::Color4bOcf, vcg::vertex::Normal3f,vcg::vertex::BitFlags >{}; 32 class vcgFace : public vcg::Face < vcgUsedType, vcg::face::VertexRef, vcg::face::Normal3f, vcg::face::BitFlags> {}; 33 class vcgMesh : public vcg::tri::TriMesh< vcg::vertex::vector_ocf<vcgVertex>, std::vector<vcgFace> > {}; 34 35 36 struct OFace{ OFaceOFace37 OFace(){} OFaceOFace38 OFace(const int & i0,const int & i1,const int & i2){ 39 v[0] = i0; 40 v[1] = i1; 41 v[2] = i2; 42 } 43 unsigned int v[3]; 44 unsigned int & operator[](const int & i) { assert(i>=0); assert ( i <3); return v[i];} VNOFace45 unsigned int VN(){return 3;} 46 }; 47 48 49 struct OVertex{ OVertexOVertex50 OVertex( ) {} 51 52 template <class VertexType> OVertexOVertex53 OVertex(const float & x,const float & y,const float & z){ 54 p[0]=x;p[1]=y;p[2]=z;} OVertexOVertex55 OVertex(const vcg::Point3f _p){ p = _p; } 56 57 template <class VertexType> OVertexOVertex58 OVertex(const VertexType & v){ p =v.P();} 59 POVertex60 vcg::Point3f & P(){return p;} 61 62 private: 63 vcg::Point3f p; 64 }; 65 66 67 68 69 #endif // __VCG_MESH__ 70