Improved component documentation. Added IsVFInitialized, VFClear function for VF component. Clarified the difference between null and uninitialized for a VF component.
This commit is contained in:
parent
6950be4594
commit
4665f36e40
|
|
@ -8,7 +8,7 @@
|
||||||
* \ *
|
* \ *
|
||||||
* All rights reserved. *
|
* All rights reserved. *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
* it under the terms of the GNU General Public License as published by *
|
* it under the terms of the GNU General Public License as published by *
|
||||||
* the Free Software Foundation; either version 2 of the License, or *
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
* (at your option) any later version. *
|
* (at your option) any later version. *
|
||||||
|
|
@ -116,7 +116,13 @@ public:
|
||||||
char &FFi(int) { static char z=0; assert(0); return z;}
|
char &FFi(int) { static char z=0; assert(0); return z;}
|
||||||
char cVFi(int) const { static char z=0; assert(0); return z;}
|
char cVFi(int) const { static char z=0; assert(0); return z;}
|
||||||
char cFFi(int) const { static char z=0; assert(0); return z;}
|
char cFFi(int) const { static char z=0; assert(0); return z;}
|
||||||
|
bool IsVFInitialized(const int j) const {return static_cast<const typename T::FaceType *>(this)->cVFi(j)!=-1;}
|
||||||
|
void VFClear(int j) {
|
||||||
|
if(IsVFInitialized(j)) {
|
||||||
|
static_cast<typename T::FacePointer>(this)->VFp(j)=0;
|
||||||
|
static_cast<typename T::FacePointer>(this)->VFi(j)=-1;
|
||||||
|
}
|
||||||
|
}
|
||||||
static bool HasVFAdjacency() { return false; }
|
static bool HasVFAdjacency() { return false; }
|
||||||
static bool HasFFAdjacency() { return false; }
|
static bool HasFFAdjacency() { return false; }
|
||||||
static bool HasFEAdjacency() { return false; }
|
static bool HasFEAdjacency() { return false; }
|
||||||
|
|
@ -279,7 +285,7 @@ public: static void Name(std::vector<std::string> & name){name.push_back(std::st
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/*-------------------------- TexCoord ----------------------------------------*/
|
/*-------------------------- TexCoord ----------------------------------------*/
|
||||||
|
|
||||||
template <class A, class T> class WedgeTexCoord: public T {
|
template <class A, class T> class WedgeTexCoord: public T {
|
||||||
public:
|
public:
|
||||||
|
|
@ -334,7 +340,7 @@ public:
|
||||||
static void Name(std::vector<std::string> & name){name.push_back(std::string("BitFlags"));T::Name(name);}
|
static void Name(std::vector<std::string> & name){name.push_back(std::string("BitFlags"));T::Name(name);}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int _flags;
|
int _flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*-------------------------- Color ----------------------------------*/
|
/*-------------------------- Color ----------------------------------*/
|
||||||
|
|
@ -390,7 +396,7 @@ template <class T> class Color4b: public Color<vcg::Color4b, T> { public:
|
||||||
public: static void Name(std::vector<std::string> & name){name.push_back(std::string("Color4b"));T::Name(name);}
|
public: static void Name(std::vector<std::string> & name){name.push_back(std::string("Color4b"));T::Name(name);}
|
||||||
};
|
};
|
||||||
|
|
||||||
/*-------------------------- Quality ----------------------------------*/
|
/*-------------------------- Quality ----------------------------------*/
|
||||||
template <class A, class T> class Quality: public T {
|
template <class A, class T> class Quality: public T {
|
||||||
public:
|
public:
|
||||||
typedef A QualityType;
|
typedef A QualityType;
|
||||||
|
|
@ -402,12 +408,12 @@ public:
|
||||||
Q() = rightF.cQ();
|
Q() = rightF.cQ();
|
||||||
T::ImportData(rightF);
|
T::ImportData(rightF);
|
||||||
}
|
}
|
||||||
inline void Alloc(const int & ns){T::Alloc(ns);}
|
inline void Alloc(const int & ns){T::Alloc(ns);}
|
||||||
inline void Dealloc(){T::Dealloc();}
|
inline void Dealloc(){T::Dealloc();}
|
||||||
static bool HasQuality() { return true; }
|
static bool HasQuality() { return true; }
|
||||||
static void Name(std::vector<std::string> & name){name.push_back(std::string("Quality"));T::Name(name);}
|
static void Name(std::vector<std::string> & name){name.push_back(std::string("Quality"));T::Name(name);}
|
||||||
private:
|
private:
|
||||||
QualityType _quality;
|
QualityType _quality;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class T> class Qualitys: public Quality<short, T> {
|
template <class T> class Qualitys: public Quality<short, T> {
|
||||||
|
|
@ -449,7 +455,7 @@ template <class T> class Quality3d: public Quality3<double, T> {
|
||||||
public: static void Name(std::vector<std::string> & name){name.push_back(std::string("Quality3d"));T::Name(name);}
|
public: static void Name(std::vector<std::string> & name){name.push_back(std::string("Quality3d"));T::Name(name);}
|
||||||
};
|
};
|
||||||
|
|
||||||
/*-------------------------- INCREMENTAL MARK ----------------------------------------*/
|
/*-------------------------- INCREMENTAL MARK ----------------------------------------*/
|
||||||
/*! \brief Per vertex \b Incremental \b Mark
|
/*! \brief Per vertex \b Incremental \b Mark
|
||||||
|
|
||||||
It is just an \c int that allows to efficently (in constant time) un-mark the whole mesh. \sa UnmarkAll
|
It is just an \c int that allows to efficently (in constant time) un-mark the whole mesh. \sa UnmarkAll
|
||||||
|
|
@ -523,13 +529,32 @@ template <class T> class CurvatureDird: public CurvatureDir<CurvatureDirBaseType
|
||||||
public: static void Name(std::vector<std::string> & name){name.push_back(std::string("CurvatureDird"));T::Name(name);}
|
public: static void Name(std::vector<std::string> & name){name.push_back(std::string("CurvatureDird"));T::Name(name);}
|
||||||
};
|
};
|
||||||
|
|
||||||
/*----------------------------- VFADJ ------------------------------*/
|
/*----------------------------- VFADJ ------------------------------*/
|
||||||
|
/*! \brief \em Component: Per Face \b Vertex-Face adjacency relation
|
||||||
|
|
||||||
|
It stores a pointer to the next face of the list of faces incident on a vertex that is stored in a distributed way on the faces themselves.
|
||||||
|
Note that if you use this component it is expected that on the Vertex you use also the corresponding vcg::vertex::VFAdj component.
|
||||||
|
Note that for this component we have three class of values:
|
||||||
|
- \b valid: a valid pointer in the range of the vector of faces
|
||||||
|
- \b null: a null pointer, used to indicate the end of the list
|
||||||
|
- \b uninitialized: a special value that you can test/set with the IsVFInitialized()/VFClear() functions;
|
||||||
|
it is used to indicate when the VF Topology is not computed.
|
||||||
|
|
||||||
|
\sa vcg::tri::UpdateTopology for functions that compute this relation
|
||||||
|
\sa vcg::vertex::VFAdj
|
||||||
|
\sa iterators
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
template <class T> class VFAdj: public T {
|
template <class T> class VFAdj: public T {
|
||||||
public:
|
public:
|
||||||
VFAdj(){
|
VFAdj(){
|
||||||
_vfp[0]=0;
|
_vfp[0]=0;
|
||||||
_vfp[1]=0;
|
_vfp[1]=0;
|
||||||
_vfp[2]=0;
|
_vfp[2]=0;
|
||||||
|
_vfi[0]=-1;
|
||||||
|
_vfi[1]=-1;
|
||||||
|
_vfi[2]=-1;
|
||||||
}
|
}
|
||||||
typename T::FacePointer &VFp(const int j) { assert(j>=0 && j<3); return _vfp[j]; }
|
typename T::FacePointer &VFp(const int j) { assert(j>=0 && j<3); return _vfp[j]; }
|
||||||
typename T::FacePointer cVFp(const int j) const { assert(j>=0 && j<3); return _vfp[j]; }
|
typename T::FacePointer cVFp(const int j) const { assert(j>=0 && j<3); return _vfp[j]; }
|
||||||
|
|
@ -537,14 +562,14 @@ public:
|
||||||
char cVFi(const int j)const {return _vfi[j]; }
|
char cVFi(const int j)const {return _vfi[j]; }
|
||||||
template <class RightValueType>
|
template <class RightValueType>
|
||||||
void ImportData(const RightValueType & rightF){T::ImportData(rightF);}
|
void ImportData(const RightValueType & rightF){T::ImportData(rightF);}
|
||||||
inline void Alloc(const int & ns){T::Alloc(ns);}
|
inline void Alloc(const int & ns){T::Alloc(ns);}
|
||||||
inline void Dealloc(){T::Dealloc();}
|
inline void Dealloc(){T::Dealloc();}
|
||||||
static bool HasVFAdjacency() { return true; }
|
static bool HasVFAdjacency() { return true; }
|
||||||
static void Name(std::vector<std::string> & name){name.push_back(std::string("VFAdj"));T::Name(name);}
|
static void Name(std::vector<std::string> & name){name.push_back(std::string("VFAdj"));T::Name(name);}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typename T::FacePointer _vfp[3] ;
|
typename T::FacePointer _vfp[3] ;
|
||||||
char _vfi[3] ;
|
char _vfi[3] ;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*----------------------------- EFADJ ------------------------------*/
|
/*----------------------------- EFADJ ------------------------------*/
|
||||||
|
|
@ -574,7 +599,20 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------- FFADJ ------------------------------*/
|
/*----------------------------- FFADJ ------------------------------*/
|
||||||
|
/*! \brief \em Component: Per Face \b Face-Face adjacency relation
|
||||||
|
|
||||||
|
It encodes the adjacency of faces through edges; for 2-manifold edges it just point to the other face,
|
||||||
|
and for non manifold edges (where more than 2 faces share the same edge) it stores a pointer to the next
|
||||||
|
face of the ring of faces incident on a edge.
|
||||||
|
Note that border faces points to themselves.
|
||||||
|
NULL pointer is used as a special value to indicate when the FF Topology is not computed.
|
||||||
|
|
||||||
|
\sa vcg::tri::UpdateTopology for functions that compute this relation
|
||||||
|
\sa vcg::vertex::VFAdj
|
||||||
|
\sa iterators
|
||||||
|
*/
|
||||||
|
|
||||||
template <class T> class FFAdj: public T {
|
template <class T> class FFAdj: public T {
|
||||||
public:
|
public:
|
||||||
FFAdj(){
|
FFAdj(){
|
||||||
|
|
@ -605,7 +643,7 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------- FEADJ ------------------------------*/
|
/*----------------------------- FEADJ ------------------------------*/
|
||||||
|
|
||||||
template <class T> class FEAdj: public T {
|
template <class T> class FEAdj: public T {
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -101,9 +101,16 @@ public:
|
||||||
|
|
||||||
typename TT::FacePointer &VFp() { static typename TT::FacePointer fp=0; assert(0); return fp; }
|
typename TT::FacePointer &VFp() { static typename TT::FacePointer fp=0; assert(0); return fp; }
|
||||||
typename TT::FacePointer cVFp() const { static typename TT::FacePointer fp=0; assert(0); return fp; }
|
typename TT::FacePointer cVFp() const { static typename TT::FacePointer fp=0; assert(0); return fp; }
|
||||||
int &VFi() { static int z=0; assert(0); return z;}
|
int &VFi() { static int z=-1; assert(0); return z;}
|
||||||
int cVFi() const { static int z=0; assert(0); return z;}
|
int cVFi() const { static int z=-1; assert(0); return z;}
|
||||||
static bool HasVFAdjacency() { return false; }
|
static bool HasVFAdjacency() { return false; }
|
||||||
|
bool IsVFInitialized() const {return static_cast<const typename TT::VertexType *>(this)->cVFi()!=-1;}
|
||||||
|
void VFClear() {
|
||||||
|
if(IsVFInitialized()) {
|
||||||
|
static_cast<typename TT::VertexPointer>(this)->VFp()=0;
|
||||||
|
static_cast<typename TT::VertexPointer>(this)->VFi()=-1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
typename TT::EdgePointer &VEp() { static typename TT::EdgePointer ep=0; assert(0); return ep; }
|
typename TT::EdgePointer &VEp() { static typename TT::EdgePointer ep=0; assert(0); return ep; }
|
||||||
typename TT::EdgePointer cVEp() const { static typename TT::EdgePointer ep=0; assert(0); return ep; }
|
typename TT::EdgePointer cVEp() const { static typename TT::EdgePointer ep=0; assert(0); return ep; }
|
||||||
|
|
@ -229,7 +236,7 @@ public:
|
||||||
static void Name(std::vector<std::string> & name){name.push_back(std::string("Mark"));T::Name(name);}
|
static void Name(std::vector<std::string> & name){name.push_back(std::string("Mark"));T::Name(name);}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int _imark;
|
int _imark;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*-------------------------- TEXCOORD ----------------------------------------*/
|
/*-------------------------- TEXCOORD ----------------------------------------*/
|
||||||
|
|
@ -249,7 +256,7 @@ public:
|
||||||
template < class RightValueType>
|
template < class RightValueType>
|
||||||
void ImportData(const RightValueType & rVert ) { if(rVert.IsTexCoordEnabled()) T() = rVert.cT(); TT::ImportData( rVert); }
|
void ImportData(const RightValueType & rVert ) { if(rVert.IsTexCoordEnabled()) T() = rVert.cT(); TT::ImportData( rVert); }
|
||||||
static bool HasTexCoord() { return true; }
|
static bool HasTexCoord() { return true; }
|
||||||
static void Name(std::vector<std::string> & name){name.push_back(std::string("TexCoord"));TT::Name(name);}
|
static void Name(std::vector<std::string> & name){name.push_back(std::string("TexCoord"));TT::Name(name);}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
TexCoordType _t;
|
TexCoordType _t;
|
||||||
|
|
@ -311,7 +318,7 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class TT> class Color4b: public Color<vcg::Color4b, TT> {
|
template <class TT> class Color4b: public Color<vcg::Color4b, TT> {
|
||||||
public: static void Name(std::vector<std::string> & name){name.push_back(std::string("Color4b"));TT::Name(name);}
|
public: static void Name(std::vector<std::string> & name){name.push_back(std::string("Color4b"));TT::Name(name);}
|
||||||
};
|
};
|
||||||
|
|
||||||
/*-------------------------- Quality ----------------------------------*/
|
/*-------------------------- Quality ----------------------------------*/
|
||||||
|
|
@ -396,8 +403,8 @@ public: static void Name(std::vector<std::string> & name){name.push_back(std::st
|
||||||
template <class A, class TT> class CurvatureDir: public TT {
|
template <class A, class TT> class CurvatureDir: public TT {
|
||||||
public:
|
public:
|
||||||
typedef A CurvatureDirType;
|
typedef A CurvatureDirType;
|
||||||
typedef typename CurvatureDirType::VecType VecType;
|
typedef typename CurvatureDirType::VecType VecType;
|
||||||
typedef typename CurvatureDirType::ScalarType ScalarType;
|
typedef typename CurvatureDirType::ScalarType ScalarType;
|
||||||
|
|
||||||
VecType &PD1(){ return _curv.max_dir;}
|
VecType &PD1(){ return _curv.max_dir;}
|
||||||
VecType &PD2(){ return _curv.min_dir;}
|
VecType &PD2(){ return _curv.min_dir;}
|
||||||
|
|
@ -485,10 +492,11 @@ private:
|
||||||
/*----------------------------- VFADJ ------------------------------*/
|
/*----------------------------- VFADJ ------------------------------*/
|
||||||
/*! \brief \em Component: Per vertex \b Vertex-Face adjacency relation
|
/*! \brief \em Component: Per vertex \b Vertex-Face adjacency relation
|
||||||
|
|
||||||
It stores a pointer to the first Face of a list of Faces that is stored in a distributed way on the faces themselves.
|
It stores a pointer to the first face of a list of faces that is stored in a distributed way on the faces themselves.
|
||||||
Note that if you use this component it is expected that on the Face you use also the corresponding vcg::face::VFAdj component.
|
Note that if you use this component it is expected that on the Face you use also the corresponding vcg::face::VFAdj component.
|
||||||
|
|
||||||
\sa vcg::tri::UpdateTopology for functions that compute this relation
|
\sa vcg::tri::UpdateTopology for functions that compute this relation
|
||||||
|
\sa vcg::face::VFAdj
|
||||||
\sa iterators
|
\sa iterators
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue