24 #error "This file should not be included alone. It is automatically included by complex.h"
26 #ifndef __VCG_EDGE_PLUS_COMPONENT
27 #define __VCG_EDGE_PLUS_COMPONENT
43 template <
class T>
class EmptyCore:
public T
46 inline typename T::VertexType * & V(
const int j ) { (void)j; assert(0);
static typename T::VertexType *vp=0;
return vp; }
47 inline typename T::VertexType *
const & V(
const int j )
const { (void)j; assert(0);
static typename T::VertexType *vp=0;
return vp; }
48 inline typename T::VertexType * cV(
const int j )
const { (void)j; assert(0);
static typename T::VertexType *vp=0;
return vp; }
49 inline typename T::CoordType & P(
const int j ) { (void)j; assert(0);
static typename T::CoordType coord(0, 0, 0);
return coord; }
50 inline const typename T::CoordType & P(
const int j )
const { (void)j; assert(0);
static typename T::CoordType coord(0, 0, 0);
return coord; }
51 inline const typename T::CoordType & cP(
const int j )
const { (void)j; assert(0);
static typename T::CoordType coord(0, 0, 0);
return coord; }
52 static bool HasEVAdjacency() {
return false; }
53 static bool HasVertexRef() {
return false; }
55 typedef vcg::Color4b ColorType;
56 ColorType &C() {
static ColorType dumcolor(vcg::Color4b::White); assert(0);
return dumcolor; }
57 ColorType cC()
const {
static ColorType dumcolor(vcg::Color4b::White); assert(0);
return dumcolor; }
58 static bool HasColor() {
return false; }
60 typedef float QualityType;
61 QualityType &Q() {
static QualityType dummyQuality(0); assert(0);
return dummyQuality; }
62 QualityType cQ()
const {
static QualityType dummyQuality(0); assert(0);
return dummyQuality; }
63 static bool HasQuality() {
return false; }
66 inline void InitIMark() { }
67 inline int cIMark()
const { assert(0);
static int tmp=-1;
return tmp;}
68 inline int &IMark() { assert(0);
static int tmp=-1;
return tmp;}
69 static bool HasMark() {
return false; }
70 inline bool IsMarkEnabled( )
const {
return T::EdgeType::HasMark(); }
74 int &Flags() {
static int dummyflags(0); assert(0);
return dummyflags; }
75 int Flags()
const {
return 0; }
76 static bool HasFlags() {
return false; }
78 typename T::EdgePointer &VEp(
const int & ) {
static typename T::EdgePointer ep=0; assert(0);
return ep; }
79 typename T::EdgePointer cVEp(
const int & )
const {
static typename T::EdgePointer ep=0; assert(0);
return ep; }
80 int &VEi(
const int &){
static int z=0; assert(0);
return z;}
81 int cVEi(
const int &)
const {
static int z=0; assert(0);
return z;}
82 static bool HasVEAdjacency() {
return false; }
84 typename T::EdgePointer &EEp(
const int & ) {
static typename T::EdgePointer ep=0; assert(0);
return ep; }
85 typename T::EdgePointer cEEp(
const int & )
const {
static typename T::EdgePointer ep=0; assert(0);
return ep; }
86 int &EEi(
const int &){
static int z=0; assert(0);
return z;}
87 int cEEi(
const int &)
const {
static int z=0; assert(0);
return z;}
88 static bool HasEEAdjacency() {
return false; }
90 typename T::HEdgePointer &EHp( ) {
static typename T::HEdgePointer hp=0; assert(0);
return hp; }
91 typename T::HEdgePointer cEHp( )
const {
static typename T::HEdgePointer hp=0; assert(0);
return hp; }
92 static bool HasEHAdjacency() {
return false; }
94 typename T::FacePointer &EFp() {
static typename T::FacePointer fp=0; assert(0);
return fp; }
95 typename T::FacePointer cEFp()
const {
static typename T::FacePointer fp=0; assert(0);
return fp; }
96 int &EFi() {
static int z=0;
return z;}
97 int &cEFi()
const {
static int z=0;
return z;}
98 static bool HasEFAdjacency() {
return false; }
100 template <
class LeftF>
101 void ImportData(
const LeftF & leftF) {T::ImportData(leftF);}
102 static void Name(std::vector<std::string> & name){T::Name(name);}
118 typedef typename T::VertexType::CoordType CoordType;
119 typedef typename T::VertexType::ScalarType ScalarType;
121 inline typename T::VertexType * & V(
const int j ) { assert(j>=0 && j<2);
return v[j]; }
122 inline typename T::VertexType *
const & V(
const int j )
const { assert(j>=0 && j<2);
return v[j]; }
123 inline typename T::VertexType * cV(
const int j )
const { assert(j>=0 && j<2);
return v[j]; }
126 inline CoordType & P(
const int j ) { assert(j>=0 && j<2);
return v[j]->P(); }
127 inline const CoordType &cP(
const int j )
const { assert(j>=0 && j<2);
return v[j]->P(); }
132 inline typename T::VertexType * &
V0(
const int j ) {
return V(j);}
133 inline typename T::VertexType * & V1(
const int j ) {
return V((j+1)%2);}
134 inline const typename T::VertexType *
const &
V0(
const int j )
const {
return V(j);}
135 inline const typename T::VertexType *
const & V1(
const int j )
const {
return V((j+1)%2);}
136 inline const typename T::VertexType *
const & cV0(
const int j )
const {
return cV(j);}
137 inline const typename T::VertexType *
const & cV1(
const int j )
const {
return cV((j+1)%2);}
140 inline CoordType &
P0(
const int j ) {
return V(j)->P();}
141 inline CoordType & P1(
const int j ) {
return V((j+1)%2)->P();}
142 inline const CoordType &
P0(
const int j )
const {
return V(j)->P();}
143 inline const CoordType & P1(
const int j )
const {
return V((j+1)%2)->P();}
144 inline const CoordType & cP0(
const int j )
const {
return cV(j)->P();}
145 inline const CoordType & cP1(
const int j )
const {
return cV((j+1)%2)->P();}
147 template <
class LeftF>
148 void ImportData(
const LeftF & leftF){ T::ImportData(leftF);}
150 static bool HasEVAdjacency() {
return true; }
151 static bool HasVertexRef() {
return true; }
152 static void Name(std::vector<std::string> & name){name.push_back(std::string(
"VertexRef"));T::Name(name);}
156 typename T::VertexType *v[2];
159 template <
class T>
class EVAdj :
public VertexRef<T>{};
168 template <
class T>
class Mark:
public T {
171 static bool HasMark() {
return true; }
172 static bool HasMarkOcc() {
return true; }
173 inline void InitIMark() { _imark = 0; }
174 inline int & IMark() {
return _imark;}
175 inline int cIMark()
const {
return _imark;}
177 template <
class RightValueType>
178 void ImportData(
const RightValueType & rightE )
180 if(rightE.IsMarkEnabled())
181 IMark() = rightE.cIMark();
182 T::ImportData(rightE);
184 static void Name(std::vector<std::string> & name){name.push_back(std::string(
"Mark"));T::Name(name);}
198 typedef int FlagType;
199 int &Flags() {
return _flags; }
200 int Flags()
const {
return _flags; }
201 template <
class LeftV>
202 void ImportData(
const LeftV & left ) { Flags() = left.Flags(); T::ImportData( left); }
203 static bool HasFlags() {
return true; }
204 static void Name(std::vector<std::string> & name){name.push_back(std::string(
"BitFlags"));T::Name(name);}
216 template <
class A,
class T>
class Color:
public T {
218 Color():_color(vcg::Color4b::White) {}
220 ColorType &C() {
return _color; }
221 const ColorType &C()
const {
return _color; }
222 const ColorType &cC()
const {
return _color; }
223 template <
class LeftV>
224 void ImportData(
const LeftV & left ) { C() = left.cC(); T::ImportData( left); }
225 static bool HasColor() {
return true; }
226 static void Name(std::vector<std::string> & name){name.push_back(std::string(
"Color"));T::Name(name);}
232 template <
class TT>
class Color4b:
public edge::Color<vcg::Color4b, TT> {
233 public:
static void Name(std::vector<std::string> & name){name.push_back(std::string(
"Color4b"));TT::Name(name);}
243 template <
class A,
class TT>
class Quality:
public TT {
245 typedef A QualityType;
246 QualityType &Q() {
return _quality; }
247 const QualityType & cQ()
const {
return _quality; }
248 template <
class LeftV>
249 void ImportData(
const LeftV & left ) { Q() = left.cQ(); TT::ImportData( left); }
250 static bool HasQuality() {
return true; }
251 static void Name(std::vector<std::string> & name){name.push_back(std::string(
"Quality"));TT::Name(name);}
254 QualityType _quality;
257 template <
class TT>
class Qualitys:
public Quality<short, TT> {
258 public:
static void Name(std::vector<std::string> & name){name.push_back(std::string(
"Qualitys"));TT::Name(name);}
260 template <
class TT>
class Qualityf:
public Quality<float, TT> {
261 public:
static void Name(std::vector<std::string> & name){name.push_back(std::string(
"Qualityf"));TT::Name(name);}
263 template <
class TT>
class Qualityd:
public Quality<double, TT> {
264 public:
static void Name(std::vector<std::string> & name){name.push_back(std::string(
"Qualityd"));TT::Name(name);}
275 template <
class T>
class VEAdj:
public T {
277 VEAdj(){_ep[0]=0;_ep[1]=0;_zp[0]=-1;_zp[1]=-1;}
278 typename T::EdgePointer &VEp(
const int & i) {
return _ep[i]; }
279 typename T::EdgePointer cVEp(
const int & i)
const {
return _ep[i]; }
280 int &VEi(
const int & i){
return _zp[i];}
281 int cVEi(
const int &i )
const {
return _zp[i];}
283 template <
class LeftV>
284 void ImportData(
const LeftV & left ) { T::ImportData( left); }
285 static bool HasVEAdjacency() {
return true; }
286 static bool HasVEAdjacencyOcc() {
return true; }
287 static void Name(std::vector<std::string> & name){name.push_back(std::string(
"VEAdj"));T::Name(name);}
290 typename T::EdgePointer _ep[2] ;
308 template <
class T>
class EEAdj:
public T {
310 EEAdj(){_ep[0]=0;_ep[1]=0;_zp[0]=-1;_zp[1]=-1;}
311 typename T::EdgePointer &EEp(
const int & i) {
return _ep[i]; }
312 typename T::EdgePointer cEEp(
const int & i)
const {
return _ep[i]; }
313 int &EEi(
const int & i){
return _zp[i];}
314 int cEEi(
const int &i )
const {
return _zp[i];}
316 template <
class LeftV>
317 void ImportData(
const LeftV & left ) { T::ImportData( left); }
318 static bool HasEEAdjacency() {
return true; }
319 static bool HasEEAdjacencyOcc() {
return true; }
320 static void Name(std::vector<std::string> & name){name.push_back(std::string(
"EEAdj"));T::Name(name);}
323 typename T::EdgePointer _ep[2] ;
328 template <
class T>
class EHAdj:
public T {
331 typename T::HEdgePointer &EHp( ) {
return _hp ; }
332 const typename T::HEdgePointer cEHp( )
const {
return _hp ; }
334 template <
class LeftV>
335 void ImportData(
const LeftV & left ) { T::ImportData( left); }
336 static bool HasEHAdjacency() {
return true; }
337 static bool HasEHAdjacencyOcc() {
return true; }
338 static void Name(std::vector<std::string> & name){name.push_back(std::string(
"EHAdj"));T::Name(name);}
341 typename T::HEdgePointer _hp ;
352 template <
class T>
class EFAdj:
public T {
355 typename T::FacePointer &EFp() {
return _fp; }
356 typename T::FacePointer cEFp()
const {
return _fp; }
357 int &EFi() {
return _zp; }
358 int cEFi()
const {
return _zp; }
359 template <
class LeftV>
360 void ImportData(
const LeftV & left ) { T::ImportData( left); }
361 static bool HasEFAdjacency() {
return true; }
362 static bool HasEFAdjacencyOcc() {
return true; }
363 static void Name(std::vector<std::string> & name){name.push_back(std::string(
"EFAdj"));T::Name(name);}
366 typename T::FacePointer _fp ;