$search
00001 00002 00003 00004 /* 00005 * MeshDefinition.h 00006 * 00007 * Created on: Oct 7, 2010 00008 * Author: christian 00009 */ 00010 00011 #ifndef MESHDEFINITION_H_ 00012 #define MESHDEFINITION_H_ 00013 00014 00015 00016 #include <vcg/simplex/vertex/base.h> 00017 #include <vcg/simplex/vertex/component.h> 00018 #include <vcg/complex/trimesh/allocate.h> 00019 #include <vcg/complex/used_types.h> 00020 #include <vcg/simplex/face/base.h> 00021 #include <vcg/simplex/face/component.h> 00022 00023 // Forward declarations needed for creating the used types 00024 class CVertexO; 00025 class CEdge; 00026 class CFaceO; 00027 00028 // Declaration of the semantic of the used types 00029 class CUsedTypesO: public vcg::UsedTypes < vcg::Use<CVertexO>::AsVertexType, 00030 vcg::Use<CEdge >::AsEdgeType, 00031 vcg::Use<CFaceO >::AsFaceType >{}; 00032 00033 00034 // The Main Vertex Class 00035 // Most of the attributes are optional and must be enabled before use. 00036 // Each vertex needs 40 byte, on 32bit arch. and 44 byte on 64bit arch. 00037 00038 class CVertexO : public vcg::Vertex< CUsedTypesO, 00039 vcg::vertex::InfoOcf, /* 4b */ 00040 vcg::vertex::Coord3f, /* 12b */ 00041 vcg::vertex::BitFlags, /* 4b */ 00042 vcg::vertex::Normal3f, /* 12b */ 00043 vcg::vertex::Qualityf, /* 4b */ 00044 vcg::vertex::Color4b, /* 4b */ 00045 vcg::vertex::VFAdjOcf, /* 0b */ 00046 vcg::vertex::MarkOcf, /* 0b */ 00047 vcg::vertex::TexCoordfOcf, /* 0b */ 00048 vcg::vertex::CurvaturefOcf, /* 0b */ 00049 vcg::vertex::CurvatureDirfOcf, /* 0b */ 00050 vcg::vertex::RadiusfOcf /* 0b */ 00051 >{ 00052 }; 00053 00054 00055 // The Main Edge Class 00056 // Currently it does not contains anything. 00057 class CEdge : public vcg::Edge<CUsedTypesO, vcg::edge::EVAdj> { 00058 public: 00059 inline CEdge(){}; 00060 inline CEdge( CVertexO * v0, CVertexO * v1){ V(0)= v0 ; V(1)= v1;}; 00061 static inline CEdge OrderedEdge(CVertexO* v0,CVertexO* v1){ 00062 if(v0<v1) return CEdge(v0,v1); 00063 else return CEdge(v1,v0); 00064 } 00065 }; 00066 00067 // Each face needs 32 byte, on 32bit arch. and 48 byte on 64bit arch. 00068 class CFaceO : public vcg::Face< CUsedTypesO, 00069 vcg::face::InfoOcf, /* 4b */ 00070 vcg::face::VertexRef, /*12b */ 00071 vcg::face::BitFlags, /* 4b */ 00072 vcg::face::Normal3f, /*12b */ 00073 vcg::face::QualityfOcf, /* 0b */ 00074 vcg::face::MarkOcf, /* 0b */ 00075 vcg::face::Color4bOcf, /* 0b */ 00076 vcg::face::FFAdjOcf, /* 0b */ 00077 vcg::face::VFAdjOcf, /* 0b */ 00078 vcg::face::WedgeTexCoordfOcf /* 0b */ 00079 > {}; 00080 00081 class CMeshO : public vcg::tri::TriMesh< vcg::vertex::vector_ocf<CVertexO>, vcg::face::vector_ocf<CFaceO> > {}; 00082 00083 00084 #endif /* MESHDEFINITION_H_ */