24 #ifndef __VCG_VERTEX_PLUS_COMPONENT 
   25 #define __VCG_VERTEX_PLUS_COMPONENT 
   30 #include <vcg/space/color4.h> 
   31 #include <vcg/space/texcoord2.h> 
   55   int &Flags()       { assert(0); 
static int dummyflags(0);  
return dummyflags; }
 
   56   int  Flags()
 const { 
return 0; }
 
   57   int cFlags()
 const { 
return 0; }
 
   58   static bool HasFlags()   { 
return false; }
 
   61   typedef CoordType::ScalarType      ScalarType;
 
   63   CoordType          P()
 const { assert(0); 
static CoordType coord(0, 0, 0);  assert(0); 
return coord; }
 
   64   const CoordType  &cP()
 const { assert(0); 
static CoordType coord(0, 0, 0);  assert(0); 
return coord; }
 
   65   static bool HasCoord()   { 
return false; }
 
   66   inline bool IsCoordEnabled()
 const { 
return TT::VertexType::HasCoord();}
 
   70   NormalType         N()
 const { assert(0); 
static NormalType dummy_normal(0, 0, 0); 
return dummy_normal; }
 
   71   const NormalType &cN()
 const { assert(0); 
static NormalType dummy_normal(0, 0, 0); 
return dummy_normal; }
 
   72   static bool HasNormal()    { 
return false; }
 
   73   inline bool IsNormalEnabled()
 const { 
return TT::VertexType::HasNormal();}
 
   75   typedef float QualityType;
 
   76   QualityType        &Q()       { assert(0); 
static QualityType dummyQuality(0); 
return dummyQuality; }
 
   77   QualityType         Q()
 const { assert(0); 
static QualityType dummyQuality(0); 
return dummyQuality; }
 
   78   const QualityType &cQ()
 const { assert(0); 
static QualityType dummyQuality(0); 
return dummyQuality; }
 
   79   static bool HasQuality()   { 
return false; }
 
   80   inline bool IsQualityEnabled()
 const { 
return TT::VertexType::HasQuality();}
 
   83   ColorType        &C()       { 
static ColorType dumcolor(vcg::Color4b::White); assert(0); 
return dumcolor; }
 
   84   ColorType         C()
 const { 
static ColorType dumcolor(vcg::Color4b::White);  assert(0); 
return dumcolor; }
 
   85   const ColorType &cC()
 const { 
static ColorType dumcolor(vcg::Color4b::White);  assert(0); 
return dumcolor; }
 
   86   static bool HasColor()   { 
return false; }
 
   87   inline bool IsColorEnabled()
 const { 
return TT::VertexType::HasColor();}
 
   91   int cIMark()
  const { assert(0); 
static int tmp=-1; 
return tmp;}
 
   92   int  IMark()
  const { assert(0); 
static int tmp=-1; 
return tmp;}
 
   93   int &IMark()        { assert(0); 
static int tmp=-1; 
return tmp;}
 
   94   static bool HasMark()   { 
return false; }
 
   95   inline bool IsMarkEnabled()
 const { 
return TT::VertexType::HasMark();}
 
   97   typedef ScalarType RadiusType;
 
   98   RadiusType        &R()       { 
static ScalarType v = 0.0; assert(0 && 
"the radius component is not available"); 
return v; }
 
   99   RadiusType         R()
 const { 
static const ScalarType v = 0.0; assert(0 && 
"the radius component is not available"); 
return v; }
 
  100   const RadiusType &cR()
 const { 
static const ScalarType v = 0.0; assert(0 && 
"the radius component is not available"); 
return v; }
 
  101   static bool HasRadius()     { 
return false; }
 
  102   inline bool IsRadiusEnabled()
 const { 
return TT::VertexType::HasRadius();}
 
  104   typedef vcg::TexCoord2<float,1> TexCoordType;
 
  105   TexCoordType        &T()       { 
static TexCoordType dummy_texcoord;  assert(0); 
return dummy_texcoord; }
 
  106   TexCoordType         T()
 const { 
static TexCoordType dummy_texcoord;  assert(0); 
return dummy_texcoord; }
 
  107   const TexCoordType &cT()
 const { 
static TexCoordType dummy_texcoord;  assert(0); 
return dummy_texcoord; }
 
  108   static bool HasTexCoord()   { 
return false; }
 
  109   inline bool IsTexCoordEnabled()
 const { 
return TT::VertexType::HasTexCoord();}
 
  111   typename TT::TetraPointer        &VTp()        { 
static typename TT::TetraPointer tp = 0;  assert(0); 
return tp; }
 
  112   const typename TT::TetraPointer &cVTp()
 const  { 
static typename TT::TetraPointer tp = 0;  assert(0); 
return tp; }
 
  113   int &VTi()       { 
static int z = 0; assert(0); 
return z; }
 
  114   int  VTi()
 const { 
static int z = 0; assert(0); 
return z; }
 
  115   int cVTi()
 const { 
static int z = 0; assert(0); 
return z; }
 
  116   static bool HasVTAdjacency() { 
return false; }
 
  117   bool IsVTInitialized()
 const {
return static_cast<const typename TT::VertexType *
>(
this)->cVTi()!=-1;}
 
  119     if(IsVTInitialized()) {
 
  120       static_cast<typename TT::VertexPointer
>(
this)->VTp()=0;
 
  121       static_cast<typename TT::VertexPointer
>(
this)->VTi()=-1;
 
  125   typename TT::FacePointer        &VFp()       { 
static typename TT::FacePointer fp=0;  assert(0); 
return fp; }
 
  126   const typename TT::FacePointer &cVFp()
 const { 
static typename TT::FacePointer fp=0;  assert(0); 
return fp; }
 
  127   int &VFi()       { 
static int z=-1; assert(0); 
return z;}
 
  128   int  VFi()
 const { 
static int z=-1; assert(0); 
return z;}
 
  129   int cVFi()
 const { 
static int z=-1; assert(0); 
return z;}
 
  130   bool IsNull()
 const { 
return true; }
 
  131   static bool HasVFAdjacency()   { 
return false; }
 
  132   bool IsVFInitialized()
 const {
return static_cast<const typename TT::VertexType *
>(
this)->cVFi()!=-1;}
 
  134     if(IsVFInitialized()) {
 
  135       static_cast<typename TT::VertexPointer
>(
this)->VFp()=0;
 
  136       static_cast<typename TT::VertexPointer
>(
this)->VFi()=-1;
 
  140   typename TT::EdgePointer &VEp()       { 
static typename TT::EdgePointer ep=0;  assert(0); 
return ep; }
 
  141   typename TT::EdgePointer cVEp()
 const { 
static typename TT::EdgePointer ep=0;  assert(0); 
return ep; }
 
  142   int &VEi()       { 
static int z=-1; 
return z;}
 
  143   int  VEi()
 const { 
static int z=-1; 
return z;}
 
  144   int cVEi()
 const { 
static int z=-1; 
return z;}
 
  145   static bool HasVEAdjacency()   {   
return false; }
 
  146   bool IsVEInitialized()
 const {
return static_cast<const typename TT::VertexType *
>(
this)->cVEi()!=-1;}
 
  148     if(IsVEInitialized()) {
 
  149       static_cast<typename TT::VertexPointer
>(
this)->VEp()=0;
 
  150       static_cast<typename TT::VertexPointer
>(
this)->VEi()=-1;
 
  153   typename TT::HEdgePointer &VHp()       { 
static typename TT::HEdgePointer ep=0;  assert(0); 
return ep; }
 
  154   typename TT::HEdgePointer cVHp()
 const { 
static typename TT::HEdgePointer ep=0;  assert(0); 
return ep; }
 
  155   int &VHi()       { 
static int z=0; 
return z;}
 
  156   int  VHi()
 const { 
static int z=0; 
return z;}
 
  157   int cVHi()
 const { 
static int z=0; 
return z;}
 
  158   static bool HasVHAdjacency()   {   
return false; }
 
  160   typedef float   CurScalarType;
 
  162   typedef Point2f CurvatureType;
 
  172   CurScalarType        &K1()       {
static ScalarType v = 0.0;assert(0);
return v;}
 
  173   CurScalarType        &K2()       {
static ScalarType v = 0.0;assert(0);
return v;}
 
  174   CurScalarType         K1()
 const {
static ScalarType v = 0.0;assert(0);
return v;}
 
  175   CurScalarType         K2()
 const {
static ScalarType v = 0.0;assert(0);
return v;}
 
  176   const CurScalarType &cK1()
 const {
static ScalarType v = 0.0;assert(0);
return v;}
 
  177   const CurScalarType &cK2()
 const {
static ScalarType v = 0.0;assert(0);
return v;}
 
  179   static bool HasCurvatureDir()         { 
return false; }
 
  180   inline bool IsCurvatureDirEnabled()
 const { 
return TT::VertexType::HasCurvatureDir();}
 
  182   template < 
class RightValueType>
 
  183   void ImportData(
const RightValueType  &  ) {
 
  186   static void Name(std::vector<std::string> & name){TT::Name(name);}
 
  194 template <
class A, 
class T> 
class Coord: 
public T {
 
  197   typedef typename A::ScalarType      ScalarType;
 
  199   inline const CoordType  &
P()
 const { 
return _coord; }
 
  201   inline       CoordType  &
P()       { 
return _coord; }
 
  203   inline const CoordType &
cP()
 const { 
return _coord; }
 
  205   template < 
class RightValueType>
 
  206   void ImportData(
const RightValueType  & rVert ) { 
if(rVert.IsCoordEnabled()) 
P().Import(rVert.cP()); T::ImportData( rVert); }
 
  207   static bool HasCoord()   { 
return true; }
 
  208   static void Name(std::vector<std::string> & name){name.push_back(std::string(
"Coord"));T::Name(name);}
 
  215 public: 
static void Name(std::vector<std::string> & name){name.push_back(std::string(
"Coord3f"));T::Name(name);}
 
  219 public: 
static void Name(std::vector<std::string> & name){name.push_back(std::string(
"Coord3d"));T::Name(name);}
 
  234 template <
class A, 
class T> 
class Normal: 
public T {
 
  236   typedef A NormalType;
 
  238   inline const NormalType  &
N()
 const { 
return _norm; }
 
  240   inline       NormalType  &
N()       { 
return _norm; }
 
  242   inline const NormalType &
cN()
 const { 
return _norm; }
 
  243   template < 
class RightValueType>
 
  244   void ImportData(
const RightValueType  & rVert ){
 
  245     if(rVert.IsNormalEnabled())  
N().Import(rVert.cN());
 
  246     T::ImportData( rVert);
 
  248   static bool HasNormal()   { 
return true; }
 
  249   static void Name(std::vector<std::string> & name){name.push_back(std::string(
"Normal"));T::Name(name);}
 
  256 public:
static void Name(std::vector<std::string> & name){name.push_back(std::string(
"Normal3s"));T::Name(name);}
 
  260 public: 
static void Name(std::vector<std::string> & name){name.push_back(std::string(
"Normal3f"));T::Name(name);}
 
  264 public: 
static void Name(std::vector<std::string> & name){name.push_back(std::string(
"Normal3d"));T::Name(name);}
 
  274 template <
class T> 
class Mark: 
public T {
 
  278   inline const int &
IMark()
 const { 
return _imark; }
 
  280   inline       int &
IMark()       { 
return _imark; }
 
  282   inline       int cIMark()
 const { 
return _imark; }
 
  283   static bool HasMark()      { 
return true; }
 
  284   inline void InitIMark()    { _imark = 0; }
 
  285   template < 
class RightValueType>
 
  286   void ImportData(
const RightValueType  & rVert ) { 
if(rVert.IsMarkEnabled())  
IMark() = rVert.cIMark(); T::ImportData( rVert); }
 
  287   static void Name(std::vector<std::string> & name){name.push_back(std::string(
"Mark"));T::Name(name);}
 
  307 template <
class A, 
class TT> 
class TexCoord: 
public TT {
 
  309   typedef A TexCoordType;
 
  312   const TexCoordType  &
T()
 const { 
return _t; }
 
  313         TexCoordType  &
T()       { 
return _t; }
 
  314   const TexCoordType &cT()
 const { 
return _t; }
 
  315     template < 
class RightValueType>
 
  316     void ImportData(
const RightValueType  & rVert ) { 
if(rVert.IsTexCoordEnabled()) 
T().Import(rVert.cT()); TT::ImportData(rVert); }
 
  317   static bool HasTexCoord()   { 
return true; }
 
  318     static void Name(std::vector<std::string> & name){name.push_back(std::string(
"TexCoord"));TT::Name(name);}
 
  326 public: 
static void Name(std::vector<std::string> & name){name.push_back(std::string(
"TexCoord2s"));TT::Name(name);}
 
  330 public: 
static void Name(std::vector<std::string> & name){name.push_back(std::string(
"TexCoord2f"));TT::Name(name);}
 
  334 public: 
static void Name(std::vector<std::string> & name){name.push_back(std::string(
"TexCoord2d"));TT::Name(name);}
 
  347   typedef int FlagType;
 
  348   inline const int &Flags()
 const {
return _flags;}
 
  349   inline       int &Flags()       {
return _flags;}
 
  350   inline       int cFlags()
 const {
return _flags;}
 
  351   template < 
class RightValueType>
 
  352   void ImportData(
const RightValueType  & rVert ) { 
if(RightValueType::HasFlags()) Flags() = rVert.cFlags(); T::ImportData( rVert); }
 
  353   static bool HasFlags()   { 
return true; }
 
  354   static void Name(std::vector<std::string> & name){name.push_back(std::string(
"BitFlags"));T::Name(name);}
 
  367 template <
class A, 
class T> 
class Color: 
public T {
 
  369   Color():_color(vcg::Color4b::White) {}
 
  371   inline const ColorType  &C()
 const { 
return _color; }
 
  372   inline       ColorType  &C()       { 
return _color; }
 
  373   inline const ColorType &cC()
 const { 
return _color; }
 
  374   template < 
class RightValueType>
 
  375   void ImportData(
const RightValueType  & rVert ) { 
if(rVert.IsColorEnabled()) C() = rVert.cC();  T::ImportData( rVert); }
 
  376   static bool HasColor()   { 
return true; }
 
  377   static void Name(std::vector<std::string> & name){name.push_back(std::string(
"Color"));T::Name(name);}
 
  384     public: 
static void Name(std::vector<std::string> & name){name.push_back(std::string(
"Color4b"));TT::Name(name);}
 
  395 template <
class A, 
class TT> 
class Quality: 
public TT {
 
  397   typedef A QualityType;
 
  400   inline const QualityType  &Q()
 const { 
return _quality; }
 
  401   inline       QualityType  &Q()       { 
return _quality; }
 
  402   inline const QualityType &cQ()
 const { 
return _quality; }
 
  403   template < 
class RightValueType>
 
  404   void ImportData(
const RightValueType  & rVert ) { 
if(rVert.IsQualityEnabled()) Q() = rVert.cQ(); TT::ImportData( rVert); }
 
  405   static bool HasQuality()   { 
return true; }
 
  406   static void Name(std::vector<std::string> & name){name.push_back(std::string(
"Quality"));TT::Name(name);}
 
  409   QualityType _quality;
 
  413 public: 
static void Name(std::vector<std::string> & name){name.push_back(std::string(
"Qualitys"));TT::Name(name);}
 
  416 public: 
static void Name(std::vector<std::string> & name){name.push_back(std::string(
"Qualityf"));TT::Name(name);}
 
  419 public: 
static void Name(std::vector<std::string> & name){name.push_back(std::string(
"Qualityd"));TT::Name(name);}
 
  430   typedef A CurvatureDirType;
 
  431     typedef typename CurvatureDirType::VecType CurVecType;
 
  432     typedef typename CurvatureDirType::ScalarType CurScalarType;
 
  434     CurVecType        &PD1()       { 
return _curv.max_dir; }
 
  435     CurVecType        &PD2()       { 
return _curv.min_dir; }
 
  436     const CurVecType &cPD1()
 const { 
return _curv.max_dir; }
 
  437     const CurVecType &cPD2()
 const { 
return _curv.min_dir; }
 
  439     CurScalarType        &K1()       { 
return _curv.k1; }
 
  440     CurScalarType        &K2()       { 
return _curv.k2; }
 
  441     const CurScalarType &cK1()
 const { 
return _curv.k1; }
 
  442     const CurScalarType &cK2()
 const { 
return _curv.k2; }
 
  443     template < 
class RightValueType>
 
  444     void ImportData(
const RightValueType  & rVert ) {
 
  445       if(rVert.IsCurvatureDirEnabled()) {
 
  446         PD1().Import(rVert.cPD1());
 
  447         PD2().Import(rVert.cPD2());
 
  448         K1()  = rVert.cK1();  K2()  = rVert.cK2();
 
  450       TT::ImportData( rVert);
 
  453     static bool HasCurvatureDir()   { 
return true; }
 
  454     static void Name(std::vector<std::string> & name){name.push_back(std::string(
"CurvatureDir"));TT::Name(name);}
 
  457   CurvatureDirType _curv;
 
  462 public: 
static void Name(std::vector<std::string> & name){name.push_back(std::string(
"CurvatureDirf"));T::Name(name);}
 
  465 public: 
static void Name(std::vector<std::string> & name){name.push_back(std::string(
"CurvatureDird"));T::Name(name);}
 
  473   template <
class A, 
class TT> 
class Radius: 
public TT {
 
  475     typedef A RadiusType;
 
  476     const RadiusType  &R()
 const { 
return _radius; }
 
  477           RadiusType  &R()       { 
return _radius; }
 
  478     const RadiusType &cR()
 const { 
return _radius; }
 
  479     template < 
class RightValueType>
 
  480     void ImportData(
const RightValueType  & rVert ) { 
if(rVert.IsRadiusEnabled()) R() = rVert.cR(); TT::ImportData( rVert); }
 
  481     static bool HasRadius()   { 
return true; }
 
  482     static void Name(std::vector<std::string> & name){name.push_back(std::string(
"Radius"));TT::Name(name);}
 
  489 public: 
static void Name(std::vector<std::string> & name){name.push_back(std::string(
"Radiusf"));TT::Name(name);}
 
  501 template <
class T> 
class VEAdj: 
public T {
 
  503   VEAdj(){_ep=0;_zp=-1;}
 
  504   typename T::EdgePointer        &VEp()       {
return _ep; }
 
  505   const typename T::EdgePointer &cVEp()
 const {
return _ep; }
 
  506   int &VEi()       {
return _zp; }
 
  507   int  VEi()
 const {
return _zp; }
 
  508   int cVEi()
 const {
return _zp; }
 
  509   template < 
class RightValueType>
 
  510   void ImportData(
const RightValueType  & rVert ) {  T::ImportData( rVert); }
 
  511   static bool HasVEAdjacency()   {   
return true; }
 
  512   static void Name(std::vector<std::string> & name){name.push_back(std::string(
"VEAdj"));T::Name(name);}
 
  515   typename T::EdgePointer _ep ;
 
  530   template <
class T> 
class VFAdj: 
public T {
 
  532     VFAdj(){_fp=0;_zp=-1;}
 
  533     typename T::FacePointer        &VFp()        { 
return _fp; }
 
  534     const typename T::FacePointer &cVFp()
 const  { 
return _fp; }
 
  535     int &VFi()       { 
return _zp; }
 
  536     int  VFi()
 const { 
return _zp; }
 
  537     int cVFi()
 const { 
return _zp; }
 
  538     bool IsNull()
 const { 
return _zp==-1;}
 
  539     template < 
class RightValueType>
 
  540     void ImportData(
const RightValueType  & rVert ) { T::ImportData( rVert); }
 
  541     static bool HasVFAdjacency()   {   
return true; }
 
  542     static void Name(std::vector<std::string> & name){name.push_back(std::string(
"VFAdj"));T::Name(name);}
 
  545     typename T::FacePointer _fp ;
 
  551 template <
class T> 
class VHAdj: 
public T {
 
  553     VHAdj(){_hp=0;_zp=-1;}
 
  554     typename T::HEdgePointer        &VHp()       {
return _hp; }
 
  555     const typename T::HEdgePointer &cVHp()
 const {
return _hp; }
 
  556     int &VHi() {
return _zp; }
 
  557     template < 
class RightValueType>
 
  558     void ImportData(
const RightValueType  & rVert ) {  T::ImportData( rVert); }
 
  559     static bool HasVHAdjacency()   {   
return true; }
 
  560     static void Name(std::vector<std::string> & name){name.push_back(std::string(
"VHAdj"));T::Name(name);}
 
  563     typename T::HEdgePointer _hp ;
 
  569 template <
class T> 
class VTAdj: 
public T {
 
  571     VTAdj() { _tp = 0; _zp=-1;}
 
  572     typename T::TetraPointer        &VTp()       { 
return _tp; }
 
  573     const typename T::TetraPointer &cVTp()
 const { 
return _tp; }
 
  574     int &VTi() {
return _zp; }
 
  575     int  VTi()
 const { 
return _zp; }
 
  576     int cVTi()
 const { 
return _zp; }
 
  577     static bool HasVTAdjacency() { 
return true; }
 
  578     static void Name( std::vector< std::string > & name ) { name.push_back( std::string(
"VTAdj") ); T::Name(name); }
 
  581     typename T::TetraPointer _tp ;
 
Component: Per vertex Flags
Definition: component.h:344
 
Definition: component.h:383
 
Component: Per vertex Color
Definition: component.h:367
 
Specialized Coord Component in double point precision.
Definition: component.h:218
 
Specialized Coord Component in floating point precision.
Definition: component.h:214
 
Generic Component: Geometric Position of the vertex Templated on the coordinate class....
Definition: component.h:194
 
const CoordType & P() const
Return a const reference to the coordinate of the vertex.
Definition: component.h:199
 
CoordType & P()
Return a reference to the coordinate of the vertex.
Definition: component.h:201
 
const CoordType & cP() const
Return a const reference to the coordinate of the vertex.
Definition: component.h:203
 
Component: Per vertex curvature directions This component keep the principal curvature directions....
Definition: component.h:428
 
Definition: component.h:464
 
Definition: component.h:461
 
Definition: component.h:52
 
Per vertex Incremental Mark.
Definition: component.h:274
 
int cIMark() const
Return a const reference to the incremental mark value.
Definition: component.h:282
 
const int & IMark() const
Return a const reference to the incremental mark value.
Definition: component.h:278
 
int & IMark()
Return a reference to the incremental mark value.
Definition: component.h:280
 
Specialized Normal component in double point precision.
Definition: component.h:263
 
Specialized Normal component in floating point precision.
Definition: component.h:259
 
Definition: component.h:255
 
Generic Component: Normal of the vertex
Definition: component.h:234
 
const NormalType & N() const
Return a const reference to the normal of the vertex.
Definition: component.h:238
 
NormalType & N()
Return a reference to the normal of the vertex.
Definition: component.h:240
 
const NormalType & cN() const
Return a const reference to the normal of the vertex.
Definition: component.h:242
 
Component: Per vertex quality The Quality Component is a generic place for storing a float....
Definition: component.h:395
 
Definition: component.h:418
 
Definition: component.h:415
 
Definition: component.h:412
 
Component: Per vertex radius
Definition: component.h:473
 
Definition: component.h:488
 
Specialized Texture component in double precision.
Definition: component.h:333
 
Specialized Texture component in floating point precision.
Definition: component.h:329
 
Definition: component.h:325
 
Generic Component: Per vertex Texture Coords
Definition: component.h:307
 
const TexCoordType & T() const
Return a const reference to the Texture Coordinate.
Definition: component.h:312
 
Component: Per vertex Vertex-Edge adjacency relation It stores a pointer to the first Edge of a list ...
Definition: component.h:501
 
Component: Per vertex Vertex-Face adjacency relation
Definition: component.h:530
 
Definition: component.h:551
 
Definition: component.h:569
 
Definition: namespaces.dox:6
 
Definition: component.h:42