00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #if defined(_MSC_VER)
00025 #pragma warning( disable : 4804 )
00026 #endif
00027 #include <assert.h>
00028 #include <string>
00029 #include <vector>
00030 #include <set>
00031 #include <vcg/space/box3.h>
00032 #include <vcg/space/color4.h>
00033 #include <vcg/math/shot.h>
00034
00035 #include <vcg/container/simple_temporary_data.h>
00036 #include <vcg/simplex/vertex/base.h>
00037 #include <vcg/simplex/edge/base.h>
00038 #include <vcg/simplex/face/base.h>
00039 #include <vcg/connectors/hedge.h>
00040 #include <vcg/complex/used_types.h>
00041 #include <vcg/container/derivation_chain.h>
00042
00043
00044
00045 #ifndef __VCG_MESH
00046 #define __VCG_MESH
00047
00048 namespace vcg {
00049 namespace tri {
00052
00060
00061
00062
00063 template <class TYPESPOOL>
00064 struct BaseMeshTypeHolder{
00065
00066 typedef bool ScalarType;
00067 typedef std::vector< typename TYPESPOOL::VertexType > CONTV;
00068 typedef std::vector< typename TYPESPOOL::EdgeType > CONTE;
00069 typedef std::vector< typename TYPESPOOL::FaceType > CONTF;
00070 typedef std::vector< typename TYPESPOOL::HEdgeType > CONTH;
00071
00072 typedef CONTV VertContainer;
00073 typedef _Vertex VertexType;
00074 typedef typename TYPESPOOL::VertexPointer VertexPointer;
00075 typedef const typename TYPESPOOL::VertexPointer ConstVertexPointer;
00076 typedef bool CoordType;
00077 typedef typename CONTV::iterator VertexIterator;
00078 typedef typename CONTV::const_iterator ConstVertexIterator;
00079
00080 typedef CONTE EdgeContainer;
00081 typedef typename CONTE::value_type EdgeType;
00082 typedef typename TYPESPOOL::EdgePointer EdgePointer;
00083 typedef typename CONTE::iterator EdgeIterator;
00084 typedef typename CONTE::const_iterator ConstEdgeIterator;
00085
00086 typedef CONTF FaceContainer;
00087 typedef typename CONTF::value_type FaceType;
00088 typedef typename CONTF::const_iterator ConstFaceIterator;
00089 typedef typename CONTF::iterator FaceIterator;
00090 typedef typename TYPESPOOL::FacePointer FacePointer;
00091 typedef const typename TYPESPOOL::FacePointer ConstFacePointer;
00092
00093 typedef CONTH HEdgeContainer;
00094 typedef typename CONTH::value_type HEdgeType;
00095 typedef typename TYPESPOOL::HEdgePointer HEdgePointer;
00096 typedef typename CONTH::iterator HEdgeIterator;
00097 typedef typename CONTH::const_iterator ConstHEdgeIterator;
00098
00099
00100 };
00101
00102
00103
00104 template <class T, typename CONT, class TRAIT >
00105 struct MeshTypeHolder: public T {};
00106
00107 template <class T, typename CONT>
00108 struct MeshTypeHolder<T, CONT, AllTypes::AVertexType>: public T {
00109 typedef CONT VertContainer;
00110 typedef typename VertContainer::value_type VertexType;
00111 typedef VertexType * VertexPointer;
00112 typedef const VertexType * ConstVertexPointer;
00113 typedef typename VertexType::ScalarType ScalarType;
00114 typedef typename VertexType::CoordType CoordType;
00115 typedef typename VertContainer::iterator VertexIterator;
00116 typedef typename VertContainer::const_iterator ConstVertexIterator;
00117 };
00118
00119
00120 template <typename T, class CONT>
00121 struct MeshTypeHolder< T, CONT, AllTypes::AEdgeType>: public T{
00122 typedef CONT EdgeContainer;
00123 typedef typename EdgeContainer::value_type EdgeType;
00124 typedef typename EdgeContainer::value_type * EdgePointer;
00125 typedef typename EdgeContainer::iterator EdgeIterator;
00126 typedef typename EdgeContainer::const_iterator ConstEdgeIterator;
00127 };
00128
00129 template <typename T, class CONT>
00130 struct MeshTypeHolder< T, CONT, AllTypes::AFaceType>:public T {
00131 typedef CONT FaceContainer;
00132 typedef typename FaceContainer::value_type FaceType;
00133 typedef typename FaceContainer::const_iterator ConstFaceIterator;
00134 typedef typename FaceContainer::iterator FaceIterator;
00135 typedef FaceType * FacePointer;
00136 typedef const FaceType * ConstFacePointer;
00137 };
00138
00139 template <typename T, class CONT>
00140 struct MeshTypeHolder< T, CONT, AllTypes::AHEdgeType>: public T{
00141 typedef CONT HEdgeContainer;
00142 typedef typename HEdgeContainer::value_type HEdgeType;
00143 typedef typename HEdgeContainer::value_type * HEdgePointer;
00144 typedef typename HEdgeContainer::iterator HEdgeIterator;
00145 typedef typename HEdgeContainer::const_iterator ConstHEdgeIterator;
00146 };
00147
00148
00149
00150
00151 ;
00152
00153 template <typename T, typename CONT> struct Der: public MeshTypeHolder<T,CONT, typename CONT::value_type::IAm>{};
00154 struct DummyContainer{struct value_type{ typedef int IAm;}; };
00155
00156 template < class Container0 = DummyContainer, class Container1 = DummyContainer, class Container2 = DummyContainer, class Container3 = DummyContainer >
00157 class TriMesh
00158 : public MArity4< BaseMeshTypeHolder<typename Container0::value_type::TypesPool>, Container0, Der ,Container1, Der, Container2, Der, Container3, Der>{
00159 public:
00160
00161 typedef typename TriMesh::ScalarType ScalarType;
00162 typedef typename TriMesh::VertContainer VertContainer;
00163 typedef typename TriMesh::EdgeContainer EdgeContainer;
00164 typedef typename TriMesh::FaceContainer FaceContainer;
00165
00166
00167 typedef typename TriMesh::VertexType VertexType;
00168 typedef typename TriMesh::VertexPointer VertexPointer;
00169 typedef typename TriMesh::ConstVertexPointer ConstVertexPointer;
00170 typedef typename TriMesh::CoordType CoordType;
00171 typedef typename TriMesh::VertexIterator VertexIterator;
00172 typedef typename TriMesh::ConstVertexIterator ConstVertexIterator;
00173
00174
00175 typedef typename TriMesh::EdgeType EdgeType;
00176 typedef typename TriMesh::EdgePointer EdgePointer;
00177 typedef typename TriMesh::EdgeIterator EdgeIterator;
00178 typedef typename TriMesh::ConstEdgeIterator ConstEdgeIterator;
00179
00180
00181 typedef typename TriMesh::FaceType FaceType;
00182 typedef typename TriMesh::ConstFaceIterator ConstFaceIterator;
00183 typedef typename TriMesh::FaceIterator FaceIterator;
00184 typedef typename TriMesh::FacePointer FacePointer;
00185 typedef typename TriMesh::ConstFacePointer ConstFacePointer;
00186
00187
00188 typedef typename TriMesh::HEdgeType HEdgeType;
00189 typedef typename TriMesh::HEdgePointer HEdgePointer;
00190 typedef typename TriMesh::HEdgeIterator HEdgeIterator;
00191 typedef typename TriMesh::HEdgeContainer HEdgeContainer;
00192 typedef typename TriMesh::ConstHEdgeIterator ConstHEdgeIterator;
00193
00194 typedef TriMesh<Container0, Container1,Container2,Container3> MeshType;
00195
00196 typedef Box3<ScalarType> BoxType;
00197
00199 VertContainer vert;
00201 int vn;
00203 FaceContainer face;
00205 int fn;
00207 EdgeContainer edge;
00209 int en;
00211 HEdgeContainer hedge;
00213 int hn;
00215 Box3<ScalarType> bbox;
00216
00218
00219 std::vector<std::string> textures;
00220
00221 std::vector<std::string> normalmaps;
00222
00223 int attrn;
00224
00225 class PointerToAttribute{
00226 public:
00227 void * _handle;
00228 std::string _name;
00229 std::string _typename;
00230 int _sizeof;
00231 int _padding;
00232
00233 int n_attr;
00234 void Resize(const int & sz){((SimpleTempDataBase<VertContainer>*)_handle)->Resize(sz);}
00235 void Reorder(std::vector<size_t> & newVertIndex){((SimpleTempDataBase<VertContainer>*)_handle)->Reorder(newVertIndex);}
00236 bool operator<(const PointerToAttribute b) const { return(_name.empty()&&b._name.empty())?(_handle < b._handle):( _name < b._name);}
00237 };
00238
00239 std::set< PointerToAttribute > vert_attr;
00240 std::set< PointerToAttribute > edge_attr;
00241 std::set< PointerToAttribute > face_attr;
00242 std::set< PointerToAttribute > mesh_attr;
00243
00244
00245 template <class ATTR_TYPE, class CONT>
00246 class AttributeHandle{
00247 public:
00248 AttributeHandle(){_handle=(SimpleTempData<CONT,ATTR_TYPE> *)NULL;}
00249 AttributeHandle( void *ah,const int & n):_handle ( (SimpleTempData<CONT,ATTR_TYPE> *)ah ),n_attr(n){}
00250 AttributeHandle operator = ( const CONT & pva){
00251 _handle = (SimpleTempData<CONT,ATTR_TYPE> *)pva._handle;
00252 n_attr = pva.n_attr;
00253 return (*this);
00254 }
00255
00256
00257 SimpleTempData<CONT,ATTR_TYPE> * _handle;
00258
00259
00260 int n_attr;
00261
00262
00263 template <class RefType>
00264 ATTR_TYPE & operator [](const RefType & i){return (*_handle)[i];}
00265 };
00266
00267 template <class ATTR_TYPE>
00268 class PerVertexAttributeHandle: public AttributeHandle<ATTR_TYPE,VertContainer>{
00269 public:
00270 PerVertexAttributeHandle():AttributeHandle<ATTR_TYPE,VertContainer>(){}
00271 PerVertexAttributeHandle( void *ah,const int & n):AttributeHandle<ATTR_TYPE,VertContainer>(ah,n){};
00272 };
00273
00274 template <class ATTR_TYPE>
00275 class PerFaceAttributeHandle: public AttributeHandle<ATTR_TYPE,FaceContainer>{
00276 public:
00277 PerFaceAttributeHandle():AttributeHandle<ATTR_TYPE,FaceContainer>(){}
00278 PerFaceAttributeHandle( void *ah,const int & n):AttributeHandle<ATTR_TYPE,FaceContainer>(ah,n){};
00279 };
00280
00281 template <class ATTR_TYPE>
00282 class PerEdgeAttributeHandle: public AttributeHandle<ATTR_TYPE,EdgeContainer>{
00283 public:
00284 PerEdgeAttributeHandle():AttributeHandle<ATTR_TYPE,EdgeContainer>(){}
00285 PerEdgeAttributeHandle( void *ah,const int & n):AttributeHandle<ATTR_TYPE,EdgeContainer>(ah,n){};
00286 };
00287
00288 template <class ATTR_TYPE>
00289 class PerMeshAttributeHandle{
00290 public:
00291 PerMeshAttributeHandle(){_handle=NULL;}
00292 PerMeshAttributeHandle(void *ah,const int & n):_handle ( (Attribute<ATTR_TYPE> *)ah ),n_attr(n){}
00293 PerMeshAttributeHandle operator = ( const PerMeshAttributeHandle & pva){
00294 _handle = (Attribute<ATTR_TYPE> *)pva._handle;
00295 n_attr = pva.n_attr;
00296 return (*this);
00297 }
00298 Attribute<ATTR_TYPE> * _handle;
00299 int n_attr;
00300 ATTR_TYPE & operator ()(){ return *((Attribute<ATTR_TYPE> *)_handle)->attribute;}
00301 };
00302
00303
00304
00305 Shot<ScalarType> shot;
00306
00307 private:
00309 Color4b c;
00310 public:
00311
00312 inline const Color4b & C() const
00313 {
00314 return c;
00315 }
00316
00317 inline Color4b & C()
00318 {
00319 return c;
00320 }
00321
00322
00324 TriMesh()
00325 {
00326 fn = vn = 0;
00327 imark = 0;
00328 attrn = 0;
00329 C()=Color4b::Gray;
00330 }
00331
00333 ~TriMesh()
00334 {
00335 typename std::set< PointerToAttribute>::iterator i;
00336 for( i = vert_attr.begin(); i != vert_attr.end(); ++i)
00337 delete ((SimpleTempDataBase<VertContainer>*)(*i)._handle);
00338 for( i = edge_attr.begin(); i != edge_attr.end(); ++i)
00339 delete ((SimpleTempDataBase<EdgeContainer>*)(*i)._handle);
00340 for( i = face_attr.begin(); i != face_attr.end(); ++i)
00341 delete ((SimpleTempDataBase<FaceContainer>*)(*i)._handle);
00342 for( i = mesh_attr.begin(); i != mesh_attr.end(); ++i)
00343 delete ((AttributeBase*)(*i)._handle);
00344
00345 FaceIterator fi;
00346 for(fi = face.begin(); fi != face.end(); ++fi) (*fi).Dealloc();
00347 }
00348
00349 int Mem(const int & nv, const int & nf) const {
00350 typename std::set< PointerToAttribute>::const_iterator i;
00351 int size = 0;
00352 size += sizeof(TriMesh)+sizeof(VertexType)*nv+sizeof(FaceType)*nf;
00353
00354 for( i = vert_attr.begin(); i != vert_attr.end(); ++i)
00355 size += ((SimpleTempDataBase<VertContainer>*)(*i)._handle)->SizeOf()*nv;
00356 for( i = edge_attr.begin(); i != edge_attr.end(); ++i)
00357 size += ((SimpleTempDataBase<EdgeContainer>*)(*i)._handle)->SizeOf()*en;
00358 for( i = face_attr.begin(); i != face_attr.end(); ++i)
00359 size += ((SimpleTempDataBase<FaceContainer>*)(*i)._handle)->SizeOf()*nf;
00360 for( i = mesh_attr.begin(); i != mesh_attr.end(); ++i)
00361 size += ((AttributeBase*)(*i)._handle)->SizeOf();
00362
00363 return size;
00364 }
00365 int MemUsed() const {return Mem(vert.size(),face.size());}
00366 inline int MemNeeded() const {return Mem(vn,fn);}
00367
00368
00369
00371 void Clear()
00372 {
00373 vert.clear();
00374 face.clear();
00375
00376
00377 vn = 0;
00378 fn = 0;
00379 }
00380
00382 static bool HasPerVertexNormal() { return VertexType::HasNormal() ; }
00383 static bool HasPerVertexColor() { return VertexType::HasColor() ; }
00384 static bool HasPerVertexMark() { return VertexType::HasMark() ; }
00385 static bool HasPerVertexQuality() { return VertexType::HasQuality(); }
00386 static bool HasPerVertexTexCoord(){ return VertexType::HasTexCoord(); }
00387 static bool HasPerVertexRadius() { return VertexType::HasRadius(); }
00388 static bool HasPerVertexFlags() { return VertexType::HasFlags(); }
00389
00390 static bool HasPolyInfo() { return FaceType::HasPolyInfo() ; }
00391 static bool HasPerFaceColor() { return FaceType::HasFaceColor() ; }
00392 static bool HasPerFaceNormal() { return FaceType::HasFaceNormal() ; }
00393 static bool HasPerFaceMark() { return FaceType::HasFaceMark() ; }
00394 static bool HasPerFaceQuality() { return FaceType::HasFaceQuality(); }
00395 static bool HasPerFaceFlags() { return FaceType::HasFlags(); }
00396
00397 static bool HasPerWedgeColor() { return FaceType::HasWedgeColor() ; }
00398 static bool HasPerWedgeNormal() { return FaceType::HasWedgeNormal() ; }
00399 static bool HasPerWedgeMark() { return FaceType::HasWedgeMark() ; }
00400 static bool HasPerWedgeQuality() { return FaceType::HasWedgeQuality(); }
00401 static bool HasPerWedgeTexCoord() { return FaceType::HasWedgeTexCoord(); }
00402
00403 static bool HasFFTopology() { return FaceType::HasFFAdjacency(); }
00404 static bool HasVFTopology() { return ((FaceType::HasVFAdjacency())&&(VertexType::HasVFAdjacency())); }
00405 static bool HasTopology() { return HasFFTopology() || HasVFTopology(); }
00406
00407 int & SimplexNumber(){ return fn;}
00408 int & VertexNumber(){ return vn;}
00409
00411 int imark;
00412
00414 ScalarType Volume()
00415 {
00416 FaceIterator fi;
00417 int j,k;
00418 ScalarType V = 0;
00419 CoordType T,N,B;
00420
00421 for(fi = face.begin(); fi!=face.end(); ++fi)
00422 {
00423 for(j = 0; j < 3; ++j)
00424 {
00425
00426 k = (j+1)%3;
00427 T = (*fi).P(k) - (*fi).P(j);
00428 T.Normalize();
00429 B = ( (*fi).P( k ) - (*fi).P(j) ) ^
00430 ( (*fi).P((k+1)%3) - (*fi).P(j) ) ;
00431 B.Normalize();
00432 N = T ^ B;
00433
00434 CoordType pj = (*fi).P(j);
00435 CoordType pk = (*fi).P(k);
00436
00437
00438 V += (pk* T )*(pk*N)*(pk*B);
00439 V += (pj*(-T))*(pj*N)*(pj*B);
00440 }
00441 }
00442 return V/6.0;
00443 }
00444
00445 private:
00446
00447 TriMesh operator =(const TriMesh & m){assert(0);return TriMesh();}
00448 TriMesh(const TriMesh & ){}
00449
00450 };
00451
00453 template <class MeshType> inline void InitFaceIMark(MeshType & m)
00454 {
00455 typename MeshType::FaceIterator f;
00456
00457 for(f=m.face.begin();f!=m.face.end();++f)
00458 if( !(*f).IsD() && (*f).IsR() && (*f).IsW() )
00459 (*f).InitIMark();
00460 }
00461
00463 template <class MeshType> inline void InitVertexIMark(MeshType & m)
00464 {
00465 typename MeshType::VertexIterator vi;
00466
00467 for(vi=m.vert.begin();vi!=m.vert.end();++vi)
00468 if( !(*vi).IsD() && (*vi).IsRW() )
00469 (*vi).InitIMark();
00470 }
00473 template <class MeshType> inline int & IMark(MeshType & m){return m.imark;}
00474
00478 template <class MeshType> inline bool IsMarked(MeshType & m, typename MeshType::ConstVertexPointer v ) { return v->IMark() == m.imark; }
00482 template <class MeshType> inline bool IsMarked( MeshType & m,typename MeshType::ConstFacePointer f ) { return f->IMark() == m.imark; }
00486 template <class MeshType> inline void Mark(MeshType & m, typename MeshType::VertexPointer v ) { v->IMark() = m.imark; }
00490 template <class MeshType> inline void Mark(MeshType & m, typename MeshType::FacePointer f ) { f->IMark() = m.imark; }
00492 template <class MeshType> inline void UnMarkAll(MeshType & m) { ++m.imark; }
00493
00494
00495
00496 template < class ContainerType0, class ContainerType1 , class ContainerType2, class ContainerType3>
00497 bool HasPerVertexVFAdjacency (const TriMesh < ContainerType0, ContainerType1, ContainerType2, ContainerType3> & ) {return TriMesh < ContainerType0 , ContainerType1, ContainerType2, ContainerType3>::VertContainer::value_type::HasVFAdjacency();}
00498
00499 template < class ContainerType0, class ContainerType1 , class ContainerType2, class ContainerType3>
00500 bool HasPerVertexQuality (const TriMesh < ContainerType0, ContainerType1, ContainerType2, ContainerType3> & ) {return TriMesh < ContainerType0 , ContainerType1, ContainerType2, ContainerType3>::VertContainer::value_type::HasQuality();}
00501
00502 template < class ContainerType0, class ContainerType1 , class ContainerType2, class ContainerType3>
00503 bool HasPerVertexMark (const TriMesh < ContainerType0, ContainerType1, ContainerType2, ContainerType3> & ) {return TriMesh < ContainerType0 , ContainerType1, ContainerType2, ContainerType3>::VertContainer::value_type::HasMark();}
00504
00505 template < class ContainerType0, class ContainerType1, class ContainerType2 , class ContainerType3>
00506 bool HasPerVertexCurvature (const TriMesh < ContainerType0, ContainerType1, ContainerType2, ContainerType3> & ) {return TriMesh < ContainerType0 , ContainerType1, ContainerType2, ContainerType3>::VertContainer::value_type::HasCurvature();}
00507
00508 template < class ContainerType0, class ContainerType1 , class ContainerType2, class ContainerType3>
00509 bool HasPerVertexCurvatureDir (const TriMesh < ContainerType0, ContainerType1, ContainerType2, ContainerType3> & ) {return TriMesh < ContainerType0 , ContainerType1, ContainerType2, ContainerType3>::VertContainer::value_type::HasCurvatureDir();}
00510
00511 template < class ContainerType0, class ContainerType1 , class ContainerType2, class ContainerType3>
00512 bool HasPerVertexColor (const TriMesh < ContainerType0, ContainerType1, ContainerType2, ContainerType3> & ) {return TriMesh < ContainerType0 , ContainerType1, ContainerType2, ContainerType3>::VertContainer::value_type::HasColor();}
00513
00514 template < class ContainerType0, class ContainerType1, class ContainerType2 , class ContainerType3>
00515 bool HasPerVertexTexCoord (const TriMesh < ContainerType0, ContainerType1, ContainerType2, ContainerType3> & ) {return TriMesh < ContainerType0 , ContainerType1, ContainerType2, ContainerType3>::VertContainer::value_type::HasTexCoord();}
00516
00517 template < class ContainerType0, class ContainerType1, class ContainerType2 , class ContainerType3>
00518 bool HasPerVertexFlags (const TriMesh < ContainerType0, ContainerType1, ContainerType2, ContainerType3> & ) {return TriMesh < ContainerType0 , ContainerType1, ContainerType2, ContainerType3>::VertContainer::value_type::HasFlags();}
00519
00520 template < class ContainerType0, class ContainerType1, class ContainerType2, class ContainerType3 >
00521 bool HasPerVertexNormal (const TriMesh < ContainerType0, ContainerType1, ContainerType2, ContainerType3> & ) {return TriMesh < ContainerType0 , ContainerType1, ContainerType2, ContainerType3>::VertContainer::value_type::HasNormal();}
00522
00523 template < class ContainerType0, class ContainerType1, class ContainerType2 , class ContainerType3>
00524 bool HasPerVertexRadius (const TriMesh < ContainerType0, ContainerType1, ContainerType2, ContainerType3> & ) {return TriMesh < ContainerType0 , ContainerType1, ContainerType2, ContainerType3>::VertContainer::value_type::HasRadius();}
00525
00526 template < class ContainerType0, class ContainerType1, class ContainerType2 , class ContainerType3>
00527 bool HasPerWedgeTexCoord (const TriMesh < ContainerType0, ContainerType1, ContainerType2, ContainerType3> & ) {return TriMesh < ContainerType0 , ContainerType1, ContainerType2, ContainerType3>::FaceContainer::value_type::HasWedgeTexCoord();}
00528
00529 template < class ContainerType0, class ContainerType1, class ContainerType2 , class ContainerType3>
00530 bool HasPerWedgeNormal (const TriMesh < ContainerType0, ContainerType1, ContainerType2, ContainerType3> & ) {return TriMesh < ContainerType0 , ContainerType1, ContainerType2, ContainerType3>::FaceContainer::value_type::HasWedgeNormal();}
00531
00532 template < class ContainerType0, class ContainerType1, class ContainerType2 , class ContainerType3>
00533 bool HasPerWedgeColor (const TriMesh < ContainerType0, ContainerType1, ContainerType2, ContainerType3> & ) {return TriMesh < ContainerType0 , ContainerType1, ContainerType2, ContainerType3>::FaceContainer::value_type::HasWedgeColor();}
00534
00535 template < class ContainerType0, class ContainerType1, class ContainerType2 , class ContainerType3>
00536 bool HasPerFaceVFAdjacency (const TriMesh < ContainerType0, ContainerType1, ContainerType2, ContainerType3> & ) {return TriMesh < ContainerType0 , ContainerType1, ContainerType2, ContainerType3>::FaceContainer::value_type::HasVFAdjacency();}
00537
00538 template < class ContainerType0, class ContainerType1, class ContainerType2 , class ContainerType3>
00539 bool HasPerFaceFlags (const TriMesh < ContainerType0, ContainerType1, ContainerType2, ContainerType3> & ) {return TriMesh < ContainerType0 , ContainerType1, ContainerType2, ContainerType3>::FaceContainer::value_type::HasFlags();}
00540
00541 template < class ContainerType0, class ContainerType1, class ContainerType2 , class ContainerType3>
00542 bool HasPerFaceNormal (const TriMesh < ContainerType0, ContainerType1, ContainerType2, ContainerType3> & ) {return TriMesh < ContainerType0 , ContainerType1, ContainerType2, ContainerType3>::FaceContainer::value_type::HasFaceNormal();}
00543
00544 template < class ContainerType0, class ContainerType1, class ContainerType2 , class ContainerType3>
00545 bool HasPerFaceColor (const TriMesh < ContainerType0, ContainerType1, ContainerType2, ContainerType3> & ) {return TriMesh < ContainerType0 , ContainerType1, ContainerType2, ContainerType3>::FaceContainer::value_type::HasFaceColor();}
00546
00547 template < class ContainerType0, class ContainerType1, class ContainerType2 , class ContainerType3>
00548 bool HasPerFaceMark (const TriMesh < ContainerType0, ContainerType1, ContainerType2, ContainerType3> & ) {return TriMesh < ContainerType0 , ContainerType1, ContainerType2, ContainerType3>::FaceContainer::value_type::HasMark();}
00549
00550 template < class ContainerType0, class ContainerType1, class ContainerType2 , class ContainerType3>
00551 bool HasPerFaceQuality (const TriMesh < ContainerType0, ContainerType1, ContainerType2, ContainerType3> & ) {return TriMesh < ContainerType0 , ContainerType1, ContainerType2, ContainerType3>::FaceContainer::value_type::HasFaceQuality();}
00552
00553 template < class ContainerType0, class ContainerType1, class ContainerType2 , class ContainerType3>
00554 bool HasFFAdjacency (const TriMesh < ContainerType0, ContainerType1, ContainerType2, ContainerType3> & ) {return TriMesh < ContainerType0 , ContainerType1, ContainerType2, ContainerType3>::FaceContainer::value_type::HasFFAdjacency();}
00555
00556 template < class ContainerType0, class ContainerType1, class ContainerType2 , class ContainerType3>
00557 bool HasFEAdjacency (const TriMesh < ContainerType0, ContainerType1, ContainerType2, ContainerType3> & ) {return TriMesh < ContainerType0 , ContainerType1, ContainerType2, ContainerType3>::FaceContainer::value_type::HasFEAdjacency();}
00558
00559 template < class ContainerType0, class ContainerType1, class ContainerType2 , class ContainerType3>
00560 bool HasFVAdjacency (const TriMesh < ContainerType0, ContainerType1, ContainerType2, ContainerType3> & ) {return TriMesh < ContainerType0 , ContainerType1, ContainerType2, ContainerType3>::FaceContainer::value_type::HasFVAdjacency();}
00561
00562 template < class ContainerType0, class ContainerType1, class ContainerType2 , class ContainerType3>
00563 bool HasVEAdjacency (const TriMesh < ContainerType0, ContainerType1, ContainerType2, ContainerType3> & ) {return TriMesh < ContainerType0 , ContainerType1, ContainerType2, ContainerType3>::VertContainer::value_type::HasVEAdjacency();}
00564
00565 template < class ContainerType0, class ContainerType1, class ContainerType2 , class ContainerType3>
00566 bool HasVHAdjacency (const TriMesh < ContainerType0, ContainerType1, ContainerType2, ContainerType3> & ) {return TriMesh < ContainerType0 , ContainerType1, ContainerType2, ContainerType3>::VertContainer::value_type::HasVHAdjacency();}
00567
00568 template < class ContainerType0, class ContainerType1, class ContainerType2 , class ContainerType3>
00569 bool HasEVAdjacency (const TriMesh < ContainerType0, ContainerType1, ContainerType2, ContainerType3> & ) {return TriMesh < ContainerType0 , ContainerType1, ContainerType2, ContainerType3>::EdgeType::HasEVAdjacency();}
00570
00571 template < class ContainerType0, class ContainerType1, class ContainerType2 , class ContainerType3>
00572 bool HasEEAdjacency (const TriMesh < ContainerType0, ContainerType1, ContainerType2, ContainerType3> & ) {return TriMesh < ContainerType0 , ContainerType1, ContainerType2, ContainerType3>::EdgeType::HasEEAdjacency();}
00573
00574 template < class ContainerType0, class ContainerType1, class ContainerType2 , class ContainerType3>
00575 bool HasEFAdjacency (const TriMesh < ContainerType0, ContainerType1, ContainerType2, ContainerType3> & ) {return TriMesh < ContainerType0 , ContainerType1, ContainerType2, ContainerType3>::EdgeType::HasEFAdjacency();}
00576
00577 template < class ContainerType0, class ContainerType1, class ContainerType2 , class ContainerType3>
00578 bool HasEHAdjacency (const TriMesh < ContainerType0, ContainerType1, ContainerType2, ContainerType3> & ) {return TriMesh < ContainerType0 , ContainerType1, ContainerType2, ContainerType3>::EdgeType::HasEHAdjacency();}
00579
00580 template < class ContainerType0, class ContainerType1, class ContainerType2 , class ContainerType3>
00581 bool HasFHAdjacency (const TriMesh < ContainerType0, ContainerType1, ContainerType2, ContainerType3> & ) {return TriMesh < ContainerType0 , ContainerType1, ContainerType2, ContainerType3>::FaceType::HasFHAdjacency();}
00582
00583 template < class ContainerType0, class ContainerType1, class ContainerType2 , class ContainerType3>
00584 bool HasHVAdjacency (const TriMesh < ContainerType0, ContainerType1, ContainerType2, ContainerType3> & ) {return TriMesh < ContainerType0 , ContainerType1, ContainerType2, ContainerType3>::HEdgeType::HasHVAdjacency();}
00585
00586 template < class ContainerType0, class ContainerType1, class ContainerType2 , class ContainerType3>
00587 bool HasHEAdjacency (const TriMesh < ContainerType0, ContainerType1, ContainerType2, ContainerType3> & ) {return TriMesh < ContainerType0 , ContainerType1, ContainerType2, ContainerType3>::HEdgeType::HasHEAdjacency();}
00588
00589 template < class ContainerType0, class ContainerType1, class ContainerType2 , class ContainerType3>
00590 bool HasHFAdjacency (const TriMesh < ContainerType0, ContainerType1, ContainerType2, ContainerType3> & ) {return TriMesh < ContainerType0 , ContainerType1, ContainerType2, ContainerType3>::HEdgeType::HasHFAdjacency();}
00591
00592 template < class ContainerType0, class ContainerType1, class ContainerType2 , class ContainerType3>
00593 bool HasHNextAdjacency (const TriMesh < ContainerType0, ContainerType1, ContainerType2, ContainerType3> & ) {return TriMesh< ContainerType0, ContainerType1, ContainerType2 , ContainerType3>::HEdgeType::HasHNextAdjacency();}
00594
00595 template < class ContainerType0, class ContainerType1, class ContainerType2 , class ContainerType3>
00596 bool HasHPrevAdjacency (const TriMesh < ContainerType0, ContainerType1, ContainerType2, ContainerType3> & ) {return TriMesh< ContainerType0, ContainerType1, ContainerType2 , ContainerType3>::HEdgeType::HasHPrevAdjacency();}
00597
00598 template < class ContainerType0, class ContainerType1, class ContainerType2 , class ContainerType3>
00599 bool HasHOppAdjacency (const TriMesh < ContainerType0, ContainerType1, ContainerType2, ContainerType3> & ) {return TriMesh< ContainerType0, ContainerType1, ContainerType2 , ContainerType3>::HEdgeType::HasHOppAdjacency();}
00600
00601
00602
00603
00604
00605
00606
00607
00608
00609
00610
00611
00612
00613
00614
00615
00616 template <class MESH_TYPE>
00617 bool HasPerVertexAttribute(const MESH_TYPE &m, std::string name){
00618 typename std::set< typename MESH_TYPE::PointerToAttribute>::const_iterator ai;
00619 typename MESH_TYPE::PointerToAttribute h;
00620 h._name = name;
00621 ai = m.vert_attr.find(h);
00622 return (ai!= m.vert_attr.end() ) ;
00623 }
00624 template <class MESH_TYPE>
00625 bool HasPerFaceAttribute(const MESH_TYPE &m, std::string name){
00626 typename std::set< typename MESH_TYPE::PointerToAttribute>::const_iterator ai;
00627 typename MESH_TYPE::PointerToAttribute h;
00628 h._name = name;
00629 ai = m.face_attr.find(h);
00630 return (ai!= m.face_attr.end() ) ;
00631 }
00632
00633 template <class MESH_TYPE>
00634 bool HasPerMeshAttribute(const MESH_TYPE &m, std::string name){
00635 typename std::set< typename MESH_TYPE::PointerToAttribute>::const_iterator ai;
00636 typename MESH_TYPE::PointerToAttribute h;
00637 h._name = name;
00638 ai = m.mesh_attr.find(h);
00639 return (ai!= m.mesh_attr.end() ) ;
00640 }
00641
00644 }
00645 }
00646
00647
00648 #endif
00649