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
|
|
@ -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; }
|
||||||
|
|
@ -524,12 +530,31 @@ public: static void Name(std::vector<std::string> & name){name.push_back(std::st
|
||||||
};
|
};
|
||||||
|
|
||||||
/*----------------------------- 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]; }
|
||||||
|
|
@ -575,6 +600,19 @@ 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(){
|
||||||
|
|
|
||||||
|
|
@ -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; }
|
||||||
|
|
@ -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