From cfd778ec1b5d37673eaef094078fbf7f98dbb479 Mon Sep 17 00:00:00 2001 From: cignoni Date: Fri, 2 Dec 2005 00:41:38 +0000 Subject: [PATCH] Added and removed typenames for gcc compiling. Added this-> qualifier for referencing the elemntes of the templated base class (e.g. to refer the possibly overridden flags()) it seems to be needed by the standard --- vcg/simplex/faceplus/base.h | 109 +++++++++++++++++++----------------- 1 file changed, 58 insertions(+), 51 deletions(-) diff --git a/vcg/simplex/faceplus/base.h b/vcg/simplex/faceplus/base.h index b6d472e0..46fa3858 100644 --- a/vcg/simplex/faceplus/base.h +++ b/vcg/simplex/faceplus/base.h @@ -24,6 +24,10 @@ History $Log: not supported by cvs2svn $ +Revision 1.4 2005/11/16 22:56:32 cignoni +Added EmptyMark to base class +Standardized name of flags. It is plural becouse each simplex has many flag. + Revision 1.3 2005/11/12 18:42:18 cignoni Added ClearS and GetBBox @@ -67,6 +71,10 @@ class FaceTypeHolder{ typedef BET *EdgePointer; typedef BFT *FacePointer; typedef BTT *TetraPointer; + + + // prot + }; /* The base class form which we start to add our components. @@ -147,7 +155,16 @@ class FaceArityMax: public G > { // ----- Flags stuff ----- public: - enum { + + inline int & UberFlags () + { + return this->Flags(); + } + inline const int UberFlags() const + { + return this->Flags(); + } + enum { // This bit indicate that the face is deleted from the mesh DELETED = 0x00000001, // cancellato // This bit indicate that the face of the mesh is not readable @@ -172,62 +189,51 @@ public: USER0 = 0x00040000 }; - - inline int & UberFlags () - { - return Flags(); - } - inline const int UberFlags() const - { - return Flags(); - } - + /// checks if the Face is deleted - bool IsD() const {return (Flags() & DELETED) != 0;} + bool IsD() const {return (this->Flags() & DELETED) != 0;} /// checks if the Face is readable - bool IsR() const {return (Flags() & NOTREAD) == 0;} + bool IsR() const {return (this->Flags() & NOTREAD) == 0;} /// checks if the Face is modifiable - bool IsW() const {return (Flags() & NOTWRITE)== 0;} + bool IsW() const {return (this->Flags() & NOTWRITE)== 0;} /// This funcion checks whether the Face is both readable and modifiable - bool IsRW() const {return (Flags() & (NOTREAD | NOTWRITE)) == 0;} + bool IsRW() const {return (this->Flags() & (NOTREAD | NOTWRITE)) == 0;} /// checks if the Face is Modified - bool IsS() const {return (Flags() & SELECTED) != 0;} - /// checks if the Face is readable - bool IsB() const {return (Flags() & BORDER) != 0;} + bool IsS() const {return (this->Flags() & SELECTED) != 0;} + + /** Set the flag value + @param flagp Valore da inserire nel flag + */ + void SetFlags(int flagp) {this->Flags()=flagp;} /** Set the flag value @param flagp Valore da inserire nel flag */ - void SetFlags(int flagp) {Flags()=flagp;} - - /** Set the flag value - @param flagp Valore da inserire nel flag - */ - void ClearFlags() {Flags()=0;} + void ClearFlags() {this->Flags()=0;} /// deletes the Face from the mesh - void SetD() {Flags() |=DELETED;} + void SetD() {this->Flags() |=DELETED;} /// un-delete a Face - void ClearD() {Flags() &=(~DELETED);} + void ClearD() {this->Flags() &=(~DELETED);} /// marks the Face as readable - void SetR() {Flags() &=(~NOTREAD);} + void SetR() {this->Flags() &=(~NOTREAD);} /// marks the Face as not readable - void ClearR() {Flags() |=NOTREAD;} + void ClearR() {this->Flags() |=NOTREAD;} /// marks the Face as writable - void ClearW() {Flags() |=NOTWRITE;} + void ClearW() {this->Flags() |=NOTWRITE;} /// marks the Face as not writable - void SetW() {Flags() &=(~NOTWRITE);} + void SetW() {this->Flags() &=(~NOTWRITE);} /// select the Face - void SetS() {Flags() |=SELECTED;} + void SetS() {this->Flags() |=SELECTED;} /// Un-select a Face /// This function checks if the face is selected - bool IsB(int i) const {return (Flags() & (BORDER0<Flags() & (BORDER0<Flags() |=(BORDER0<Flags() &= (~(BORDER0<Flags() &= ~SELECTED;} /// Return the first bit that is not still used static int &LastBitFlag() @@ -236,14 +242,14 @@ static int &LastBitFlag() return b; } -/// allocate a bit among the flags that can be used by user. -static inline int NewBitFlag() - { - LastBitFlag()=LastBitFlag()<<1; - return LastBitFlag(); - } -// de-allocate a bit among the flags that can be used by user. -static inline bool DeleteBitFlag(int bitval) + /// allocate a bit among the flags that can be used by user. + static inline int NewBitFlag() + { + LastBitFlag()=LastBitFlag()<<1; + return LastBitFlag(); + } + // de-allocate a bit among the flags that can be used by user. + static inline bool DeleteBitFlag(int bitval) { if(LastBitFlag()==bitval) { LastBitFlag()= LastBitFlag()>>1; @@ -253,22 +259,23 @@ static inline bool DeleteBitFlag(int bitval) return false; } /// This function checks if the given user bit is true - bool IsUserBit(int userBit){return (Flags() & userBit) != 0;} + bool IsUserBit(int userBit){return (this->Flags() & userBit) != 0;} /// This function set the given user bit - void SetUserBit(int userBit){Flags() |=userBit;} + void SetUserBit(int userBit){this->Flags() |=userBit;} /// This function clear the given user bit - void ClearUserBit(int userBit){Flags() &= (~userBit);} + void ClearUserBit(int userBit){this->Flags() &= (~userBit);} - template + template void GetBBox( BoxType & bb ) const { - bb.Set(P(0)); - bb.Add(P(1)); - bb.Add(P(2)); + bb.Set(this->P(0)); + bb.Add(this->P(1)); + bb.Add(this->P(2)); } - }; +}; + template < typename T=int> class FaceDefaultDeriver : public T {};