24 #ifndef __VCG_EDGE_PLUS_COMPONENT
25 #define __VCG_EDGE_PLUS_COMPONENT
31 #include <vcg/space/color4.h>
51 inline typename T::VertexType * & V(
const int j ) { (void)j; assert(0);
static typename T::VertexType *vp=0;
return vp; }
52 inline typename T::VertexType *
const & V(
const int j )
const { (void)j; assert(0);
static typename T::VertexType *vp=0;
return vp; }
53 inline typename T::VertexType * cV(
const int j )
const { (void)j; assert(0);
static typename T::VertexType *vp=0;
return vp; }
54 inline typename T::CoordType & P(
const int j ) { (void)j; assert(0);
static typename T::CoordType coord(0, 0, 0);
return coord; }
55 inline const typename T::CoordType & P(
const int j )
const { (void)j; assert(0);
static typename T::CoordType coord(0, 0, 0);
return coord; }
56 inline const typename T::CoordType & cP(
const int j )
const { (void)j; assert(0);
static typename T::CoordType coord(0, 0, 0);
return coord; }
57 static bool HasEVAdjacency() {
return false; }
58 static bool HasVertexRef() {
return false; }
61 ColorType &C() {
static ColorType dumcolor(vcg::Color4b::White); assert(0);
return dumcolor; }
62 ColorType cC()
const {
static ColorType dumcolor(vcg::Color4b::White); assert(0);
return dumcolor; }
63 static bool HasColor() {
return false; }
64 inline bool IsColorEnabled()
const {
return T::EdgeType::HasColor(); }
67 typedef float QualityType;
68 QualityType &Q() {
static QualityType dummyQuality(0); assert(0);
return dummyQuality; }
69 QualityType cQ()
const {
static QualityType dummyQuality(0); assert(0);
return dummyQuality; }
70 static bool HasQuality() {
return false; }
71 inline bool IsQualityEnabled()
const {
return T::EdgeType::HasQuality(); }
74 inline void InitIMark() { }
75 inline int cIMark()
const { assert(0);
static int tmp=-1;
return tmp;}
76 inline int &IMark() { assert(0);
static int tmp=-1;
return tmp;}
77 static bool HasMark() {
return false; }
78 inline bool IsMarkEnabled( )
const {
return T::EdgeType::HasMark(); }
82 int &Flags() {
static int dummyflags(0); assert(0);
return dummyflags; }
83 int Flags()
const {
return 0; }
84 static bool HasFlags() {
return false; }
86 typename T::EdgePointer &VEp(
const int & ) {
static typename T::EdgePointer ep=0; assert(0);
return ep; }
87 typename T::EdgePointer cVEp(
const int & )
const {
static typename T::EdgePointer ep=0; assert(0);
return ep; }
88 int &VEi(
const int &){
static int z=0; assert(0);
return z;}
89 int VEi(
const int &)
const {
static int z=0; assert(0);
return z;}
90 int cVEi(
const int &)
const {
static int z=0; assert(0);
return z;}
91 static bool HasVEAdjacency() {
return false; }
93 typename T::EdgePointer &EEp(
const int & ) {
static typename T::EdgePointer ep=0; assert(0);
return ep; }
94 typename T::EdgePointer cEEp(
const int & )
const {
static typename T::EdgePointer ep=0; assert(0);
return ep; }
95 int &EEi(
const int &){
static int z=0; assert(0);
return z;}
96 int cEEi(
const int &)
const {
static int z=0; assert(0);
return z;}
97 static bool HasEEAdjacency() {
return false; }
99 typename T::HEdgePointer &EHp( ) {
static typename T::HEdgePointer hp=0; assert(0);
return hp; }
100 typename T::HEdgePointer cEHp( )
const {
static typename T::HEdgePointer hp=0; assert(0);
return hp; }
101 static bool HasEHAdjacency() {
return false; }
103 typename T::FacePointer &EFp() {
static typename T::FacePointer fp=0; assert(0);
return fp; }
104 typename T::FacePointer cEFp()
const {
static typename T::FacePointer fp=0; assert(0);
return fp; }
105 int &EFi() {
static int z=0;
return z;}
106 int &cEFi()
const {
static int z=0;
return z;}
107 static bool HasEFAdjacency() {
return false; }
109 template <
class LeftF>
110 void ImportData(
const LeftF & leftF) {T::ImportData(leftF);}
111 static void Name(std::vector<std::string> & name){T::Name(name);}
127 typedef typename T::VertexType::CoordType CoordType;
128 typedef typename T::VertexType::ScalarType ScalarType;
130 inline typename T::VertexType * & V(
const int j ) { assert(j>=0 && j<2);
return v[j]; }
131 inline typename T::VertexType *
const & V(
const int j )
const { assert(j>=0 && j<2);
return v[j]; }
132 inline typename T::VertexType * cV(
const int j )
const { assert(j>=0 && j<2);
return v[j]; }
135 inline CoordType &
P(
const int j ) { assert(j>=0 && j<2);
return v[j]->P();}
136 inline const CoordType &
P(
const int j )
const { assert(j>=0 && j<2);
return v[j]->P();}
137 inline const CoordType & cP(
const int j )
const { assert(j>=0 && j<2);
return v[j]->P();}
142 inline typename T::VertexType * &
V0(
const int j ) {
return V(j);}
143 inline typename T::VertexType * & V1(
const int j ) {
return V((j+1)%2);}
144 inline const typename T::VertexType *
const &
V0(
const int j )
const {
return V(j);}
145 inline const typename T::VertexType *
const & V1(
const int j )
const {
return V((j+1)%2);}
146 inline const typename T::VertexType *
const & cV0(
const int j )
const {
return cV(j);}
147 inline const typename T::VertexType *
const & cV1(
const int j )
const {
return cV((j+1)%2);}
150 inline CoordType &
P0(
const int j ) {
return V(j)->P();}
151 inline CoordType & P1(
const int j ) {
return V((j+1)%2)->P();}
152 inline const CoordType &
P0(
const int j )
const {
return V(j)->P();}
153 inline const CoordType & P1(
const int j )
const {
return V((j+1)%2)->P();}
154 inline const CoordType & cP0(
const int j )
const {
return cV(j)->P();}
155 inline const CoordType & cP1(
const int j )
const {
return cV((j+1)%2)->P();}
157 template <
class LeftF>
158 void ImportData(
const LeftF & leftF){ T::ImportData(leftF);}
160 static bool HasEVAdjacency() {
return true; }
161 static bool HasVertexRef() {
return true; }
162 static void Name(std::vector<std::string> & name){name.push_back(std::string(
"VertexRef"));T::Name(name);}
166 typename T::VertexType *v[2];
178 template <
class T>
class Mark:
public T {
181 static bool HasMark() {
return true; }
182 static bool HasMarkOcc() {
return true; }
183 inline void InitIMark() { _imark = 0; }
184 inline int & IMark() {
return _imark;}
185 inline int cIMark()
const {
return _imark;}
187 template <
class RightValueType>
188 void ImportData(
const RightValueType & rightE )
190 if(rightE.IsMarkEnabled())
191 IMark() = rightE.cIMark();
192 T::ImportData(rightE);
194 static void Name(std::vector<std::string> & name){name.push_back(std::string(
"Mark"));T::Name(name);}
208 typedef int FlagType;
209 int &Flags() {
return _flags; }
210 int Flags()
const {
return _flags; }
211 template <
class LeftV>
212 void ImportData(
const LeftV & left ) { Flags() = left.Flags(); T::ImportData( left); }
213 static bool HasFlags() {
return true; }
214 static void Name(std::vector<std::string> & name){name.push_back(std::string(
"BitFlags"));T::Name(name);}
226 template <
class A,
class T>
class Color:
public T {
228 Color():_color(vcg::Color4b::White) {}
230 ColorType &C() {
return _color; }
231 const ColorType &C()
const {
return _color; }
232 const ColorType &cC()
const {
return _color; }
233 template <
class LeftV>
234 void ImportData(
const LeftV & left ) {
if (left.IsColorEnabled()) C() = left.cC(); T::ImportData( left); }
235 static bool HasColor() {
return true; }
236 static void Name(std::vector<std::string> & name){name.push_back(std::string(
"Color"));T::Name(name);}
243 public:
static void Name(std::vector<std::string> & name){name.push_back(std::string(
"Color4b"));TT::Name(name);}
253 template <
class A,
class TT>
class Quality:
public TT {
255 typedef A QualityType;
256 QualityType &Q() {
return _quality; }
257 const QualityType & cQ()
const {
return _quality; }
258 template <
class LeftV>
259 void ImportData(
const LeftV & left ) {
if (left.IsQualityEnabled()) Q() = left.cQ(); TT::ImportData( left); }
260 static bool HasQuality() {
return true; }
261 static void Name(std::vector<std::string> & name){name.push_back(std::string(
"Quality"));TT::Name(name);}
264 QualityType _quality;
268 public:
static void Name(std::vector<std::string> & name){name.push_back(std::string(
"Qualitys"));TT::Name(name);}
271 public:
static void Name(std::vector<std::string> & name){name.push_back(std::string(
"Qualityf"));TT::Name(name);}
274 public:
static void Name(std::vector<std::string> & name){name.push_back(std::string(
"Qualityd"));TT::Name(name);}
285 template <
class T>
class VEAdj:
public T {
287 VEAdj(){_ep[0]=0;_ep[1]=0;_zp[0]=-1;_zp[1]=-1;}
288 typename T::EdgePointer &VEp(
const int & i) {
return _ep[i]; }
289 typename T::EdgePointer cVEp(
const int & i)
const {
return _ep[i]; }
290 int &VEi(
const int & i){
return _zp[i];}
291 int VEi(
const int & i)
const {
return _zp[i];}
292 int cVEi(
const int &i )
const {
return _zp[i];}
294 template <
class LeftV>
295 void ImportData(
const LeftV & left ) { T::ImportData( left); }
296 static bool HasVEAdjacency() {
return true; }
297 static bool HasVEAdjacencyOcc() {
return true; }
298 static void Name(std::vector<std::string> & name){name.push_back(std::string(
"VEAdj"));T::Name(name);}
301 typename T::EdgePointer _ep[2] ;
319 template <
class T>
class EEAdj:
public T {
321 EEAdj(){_ep[0]=0;_ep[1]=0;_zp[0]=-1;_zp[1]=-1;}
322 typename T::EdgePointer &EEp(
const int & i) {
return _ep[i]; }
323 typename T::EdgePointer cEEp(
const int & i)
const {
return _ep[i]; }
324 int &EEi(
const int & i){
return _zp[i];}
325 int cEEi(
const int &i )
const {
return _zp[i];}
327 template <
class LeftV>
328 void ImportData(
const LeftV & left ) { T::ImportData( left); }
329 static bool HasEEAdjacency() {
return true; }
330 static bool HasEEAdjacencyOcc() {
return true; }
331 static void Name(std::vector<std::string> & name){name.push_back(std::string(
"EEAdj"));T::Name(name);}
334 typename T::EdgePointer _ep[2] ;
339 template <
class T>
class EHAdj:
public T {
342 typename T::HEdgePointer &EHp( ) {
return _hp ; }
343 const typename T::HEdgePointer cEHp( )
const {
return _hp ; }
345 template <
class LeftV>
346 void ImportData(
const LeftV & left ) { T::ImportData( left); }
347 static bool HasEHAdjacency() {
return true; }
348 static bool HasEHAdjacencyOcc() {
return true; }
349 static void Name(std::vector<std::string> & name){name.push_back(std::string(
"EHAdj"));T::Name(name);}
352 typename T::HEdgePointer _hp ;
363 template <
class T>
class EFAdj:
public T {
366 typename T::FacePointer &EFp() {
return _fp; }
367 typename T::FacePointer cEFp()
const {
return _fp; }
368 int &EFi() {
return _zp; }
369 int cEFi()
const {
return _zp; }
370 template <
class LeftV>
371 void ImportData(
const LeftV & left ) { T::ImportData( left); }
372 static bool HasEFAdjacency() {
return true; }
373 static bool HasEFAdjacencyOcc() {
return true; }
374 static void Name(std::vector<std::string> & name){name.push_back(std::string(
"EFAdj"));T::Name(name);}
377 typename T::FacePointer _fp ;
Component: Per edge Flags
Definition: component.h:205
Definition: component.h:242
Component: Per edge Color
Definition: component.h:226
Component: Edge-Edge adjacency relation This component implement store the pointer (and index) of the...
Definition: component.h:319
Component: Edge-Face adjacency relation This component implement store the pointer to a face sharing ...
Definition: component.h:363
Definition: component.h:339
Definition: component.h:169
Definition: component.h:49
Component: Per edge Incremental Mark
Definition: component.h:178
Component: Per edge quality
Definition: component.h:253
Definition: component.h:273
Definition: component.h:270
Definition: component.h:267
Component: Per vertex Vertex-Edge adjacency relation companion component This component implement one...
Definition: component.h:285
The references to the two vertexes of a edge.
Definition: component.h:120
CoordType & P0(const int j)
Shortcuts to access points.
Definition: component.h:150
T::VertexType *& V0(const int j)
Definition: component.h:142
CoordType & P(const int j)
Shortcuts to access points.
Definition: component.h:135
Definition: namespaces.dox:6