Cleaned up documentation of components (new doxygroup for them, written something for most of them...).
Cleaned Edge components (Added adjacency stuff, implemented the single emptycore)
This commit is contained in:
parent
302e8130b0
commit
7bc4277fcd
|
@ -9,13 +9,16 @@ This module contains the documentation for the types and the functions used for.
|
||||||
This module contains the documentation for the types and the functions used for representing and managing mathematical entities.
|
This module contains the documentation for the types and the functions used for representing and managing mathematical entities.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** \defgroup vertex Vertexes
|
/** \defgroup VertexComponentGroup Vertex Components
|
||||||
Vertex of edge, triangular and tetrahedral meshes
|
\brief Components that you can use to compose your Vertex type
|
||||||
This module contains the documentation for the types and the functions used for representing and managing vertexes of meshes.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** \defgroup face Faces
|
/** \defgroup EdgeComponentGroup Edge Components
|
||||||
Face of a triangular or a tetrahedral mesh
|
\brief Components that you can use to compose your Edge type
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** \defgroup FaceComponentGroup Face Components
|
||||||
|
\brief Components that you can use to compose your Face type
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** \defgroup trimesh Triangular Meshes
|
/** \defgroup trimesh Triangular Meshes
|
||||||
|
|
|
@ -35,7 +35,10 @@ It can be annoying when you see it but it is useful that every entity involved k
|
||||||
- MyVertex1 also store a color value specified as 4 bytes
|
- MyVertex1 also store a color value specified as 4 bytes
|
||||||
- MyVertex2 store a long list of different components.
|
- MyVertex2 store a long list of different components.
|
||||||
|
|
||||||
Many other compenents are implemented in VCG, their complete list can be found in the vcg::vertex and vcg::face page. You can place any combination of them as a template parameters of your vertex (your entity) type (order is unimportant). Now we have all it takes for a working definition of MyMesh type:
|
Many other compenents are implemented in the library for the simplexes, the complete list can be found
|
||||||
|
in the \ref VertexComponentGroup, \ref EdgeComponentGroup and \ref FaceComponentGroup pages. You can place any combination of them as
|
||||||
|
a template parameters of your vertex/edge/face type (note that order is rather unimportant).
|
||||||
|
Now we have all it takes for a working definition of MyMesh type:
|
||||||
|
|
||||||
\dontinclude trimesh_base.cpp
|
\dontinclude trimesh_base.cpp
|
||||||
\skip complex.h
|
\skip complex.h
|
||||||
|
|
|
@ -54,14 +54,14 @@ we have to build the type a step a time (deriving from a single ancestor at a ti
|
||||||
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
template <class UserTypes>
|
//template <class UserTypes>
|
||||||
class EdgeBase: public edge::EmptyEFAdj<
|
// class EdgeBase: public edge::EmptyCore<
|
||||||
edge::EmptyVEAdj<
|
// edge::EmptyVEAdj<
|
||||||
edge::EmptyEEAdj<
|
// edge::EmptyCore<
|
||||||
edge::EmptyEHAdj<
|
// edge::EmptyEHAdj<
|
||||||
edge::EmptyBitFlags<
|
// edge::EmptyBitFlags<
|
||||||
edge::EmptyVertexRef<
|
// edge::EmptyVertexRef<
|
||||||
EdgeTypeHolder < UserTypes> > > > > > >{};
|
// EdgeTypeHolder < UserTypes> > > > > > >{};
|
||||||
|
|
||||||
|
|
||||||
/* The Real Big Edge class;
|
/* The Real Big Edge class;
|
||||||
|
@ -81,9 +81,8 @@ template <class UserTypes,
|
||||||
template <typename> class C, template <typename> class D,
|
template <typename> class C, template <typename> class D,
|
||||||
template <typename> class E, template <typename> class F,
|
template <typename> class E, template <typename> class F,
|
||||||
template <typename> class G, template <typename> class H,
|
template <typename> class G, template <typename> class H,
|
||||||
template <typename> class I, template <typename> class J,
|
template <typename> class I, template <typename> class J >
|
||||||
template <typename> class K>
|
class EdgeArityMax: public Arity10<edge::EmptyCore<UserTypes>, A, B, C, D, E, F, G, H, I, J> {
|
||||||
class EdgeArityMax: public K<Arity10<EdgeBase<UserTypes>, A, B, C, D, E, F, G, H, I, J> > {
|
|
||||||
|
|
||||||
// ----- Flags stuff -----
|
// ----- Flags stuff -----
|
||||||
public:
|
public:
|
||||||
|
@ -212,9 +211,8 @@ template <class UserTypes,
|
||||||
template <typename> class C = DefaultDeriver, template <typename> class D = DefaultDeriver,
|
template <typename> class C = DefaultDeriver, template <typename> class D = DefaultDeriver,
|
||||||
template <typename> class E = DefaultDeriver, template <typename> class F = DefaultDeriver,
|
template <typename> class E = DefaultDeriver, template <typename> class F = DefaultDeriver,
|
||||||
template <typename> class G = DefaultDeriver, template <typename> class H = DefaultDeriver,
|
template <typename> class G = DefaultDeriver, template <typename> class H = DefaultDeriver,
|
||||||
template <typename> class I = DefaultDeriver, template <typename> class J = DefaultDeriver,
|
template <typename> class I = DefaultDeriver, template <typename> class J = DefaultDeriver >
|
||||||
template <typename> class K = DefaultDeriver>
|
class Edge: public EdgeArityMax<UserTypes, A, B, C, D, E, F, G, H, I, J> {
|
||||||
class Edge: public EdgeArityMax<UserTypes, A, B, C, D, E, F, G, H, I, J, K> {
|
|
||||||
public: typedef AllTypes::AEdgeType IAm; typedef UserTypes TypesPool;};
|
public: typedef AllTypes::AEdgeType IAm; typedef UserTypes TypesPool;};
|
||||||
|
|
||||||
}// end namespace
|
}// end namespace
|
||||||
|
|
|
@ -28,31 +28,84 @@
|
||||||
|
|
||||||
namespace vcg {
|
namespace vcg {
|
||||||
namespace edge {
|
namespace edge {
|
||||||
|
|
||||||
|
/** \addtogroup EdgeComponentGroup
|
||||||
|
@{
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Some naming Rules
|
Some naming Rules
|
||||||
All the Components that can be added to a vertex should be defined in the namespace edge:
|
All the Components that can be added to a vertex should be defined in the namespace edge:
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
/*------------------------- EMPTY CORE COMPONENTS -----------------------------------------*/
|
||||||
|
|
||||||
/*-------------------------- VERTEX ----------------------------------------*/
|
template <class T> class EmptyCore: public T
|
||||||
template <class T> class EmptyVertexRef: public T {
|
{
|
||||||
public:
|
public:
|
||||||
// typedef typename T::VertexType VertexType;
|
|
||||||
// typedef typename T::CoordType CoordType;
|
|
||||||
inline typename T::VertexType * & V( const int j ) { (void)j; assert(0); static typename T::VertexType *vp=0; return vp; }
|
inline typename T::VertexType * & V( const int j ) { (void)j; assert(0); static typename T::VertexType *vp=0; return vp; }
|
||||||
inline typename T::VertexType * const & V( const int j ) const { (void)j; assert(0); static typename T::VertexType *vp=0; return vp; }
|
inline typename T::VertexType * const & V( const int j ) const { (void)j; assert(0); static typename T::VertexType *vp=0; return vp; }
|
||||||
inline typename T::VertexType * cV( const int j ) const { (void)j; assert(0); static typename T::VertexType *vp=0; return vp; }
|
inline typename T::VertexType * cV( const int j ) const { (void)j; assert(0); static typename T::VertexType *vp=0; return vp; }
|
||||||
inline typename T::CoordType & P( const int j ) { (void)j; assert(0); static typename T::CoordType coord(0, 0, 0); return coord; }
|
inline typename T::CoordType & P( const int j ) { (void)j; assert(0); static typename T::CoordType coord(0, 0, 0); return coord; }
|
||||||
inline const typename T::CoordType & P( const int j ) const { (void)j; assert(0); static typename T::CoordType coord(0, 0, 0); return coord; }
|
inline const typename T::CoordType & P( const int j ) const { (void)j; assert(0); static typename T::CoordType coord(0, 0, 0); return coord; }
|
||||||
inline const typename T::CoordType & cP( const int j ) const { (void)j; assert(0); static typename T::CoordType coord(0, 0, 0); return coord; }
|
inline const typename T::CoordType & cP( const int j ) const { (void)j; assert(0); static typename T::CoordType coord(0, 0, 0); return coord; }
|
||||||
|
|
||||||
template <class LeftF>
|
|
||||||
void ImportData(const LeftF & leftF) {T::ImportData(leftF);}
|
|
||||||
|
|
||||||
static bool HasEVAdjacency() { return false; }
|
static bool HasEVAdjacency() { return false; }
|
||||||
static bool HasVertexRef() { return false; }
|
static bool HasVertexRef() { return false; }
|
||||||
static void Name(std::vector<std::string> & name){T::Name(name);}
|
|
||||||
};
|
typedef vcg::Color4b ColorType;
|
||||||
|
ColorType &C() { static ColorType dumcolor(vcg::Color4b::White); assert(0); return dumcolor; }
|
||||||
|
ColorType cC() const { static ColorType dumcolor(vcg::Color4b::White); assert(0); return dumcolor; }
|
||||||
|
static bool HasColor() { return false; }
|
||||||
|
|
||||||
|
typedef float QualityType;
|
||||||
|
QualityType &Q() { static QualityType dummyQuality(0); assert(0); return dummyQuality; }
|
||||||
|
QualityType cQ() const { static QualityType dummyQuality(0); assert(0); return dummyQuality; }
|
||||||
|
static bool HasQuality() { return false; }
|
||||||
|
|
||||||
|
typedef int MarkType;
|
||||||
|
inline void InitIMark() { }
|
||||||
|
inline int cIMark() const { assert(0); static int tmp=-1; return tmp;}
|
||||||
|
inline int &IMark() { assert(0); static int tmp=-1; return tmp;}
|
||||||
|
static bool HasMark() { return false; }
|
||||||
|
|
||||||
|
typedef int FlagType;
|
||||||
|
int &Flags() { static int dummyflags(0); assert(0); return dummyflags; }
|
||||||
|
int Flags() const { return 0; }
|
||||||
|
static bool HasFlags() { return false; }
|
||||||
|
|
||||||
|
typename T::EdgePointer &VEp(const int & ) { static typename T::EdgePointer ep=0; assert(0); return ep; }
|
||||||
|
typename T::EdgePointer cVEp(const int & ) const { static typename T::EdgePointer ep=0; assert(0); return ep; }
|
||||||
|
int &VEi(const int &){static int z=0; assert(0); return z;}
|
||||||
|
int cVEi(const int &) const {static int z=0; assert(0); return z;}
|
||||||
|
static bool HasVEAdjacency() { return false; }
|
||||||
|
|
||||||
|
typename T::EdgePointer &EEp(const int & ) { static typename T::EdgePointer ep=0; assert(0); return ep; }
|
||||||
|
typename T::EdgePointer cEEp(const int & ) const { static typename T::EdgePointer ep=0; assert(0); return ep; }
|
||||||
|
int &EEi(const int &){static int z=0; assert(0); return z;}
|
||||||
|
int cEEi(const int &) const {static int z=0; assert(0); return z;}
|
||||||
|
static bool HasEEAdjacency() { return false; }
|
||||||
|
|
||||||
|
typename T::HEdgePointer &EHp( ) { static typename T::HEdgePointer hp=0; assert(0); return hp; }
|
||||||
|
typename T::HEdgePointer cEHp( ) const { static typename T::HEdgePointer hp=0; assert(0); return hp; }
|
||||||
|
static bool HasEHAdjacency() { return false; }
|
||||||
|
|
||||||
|
typename T::FacePointer &EFp() { static typename T::FacePointer fp=0; assert(0); return fp; }
|
||||||
|
typename T::FacePointer cEFp() const { static typename T::FacePointer fp=0; assert(0); return fp; }
|
||||||
|
int &EFi() {static int z=0; return z;}
|
||||||
|
int &cEFi() const {static int z=0; return z;}
|
||||||
|
static bool HasEFAdjacency() { return false; }
|
||||||
|
|
||||||
|
template <class LeftF>
|
||||||
|
void ImportData(const LeftF & leftF) {T::ImportData(leftF);}
|
||||||
|
static void Name(std::vector<std::string> & name){T::Name(name);}
|
||||||
|
};
|
||||||
|
|
||||||
|
/*-------------------------- VertexRef ----------------------------------------*/
|
||||||
|
/*! \brief The references to the two vertexes of a edge
|
||||||
|
*
|
||||||
|
* Stored as pointers to the VertexType
|
||||||
|
*/
|
||||||
|
|
||||||
template <class T> class VertexRef: public T {
|
template <class T> class VertexRef: public T {
|
||||||
public:
|
public:
|
||||||
VertexRef(){
|
VertexRef(){
|
||||||
|
@ -103,18 +156,10 @@ template <class T> class EVAdj : public VertexRef<T>{};
|
||||||
|
|
||||||
/*-------------------------- INCREMENTAL MARK ----------------------------------------*/
|
/*-------------------------- INCREMENTAL MARK ----------------------------------------*/
|
||||||
|
|
||||||
template <class T> class EmptyMark: public T {
|
/*! \brief \em Component: Per edge \b Incremental \b Mark
|
||||||
public:
|
*
|
||||||
static bool HasMark() { return false; }
|
* An int that allows to efficently un-mark the whole mesh. \sa UnmarkAll
|
||||||
static bool HasMarkOcc() { return false; }
|
*/
|
||||||
inline void InitIMark() { }
|
|
||||||
inline int & IMark() { assert(0); static int tmp=-1; return tmp;}
|
|
||||||
inline int IMark() const {return 0;}
|
|
||||||
template < class LeftV>
|
|
||||||
void ImportData(const LeftV & left ) { T::ImportData( left); }
|
|
||||||
static void Name(std::vector<std::string> & name){T::Name(name);}
|
|
||||||
|
|
||||||
};
|
|
||||||
template <class T> class Mark: public T {
|
template <class T> class Mark: public T {
|
||||||
public:
|
public:
|
||||||
static bool HasMark() { return true; }
|
static bool HasMark() { return true; }
|
||||||
|
@ -131,19 +176,10 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
/*------------------------- FLAGS -----------------------------------------*/
|
/*------------------------- FLAGS -----------------------------------------*/
|
||||||
template <class T> class EmptyBitFlags: public T {
|
/*! \brief \em Component: Per edge \b Flags
|
||||||
public:
|
*
|
||||||
typedef int FlagType;
|
* This component stores a 32 bit array of bit flags. These bit flags are used for keeping track of selection, deletion, visiting etc. \sa \ref flags for more details on common uses of flags.
|
||||||
/// Return the vector of Flags(), senza effettuare controlli sui bit
|
*/
|
||||||
int &Flags() { static int dummyflags(0); assert(0); return dummyflags; }
|
|
||||||
int Flags() const { return 0; }
|
|
||||||
template < class LeftV>
|
|
||||||
void ImportData(const LeftV & left ) { T::ImportData( left); }
|
|
||||||
static bool HasFlags() { return false; }
|
|
||||||
static void Name(std::vector<std::string> & name){T::Name(name);}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class T> class BitFlags: public T {
|
template <class T> class BitFlags: public T {
|
||||||
public:
|
public:
|
||||||
BitFlags(){_flags=0;}
|
BitFlags(){_flags=0;}
|
||||||
|
@ -159,24 +195,12 @@ private:
|
||||||
int _flags;
|
int _flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*-------------------------- EMPTY COLOR & QUALITY ----------------------------------*/
|
|
||||||
|
|
||||||
template <class T> class EmptyColorQuality: public T {
|
|
||||||
public:
|
|
||||||
typedef float QualityType;
|
|
||||||
QualityType &Q() { static QualityType dummyQuality(0); assert(0); return dummyQuality; }
|
|
||||||
static bool HasQuality() { return false; }
|
|
||||||
|
|
||||||
typedef vcg::Color4b ColorType;
|
|
||||||
ColorType &C() { static ColorType dumcolor(vcg::Color4b::White); assert(0); return dumcolor; }
|
|
||||||
template < class LeftV>
|
|
||||||
void ImportData(const LeftV & left ) { T::ImportData( left); }
|
|
||||||
static bool HasColor() { return false; }
|
|
||||||
static void Name(std::vector<std::string> & name){T::Name(name);}
|
|
||||||
};
|
|
||||||
|
|
||||||
/*-------------------------- Color ----------------------------------*/
|
/*-------------------------- Color ----------------------------------*/
|
||||||
|
/*! \brief \em Component: Per edge \b Color
|
||||||
|
*
|
||||||
|
* Usually most of the library expects a color stored as 4 unsigned chars (so the component you use is a \c vertex::Color4b)
|
||||||
|
* but you can also use float for the color components.
|
||||||
|
*/
|
||||||
template <class A, class T> class Color: public T {
|
template <class A, class T> class Color: public T {
|
||||||
public:
|
public:
|
||||||
Color():_color(vcg::Color4b::White) {}
|
Color():_color(vcg::Color4b::White) {}
|
||||||
|
@ -198,7 +222,12 @@ template <class TT> class Color4b: public edge::Color<vcg::Color4b, TT> {
|
||||||
};
|
};
|
||||||
|
|
||||||
/*-------------------------- Quality ----------------------------------*/
|
/*-------------------------- Quality ----------------------------------*/
|
||||||
|
/*! \brief \em Component: Per edge \b quality
|
||||||
|
*
|
||||||
|
* The Quality Component is a generic place for storing a float. The term 'quality' is a bit misleading and it is due to its original storic meaning. You should intend it as a general purpose container.
|
||||||
|
* \sa vcg::tri::UpdateColor for methods transforming quality into colors
|
||||||
|
* \sa vcg::tri::UpdateQuality for methods to manage it
|
||||||
|
*/
|
||||||
template <class A, class TT> class Quality: public TT {
|
template <class A, class TT> class Quality: public TT {
|
||||||
public:
|
public:
|
||||||
typedef A QualityType;
|
typedef A QualityType;
|
||||||
|
@ -224,19 +253,13 @@ public: static void Name(std::vector<std::string> & name){name.push_back(std::st
|
||||||
};
|
};
|
||||||
|
|
||||||
/*----------------------------- VEADJ ------------------------------*/
|
/*----------------------------- VEADJ ------------------------------*/
|
||||||
template <class T> class EmptyVEAdj: public T {
|
/*! \brief \em Component: Per vertex \b Vertex-Edge adjacency relation companion component
|
||||||
public:
|
This component implement one element of the list of edges incident on a vertex.
|
||||||
typename T::EdgePointer &VEp(const int & ) { static typename T::EdgePointer ep=0; assert(0); return ep; }
|
You must use this component only toghether with the corresponding \ref vcg::vertex::VEAdj component in the vertex type
|
||||||
const typename T::EdgePointer cVEp(const int & ) const { static typename T::EdgePointer ep=0; assert(0); return ep; }
|
|
||||||
int &VEi(const int &){static int z=0; assert(0); return z;}
|
|
||||||
int cVEi(const int &) const {static int z=0; assert(0); return z;}
|
|
||||||
template < class LeftV>
|
|
||||||
void ImportData(const LeftV & left ) { T::ImportData( left); }
|
|
||||||
static bool HasVEAdjacency() { return false; }
|
|
||||||
static bool HasVEAdjacencyOcc() { return false; }
|
|
||||||
static void Name(std::vector<std::string> & name){ T::Name(name);}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
\sa vcg::tri::UpdateTopology for functions that compute this relation
|
||||||
|
\sa iterators
|
||||||
|
*/
|
||||||
template <class T> class VEAdj: public T {
|
template <class T> class VEAdj: public T {
|
||||||
public:
|
public:
|
||||||
VEAdj(){_ep[0]=0;_ep[1]=0;_zp[0]=-1;_zp[1]=-1;}
|
VEAdj(){_ep[0]=0;_ep[1]=0;_zp[0]=-1;_zp[1]=-1;}
|
||||||
|
@ -256,20 +279,19 @@ public: static void Name(std::vector<std::string> & name){name.push_back(std::st
|
||||||
int _zp[2] ;
|
int _zp[2] ;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------- EEADJ ------------------------------*/
|
/*----------------------------- EEADJ ------------------------------*/
|
||||||
template <class T> class EmptyEEAdj: public T {
|
/*! \brief \em Component: \b Edge-Edge adjacency relation
|
||||||
public:
|
This component implement store the pointer (and index) of the adjacent edges.
|
||||||
typename T::EdgePointer &EEp(const int & ) { static typename T::EdgePointer ep=0; assert(0); return ep; }
|
If the vertex is 1-manifold (as in a classical polyline)
|
||||||
const typename T::EdgePointer cEEp(const int & ) const { static typename T::EdgePointer ep=0; assert(0); return ep; }
|
it holds that:
|
||||||
int &EEi(const int &){static int z=0; assert(0); return z;}
|
\code
|
||||||
int cEEi(const int &) const {static int z=0; assert(0); return z;}
|
e->EEp(i)->EEp(e->EEi(i)) == e
|
||||||
template < class LeftV>
|
\endcode
|
||||||
void ImportData(const LeftV & left ) { T::ImportData( left); }
|
otherwise the edges are connected in a unordered chain (quite similar to how Face-Face adjacency relation is stored);
|
||||||
static bool HasEEAdjacency() { return false; }
|
|
||||||
static bool HasEEAdjacencyOcc() { return false; }
|
\sa vcg::tri::UpdateTopology for functions that compute this relation
|
||||||
static void Name(std::vector<std::string> & name){ T::Name(name);}
|
\sa iterators
|
||||||
};
|
*/
|
||||||
|
|
||||||
template <class T> class EEAdj: public T {
|
template <class T> class EEAdj: public T {
|
||||||
public:
|
public:
|
||||||
|
@ -290,20 +312,7 @@ private:
|
||||||
int _zp[2] ;
|
int _zp[2] ;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------- EHADJ ------------------------------*/
|
/*----------------------------- EHADJ ------------------------------*/
|
||||||
template <class T> class EmptyEHAdj: public T {
|
|
||||||
public:
|
|
||||||
typename T::HEdgePointer &EHp( ) { static typename T::HEdgePointer hp=0; assert(0); return hp; }
|
|
||||||
const typename T::HEdgePointer cEHp( ) const { static typename T::HEdgePointer hp=0; assert(0); return hp; }
|
|
||||||
|
|
||||||
template < class LeftV>
|
|
||||||
void ImportData(const LeftV & left ) { T::ImportData( left); }
|
|
||||||
static bool HasEHAdjacency() { return false; }
|
|
||||||
static bool HasEHAdjacencyOcc() { return false; }
|
|
||||||
static void Name(std::vector<std::string> & name){ T::Name(name);}
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class T> class EHAdj: public T {
|
template <class T> class EHAdj: public T {
|
||||||
public:
|
public:
|
||||||
EHAdj(){_hp=0;}
|
EHAdj(){_hp=0;}
|
||||||
|
@ -320,70 +329,33 @@ private:
|
||||||
typename T::HEdgePointer _hp ;
|
typename T::HEdgePointer _hp ;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*----------------------------- ETADJ ------------------------------*/
|
|
||||||
|
|
||||||
|
|
||||||
template <class T> class EmptyETAdj: public T {
|
|
||||||
public:
|
|
||||||
typename T::TetraPointer &ETp() { static typename T::TetraPointer tp = 0; assert(0); return tp; }
|
|
||||||
typename T::TetraPointer cETp() { static typename T::TetraPointer tp = 0; assert(0); return tp; }
|
|
||||||
int &VTi() { static int z = 0; return z; };
|
|
||||||
static bool HasETAdjacency() { return false; }
|
|
||||||
static bool HasETAdjacencyOcc() { return false; }
|
|
||||||
static void Name( std::vector< std::string > & name ) { T::Name(name); }
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class T> class ETAdj: public T {
|
|
||||||
public:
|
|
||||||
ETAdj() { _tp = 0; }
|
|
||||||
typename T::TetraPointer &ETp() { return _tp; }
|
|
||||||
typename T::TetraPointer cETp() { return _tp; }
|
|
||||||
int &ETi() {return _zp; }
|
|
||||||
static bool HasETAdjacency() { return true; }
|
|
||||||
static bool HasETAdjacencyOcc() { return true; }
|
|
||||||
static void Name( std::vector< std::string > & name ) { name.push_back( std::string("ETAdj") ); T::Name(name); }
|
|
||||||
|
|
||||||
private:
|
|
||||||
typename T::TetraPointer _tp ;
|
|
||||||
int _zp ;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------- EFADJ ------------------------------*/
|
/*----------------------------- EFADJ ------------------------------*/
|
||||||
|
/*! \brief \em Component: \b Edge-Face adjacency relation
|
||||||
|
This component implement store the pointer to a face sharing this edge.
|
||||||
|
|
||||||
template <class T> class EmptyEFAdj: public T {
|
\sa vcg::tri::UpdateTopology for functions that compute this relation
|
||||||
public:
|
\sa iterators
|
||||||
typename T::FacePointer &EFp() { static typename T::FacePointer fp=0; assert(0); return fp; }
|
*/
|
||||||
const typename T::FacePointer cEFp() const { static typename T::FacePointer fp=0; assert(0); return fp; }
|
|
||||||
int &EFi() {static int z=0; return z;};
|
|
||||||
const int &cEFi() const {static int z=0; return z;};
|
|
||||||
template < class LeftV>
|
|
||||||
void ImportData(const LeftV & left ) { T::ImportData( left); }
|
|
||||||
static bool HasEFAdjacency() { return false; }
|
|
||||||
static bool HasEFAdjacencyOcc() { return false; }
|
|
||||||
static void Name(std::vector<std::string> & name){ T::Name(name);}
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class T> class EFAdj: public T {
|
template <class T> class EFAdj: public T {
|
||||||
public:
|
public:
|
||||||
EFAdj(){_fp=0;}
|
EFAdj(){_fp=0;}
|
||||||
typename T::FacePointer &EFp() {return _fp; }
|
typename T::FacePointer &EFp() {return _fp; }
|
||||||
const typename T::FacePointer cEFp() const {return _fp; }
|
typename T::FacePointer cEFp() const {return _fp; }
|
||||||
int &EFi() {static int z=0; return z;};
|
int &EFi() {static int z=0; return z;}
|
||||||
const int &cEFi() const {return _zp; }
|
int cEFi() const {return _zp; }
|
||||||
template < class LeftV>
|
template < class LeftV>
|
||||||
void ImportData(const LeftV & left ) { T::ImportData( left); }
|
void ImportData(const LeftV & left ) { T::ImportData( left); }
|
||||||
static bool HasEFAdjacency() { return true; }
|
static bool HasEFAdjacency() { return true; }
|
||||||
static bool HasEFAdjacencyOcc() { return true; }
|
static bool HasEFAdjacencyOcc() { return true; }
|
||||||
static void Name(std::vector<std::string> & name){name.push_back(std::string("EFAdj"));T::Name(name);}
|
static void Name(std::vector<std::string> & name){name.push_back(std::string("EFAdj"));T::Name(name);}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typename T::FacePointer _fp ;
|
typename T::FacePointer _fp ;
|
||||||
int _zp ;
|
int _zp ;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** @} */ // End Doxygen EdgeComponentGroup
|
||||||
} // end namespace edge
|
} // end namespace edge
|
||||||
}// end namespace vcg
|
}// end namespace vcg
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
namespace vcg {
|
namespace vcg {
|
||||||
namespace face {
|
namespace face {
|
||||||
/** \addtogroup face
|
/** \addtogroup FaceComponentGroup
|
||||||
@{
|
@{
|
||||||
*/
|
*/
|
||||||
/*------------------------- EMPTY CORE COMPONENTS -----------------------------------------*/
|
/*------------------------- EMPTY CORE COMPONENTS -----------------------------------------*/
|
||||||
|
@ -154,11 +154,11 @@ public:
|
||||||
static void Name(std::vector<std::string> & name){T::Name(name);}
|
static void Name(std::vector<std::string> & name){T::Name(name);}
|
||||||
};
|
};
|
||||||
|
|
||||||
/*-------------------------- VertexRef ----------------------------------------*/
|
/*-------------------------- VertexRef ----------------------------------------*/
|
||||||
/*! \brief The references to the vertexes of a triangular face
|
/*! \brief The references to the vertexes of a triangular face
|
||||||
|
*
|
||||||
Stored as three pointers to the VertexType
|
* Stored as three pointers to the VertexType
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
template <class T> class VertexRef: public T {
|
template <class T> class VertexRef: public T {
|
||||||
|
@ -442,6 +442,11 @@ public: static void Name(std::vector<std::string> & name){name.push_back(std::s
|
||||||
};
|
};
|
||||||
|
|
||||||
/*-------------------------- INCREMENTAL MARK ----------------------------------------*/
|
/*-------------------------- INCREMENTAL MARK ----------------------------------------*/
|
||||||
|
/*! \brief Per vertex \b Incremental \b Mark
|
||||||
|
|
||||||
|
It is just an int that allows to efficently un-mark the whole mesh. \sa UnmarkAll
|
||||||
|
*/
|
||||||
|
|
||||||
template <class T> class Mark: public T {
|
template <class T> class Mark: public T {
|
||||||
public:
|
public:
|
||||||
static bool HasMark() { return true; }
|
static bool HasMark() { return true; }
|
||||||
|
@ -530,6 +535,35 @@ private:
|
||||||
char _vfi[3] ;
|
char _vfi[3] ;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*----------------------------- EFADJ ------------------------------*/
|
||||||
|
template <class T> class EFAdj: public T {
|
||||||
|
public:
|
||||||
|
EFAdj(){
|
||||||
|
_efp[0]=0;
|
||||||
|
_efp[1]=0;
|
||||||
|
_efp[2]=0;
|
||||||
|
_efi[0]=-1;
|
||||||
|
_efi[1]=-1;
|
||||||
|
_efi[2]=-1;
|
||||||
|
}
|
||||||
|
typename T::FacePointer &EFp(const int j) { assert(j>=0 && j<3); return _efp[j]; }
|
||||||
|
typename T::FacePointer const EFp(const int j) const { assert(j>=0 && j<3); return _efp[j]; }
|
||||||
|
typename T::FacePointer const cEFp(const int j) const { assert(j>=0 && j<3); return _efp[j]; }
|
||||||
|
char &VFi(const int j) {return _efi[j]; }
|
||||||
|
template <class RightF>
|
||||||
|
void ImportData(const RightF & rightF){T::ImportData(rightF);}
|
||||||
|
inline void Alloc(const int & ns){T::Alloc(ns);}
|
||||||
|
inline void Dealloc(){T::Dealloc();}
|
||||||
|
static bool HasEFAdjacency() { return true; }
|
||||||
|
static bool HasEFAdjacencyOcc() { return false; }
|
||||||
|
static void Name(std::vector<std::string> & name){name.push_back(std::string("EFAdj"));T::Name(name);}
|
||||||
|
|
||||||
|
private:
|
||||||
|
typename T::FacePointer _efp[3] ;
|
||||||
|
char _efi[3] ;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------- FFADJ ------------------------------*/
|
/*----------------------------- FFADJ ------------------------------*/
|
||||||
template <class T> class FFAdj: public T {
|
template <class T> class FFAdj: public T {
|
||||||
public:
|
public:
|
||||||
|
@ -564,6 +598,7 @@ private:
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------- FEADJ ------------------------------*/
|
/*----------------------------- FEADJ ------------------------------*/
|
||||||
|
|
||||||
template <class T> class FEAdj: public T {
|
template <class T> class FEAdj: public T {
|
||||||
public:
|
public:
|
||||||
FEAdj(){
|
FEAdj(){
|
||||||
|
@ -574,10 +609,8 @@ public:
|
||||||
typename T::EdgePointer &FEp(const int j) { assert(j>=0 && j<3); return _fep[j]; }
|
typename T::EdgePointer &FEp(const int j) { assert(j>=0 && j<3); return _fep[j]; }
|
||||||
typename T::EdgePointer const FEp(const int j) const { assert(j>=0 && j<3); return _fep[j]; }
|
typename T::EdgePointer const FEp(const int j) const { assert(j>=0 && j<3); return _fep[j]; }
|
||||||
typename T::EdgePointer const cFEp(const int j) const { assert(j>=0 && j<3); return _fep[j]; }
|
typename T::EdgePointer const cFEp(const int j) const { assert(j>=0 && j<3); return _fep[j]; }
|
||||||
char &FEi(const int j) { return _fei[j]; }
|
|
||||||
const char &cFEi(const int j) const { return _fei[j]; }
|
|
||||||
|
|
||||||
typename T::EdgePointer &FEp1( const int j ) { return FEp((j+1)%3);}
|
typename T::EdgePointer &FEp1( const int j ) { return FEp((j+1)%3);}
|
||||||
typename T::EdgePointer &FEp2( const int j ) { return FEp((j+2)%3);}
|
typename T::EdgePointer &FEp2( const int j ) { return FEp((j+2)%3);}
|
||||||
typename T::EdgePointer const FEp1( const int j ) const { return FEp((j+1)%3);}
|
typename T::EdgePointer const FEp1( const int j ) const { return FEp((j+1)%3);}
|
||||||
typename T::EdgePointer const FEp2( const int j ) const { return FEp((j+2)%3);}
|
typename T::EdgePointer const FEp2( const int j ) const { return FEp((j+2)%3);}
|
||||||
|
@ -612,6 +645,7 @@ public:
|
||||||
private:
|
private:
|
||||||
typename T::HEdgePointer _fh ;
|
typename T::HEdgePointer _fh ;
|
||||||
};
|
};
|
||||||
|
/** @} */ // End Doxygen FaceComponentGroup
|
||||||
} // end namespace face
|
} // end namespace face
|
||||||
}// end namespace vcg
|
}// end namespace vcg
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -56,8 +56,8 @@ template <class UserTypes,
|
||||||
template <typename> class C, template <typename> class D,
|
template <typename> class C, template <typename> class D,
|
||||||
template <typename> class E, template <typename> class F,
|
template <typename> class E, template <typename> class F,
|
||||||
template <typename> class G, template <typename> class H,
|
template <typename> class G, template <typename> class H,
|
||||||
template <typename> class I, template <typename> class J,
|
template <typename> class I, template <typename> class J,
|
||||||
template <typename> class K, template <typename> class L>
|
template <typename> class K, template <typename> class L>
|
||||||
class VertexArityMax: public Arity12<vertex::EmptyCore<UserTypes>, A, B, C, D, E, F, G, H, I, J, K, L> {
|
class VertexArityMax: public Arity12<vertex::EmptyCore<UserTypes>, A, B, C, D, E, F, G, H, I, J, K, L> {
|
||||||
|
|
||||||
// ----- Flags stuff -----
|
// ----- Flags stuff -----
|
||||||
|
@ -77,13 +77,13 @@ public:
|
||||||
USER0 = 0x0200 // First user bit
|
USER0 = 0x0200 // First user bit
|
||||||
};
|
};
|
||||||
|
|
||||||
bool IsD() const {return (this->Flags() & DELETED) != 0;} /// checks if the vertex is deleted
|
bool IsD() const {return (this->cFlags() & DELETED) != 0;} /// checks if the vertex is deleted
|
||||||
bool IsR() const {return (this->Flags() & NOTREAD) == 0;} /// checks if the vertex is readable
|
bool IsR() const {return (this->cFlags() & NOTREAD) == 0;} /// checks if the vertex is readable
|
||||||
bool IsW() const {return (this->Flags() & NOTWRITE)== 0;}/// checks if the vertex is modifiable
|
bool IsW() const {return (this->cFlags() & NOTWRITE)== 0;}/// checks if the vertex is modifiable
|
||||||
bool IsRW() const {return (this->Flags() & (NOTREAD | NOTWRITE)) == 0;}/// This funcion checks whether the vertex is both readable and modifiable
|
bool IsRW() const {return (this->cFlags() & (NOTREAD | NOTWRITE)) == 0;}/// This funcion checks whether the vertex is both readable and modifiable
|
||||||
bool IsS() const {return (this->Flags() & SELECTED) != 0;}/// checks if the vertex is Selected
|
bool IsS() const {return (this->cFlags() & SELECTED) != 0;}/// checks if the vertex is Selected
|
||||||
bool IsB() const {return (this->Flags() & BORDER) != 0;}/// checks if the vertex is a border one
|
bool IsB() const {return (this->cFlags() & BORDER) != 0;}/// checks if the vertex is a border one
|
||||||
bool IsV() const {return (this->Flags() & VISITED) != 0;}/// checks if the vertex Has been visited
|
bool IsV() const {return (this->cFlags() & VISITED) != 0;}/// checks if the vertex Has been visited
|
||||||
|
|
||||||
|
|
||||||
/** Set the flag value
|
/** Set the flag value
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
#define __VCG_VERTEX_PLUS_COMPONENT
|
#define __VCG_VERTEX_PLUS_COMPONENT
|
||||||
namespace vcg {
|
namespace vcg {
|
||||||
namespace vertex {
|
namespace vertex {
|
||||||
/** \addtogroup vertex
|
/** \addtogroup VertexComponentGroup
|
||||||
@{
|
@{
|
||||||
*/
|
*/
|
||||||
/*------------------------- Base Classes -----------------------------------------*/
|
/*------------------------- Base Classes -----------------------------------------*/
|
||||||
|
@ -47,19 +47,18 @@ template <class TT> class EmptyCore: public TT {
|
||||||
public:
|
public:
|
||||||
typedef int FlagType;
|
typedef int FlagType;
|
||||||
int &Flags() { static int dummyflags(0); assert(0); return dummyflags; }
|
int &Flags() { static int dummyflags(0); assert(0); return dummyflags; }
|
||||||
int Flags() const { return 0; }
|
int cFlags() const { return 0; }
|
||||||
static bool HasFlags() { return false; }
|
static bool HasFlags() { return false; }
|
||||||
|
|
||||||
typedef vcg::Point3f CoordType;
|
typedef vcg::Point3f CoordType;
|
||||||
typedef CoordType::ScalarType ScalarType;
|
typedef CoordType::ScalarType ScalarType;
|
||||||
CoordType &P() { static CoordType coord(0, 0, 0); return coord; }
|
CoordType &P() { static CoordType coord(0, 0, 0); return coord; }
|
||||||
const CoordType &P() const { static CoordType coord(0, 0, 0); assert(0); return coord; }
|
CoordType cP() const { static CoordType coord(0, 0, 0); assert(0); return coord; }
|
||||||
const CoordType &cP() const { static CoordType coord(0, 0, 0); assert(0); return coord; }
|
|
||||||
static bool HasCoord() { return false; }
|
static bool HasCoord() { return false; }
|
||||||
|
|
||||||
typedef vcg::Point3s NormalType;
|
typedef vcg::Point3s NormalType;
|
||||||
NormalType &N() { static NormalType dummy_normal(0, 0, 0); assert(0); return dummy_normal; }
|
NormalType &N() { static NormalType dummy_normal(0, 0, 0); assert(0); return dummy_normal; }
|
||||||
const NormalType cN()const { static NormalType dummy_normal(0, 0, 0); assert(0); return dummy_normal; }
|
NormalType cN() const { static NormalType dummy_normal(0, 0, 0); assert(0); return dummy_normal; }
|
||||||
static bool HasNormal() { return false; }
|
static bool HasNormal() { return false; }
|
||||||
static bool HasNormalOcf() { return false; }
|
static bool HasNormalOcf() { return false; }
|
||||||
|
|
||||||
|
@ -79,16 +78,15 @@ public:
|
||||||
|
|
||||||
typedef int MarkType;
|
typedef int MarkType;
|
||||||
inline void InitIMark() { }
|
inline void InitIMark() { }
|
||||||
inline const int & cIMark() const { assert(0); static int tmp=-1; return tmp;}
|
inline int cIMark() const { assert(0); static int tmp=-1; return tmp;}
|
||||||
inline int & IMark() { assert(0); static int tmp=-1; return tmp;}
|
inline int &IMark() { assert(0); static int tmp=-1; return tmp;}
|
||||||
inline int IMark() const {return 0;}
|
|
||||||
static bool HasMark() { return false; }
|
static bool HasMark() { return false; }
|
||||||
static bool HasMarkOcf() { return false; }
|
static bool HasMarkOcf() { return false; }
|
||||||
static bool IsMarkEnabled(const typename TT::VertexType *) { return false; }
|
static bool IsMarkEnabled(const typename TT::VertexType *) { return false; }
|
||||||
|
|
||||||
typedef ScalarType RadiusType;
|
typedef ScalarType RadiusType;
|
||||||
RadiusType &R(){ static ScalarType v = 0.0; assert(0 && "the radius component is not available"); return v; }
|
RadiusType &R() { static ScalarType v = 0.0; assert(0 && "the radius component is not available"); return v; }
|
||||||
const RadiusType &cR() const { static const ScalarType v = 0.0; assert(0 && "the radius component is not available"); return v; }
|
RadiusType cR() const { static const ScalarType v = 0.0; assert(0 && "the radius component is not available"); return v; }
|
||||||
static bool HasRadius() { return false; }
|
static bool HasRadius() { return false; }
|
||||||
static bool HasRadiusOcf() { return false; }
|
static bool HasRadiusOcf() { return false; }
|
||||||
static bool IsRadiusEnabled(const typename TT::VertexType *) { return false; }
|
static bool IsRadiusEnabled(const typename TT::VertexType *) { return false; }
|
||||||
|
@ -100,18 +98,18 @@ public:
|
||||||
static bool IsTexCoordEnabled(const typename TT::VertexType *) { return false; }
|
static bool IsTexCoordEnabled(const typename TT::VertexType *) { return false; }
|
||||||
|
|
||||||
typename TT::TetraPointer &VTp() { static typename TT::TetraPointer tp = 0; assert(0); return tp; }
|
typename TT::TetraPointer &VTp() { static typename TT::TetraPointer tp = 0; assert(0); return tp; }
|
||||||
const typename TT::TetraPointer cVTp()const { static typename TT::TetraPointer tp = 0; assert(0); return tp; }
|
typename TT::TetraPointer cVTp() const { static typename TT::TetraPointer tp = 0; assert(0); return tp; }
|
||||||
int &VTi() { static int z = 0; return z; }
|
int &VTi() { static int z = 0; return z; }
|
||||||
static bool HasVTAdjacency() { return false; }
|
static bool HasVTAdjacency() { return false; }
|
||||||
|
|
||||||
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; }
|
||||||
const typename TT::FacePointer cVFp() const { static typename TT::FacePointer fp=0; assert(0); return fp; }
|
const 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=0; assert(0); return z;}
|
||||||
int cVFi() const {static int z=0; assert(0); return z;}
|
int cVFi() const {static int z=0; assert(0); return z;}
|
||||||
static bool HasVFAdjacency() { return false; }
|
static bool HasVFAdjacency() { return false; }
|
||||||
|
|
||||||
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; }
|
||||||
const typename TT::EdgePointer cVEp() const { static typename TT::EdgePointer ep=0; assert(0); return ep; }
|
const typename TT::EdgePointer cVEp() const { static typename TT::EdgePointer ep=0; assert(0); return ep; }
|
||||||
int &VEi(){static int z=0; return z;}
|
int &VEi(){static int z=0; return z;}
|
||||||
static bool HasVEAdjacency() { return false; }
|
static bool HasVEAdjacency() { return false; }
|
||||||
|
|
||||||
|
@ -221,7 +219,7 @@ public: static void Name(std::vector<std::string> & name){name.push_back(std::st
|
||||||
/*-------------------------- INCREMENTAL MARK ----------------------------------------*/
|
/*-------------------------- INCREMENTAL MARK ----------------------------------------*/
|
||||||
/*! \brief Per vertex \b Incremental \b Mark
|
/*! \brief Per vertex \b Incremental \b Mark
|
||||||
|
|
||||||
It is just an int that allow to efficent un-marking of the whole mesh. \sa UnmarkAll
|
It is just an int that allows to efficently un-mark the whole mesh. \sa UnmarkAll
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template <class T> class Mark: public T {
|
template <class T> class Mark: public T {
|
||||||
|
@ -296,11 +294,10 @@ private:
|
||||||
|
|
||||||
/*-------------------------- Color ----------------------------------*/
|
/*-------------------------- Color ----------------------------------*/
|
||||||
/*! \brief \em Component: Per vertex \b Color
|
/*! \brief \em Component: Per vertex \b Color
|
||||||
|
*
|
||||||
Usually most of the library expects a color stored as 4 unsigned chars (so the component you use is a \c vertex::Color4b)
|
* Usually most of the library expects a color stored as 4 unsigned chars (so the component you use is a \c vertex::Color4b)
|
||||||
but you can also use float for the color components.
|
* but you can also use float for the color components.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template <class A, class T> class Color: public T {
|
template <class A, class T> class Color: public T {
|
||||||
public:
|
public:
|
||||||
Color():_color(vcg::Color4b::White) {}
|
Color():_color(vcg::Color4b::White) {}
|
||||||
|
@ -563,11 +560,7 @@ private:
|
||||||
int _zp ;
|
int _zp ;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/** @} */ // End Doxygen VertexComponentGroup
|
||||||
@}
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
} // end namespace vert
|
} // end namespace vert
|
||||||
}// end namespace vcg
|
}// end namespace vcg
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -431,7 +431,7 @@ public:
|
||||||
{
|
{
|
||||||
//if((*this).Base().MarkEnabled && leftV.Base().MarkEnabled ) // WRONG I do not know anything about leftV!
|
//if((*this).Base().MarkEnabled && leftV.Base().MarkEnabled ) // WRONG I do not know anything about leftV!
|
||||||
if((*this).Base().MarkEnabled) // copy the data only if they are enabled in both vertices
|
if((*this).Base().MarkEnabled) // copy the data only if they are enabled in both vertices
|
||||||
IMark() = leftV.IMark();
|
IMark() = leftV.cIMark();
|
||||||
T::ImportData(leftV);
|
T::ImportData(leftV);
|
||||||
}
|
}
|
||||||
static bool HasMark() { return true; }
|
static bool HasMark() { return true; }
|
||||||
|
|
Loading…
Reference in New Issue