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
This commit is contained in:
parent
03007bab77
commit
cfd778ec1b
|
|
@ -24,6 +24,10 @@
|
||||||
History
|
History
|
||||||
|
|
||||||
$Log: not supported by cvs2svn $
|
$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
|
Revision 1.3 2005/11/12 18:42:18 cignoni
|
||||||
Added ClearS and GetBBox
|
Added ClearS and GetBBox
|
||||||
|
|
||||||
|
|
@ -67,6 +71,10 @@ class FaceTypeHolder{
|
||||||
typedef BET *EdgePointer;
|
typedef BET *EdgePointer;
|
||||||
typedef BFT *FacePointer;
|
typedef BFT *FacePointer;
|
||||||
typedef BTT *TetraPointer;
|
typedef BTT *TetraPointer;
|
||||||
|
|
||||||
|
|
||||||
|
// prot
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* The base class form which we start to add our components.
|
/* The base class form which we start to add our components.
|
||||||
|
|
@ -147,7 +155,16 @@ class FaceArityMax: public G<FaceArity6<BVT,BET,BFT,BTT, A, B, C, D, E, F> > {
|
||||||
|
|
||||||
// ----- Flags stuff -----
|
// ----- Flags stuff -----
|
||||||
public:
|
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
|
// This bit indicate that the face is deleted from the mesh
|
||||||
DELETED = 0x00000001, // cancellato
|
DELETED = 0x00000001, // cancellato
|
||||||
// This bit indicate that the face of the mesh is not readable
|
// This bit indicate that the face of the mesh is not readable
|
||||||
|
|
@ -173,61 +190,50 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
inline int & UberFlags ()
|
|
||||||
{
|
|
||||||
return Flags();
|
|
||||||
}
|
|
||||||
inline const int UberFlags() const
|
|
||||||
{
|
|
||||||
return Flags();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// checks if the Face is deleted
|
/// 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
|
/// 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
|
/// 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
|
/// 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
|
/// checks if the Face is Modified
|
||||||
bool IsS() const {return (Flags() & SELECTED) != 0;}
|
bool IsS() const {return (this->Flags() & SELECTED) != 0;}
|
||||||
/// checks if the Face is readable
|
|
||||||
bool IsB() const {return (Flags() & BORDER) != 0;}
|
|
||||||
|
|
||||||
/** Set the flag value
|
/** Set the flag value
|
||||||
@param flagp Valore da inserire nel flag
|
@param flagp Valore da inserire nel flag
|
||||||
*/
|
*/
|
||||||
void SetFlags(int flagp) {Flags()=flagp;}
|
void SetFlags(int flagp) {this->Flags()=flagp;}
|
||||||
|
|
||||||
/** Set the flag value
|
/** Set the flag value
|
||||||
@param flagp Valore da inserire nel flag
|
@param flagp Valore da inserire nel flag
|
||||||
*/
|
*/
|
||||||
void ClearFlags() {Flags()=0;}
|
void ClearFlags() {this->Flags()=0;}
|
||||||
|
|
||||||
/// deletes the Face from the mesh
|
/// deletes the Face from the mesh
|
||||||
void SetD() {Flags() |=DELETED;}
|
void SetD() {this->Flags() |=DELETED;}
|
||||||
/// un-delete a Face
|
/// un-delete a Face
|
||||||
void ClearD() {Flags() &=(~DELETED);}
|
void ClearD() {this->Flags() &=(~DELETED);}
|
||||||
/// marks the Face as readable
|
/// marks the Face as readable
|
||||||
void SetR() {Flags() &=(~NOTREAD);}
|
void SetR() {this->Flags() &=(~NOTREAD);}
|
||||||
/// marks the Face as not readable
|
/// marks the Face as not readable
|
||||||
void ClearR() {Flags() |=NOTREAD;}
|
void ClearR() {this->Flags() |=NOTREAD;}
|
||||||
/// marks the Face as writable
|
/// marks the Face as writable
|
||||||
void ClearW() {Flags() |=NOTWRITE;}
|
void ClearW() {this->Flags() |=NOTWRITE;}
|
||||||
/// marks the Face as not writable
|
/// marks the Face as not writable
|
||||||
void SetW() {Flags() &=(~NOTWRITE);}
|
void SetW() {this->Flags() &=(~NOTWRITE);}
|
||||||
/// select the Face
|
/// select the Face
|
||||||
void SetS() {Flags() |=SELECTED;}
|
void SetS() {this->Flags() |=SELECTED;}
|
||||||
/// Un-select a Face
|
/// Un-select a Face
|
||||||
/// This function checks if the face is selected
|
/// This function checks if the face is selected
|
||||||
bool IsB(int i) const {return (Flags() & (BORDER0<<i)) != 0;}
|
bool IsB(int i) const {return (this->Flags() & (BORDER0<<i)) != 0;}
|
||||||
/// This function select the face
|
/// This function select the face
|
||||||
void SetB(int i) {Flags() |=(BORDER0<<i);}
|
void SetB(int i) {this->Flags() |=(BORDER0<<i);}
|
||||||
/// This funcion execute the inverse operation of SetS()
|
/// This funcion execute the inverse operation of SetS()
|
||||||
void ClearB(int i) {Flags() &= (~(BORDER0<<i));}
|
void ClearB(int i) {this->Flags() &= (~(BORDER0<<i));}
|
||||||
/// Un-select a vertex
|
/// Un-select a vertex
|
||||||
void ClearS() {Flags() &= ~SELECTED;}
|
void ClearS() {this->Flags() &= ~SELECTED;}
|
||||||
|
|
||||||
/// Return the first bit that is not still used
|
/// Return the first bit that is not still used
|
||||||
static int &LastBitFlag()
|
static int &LastBitFlag()
|
||||||
|
|
@ -236,14 +242,14 @@ static int &LastBitFlag()
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// allocate a bit among the flags that can be used by user.
|
/// allocate a bit among the flags that can be used by user.
|
||||||
static inline int NewBitFlag()
|
static inline int NewBitFlag()
|
||||||
{
|
{
|
||||||
LastBitFlag()=LastBitFlag()<<1;
|
LastBitFlag()=LastBitFlag()<<1;
|
||||||
return LastBitFlag();
|
return LastBitFlag();
|
||||||
}
|
}
|
||||||
// de-allocate a bit among the flags that can be used by user.
|
// de-allocate a bit among the flags that can be used by user.
|
||||||
static inline bool DeleteBitFlag(int bitval)
|
static inline bool DeleteBitFlag(int bitval)
|
||||||
{
|
{
|
||||||
if(LastBitFlag()==bitval) {
|
if(LastBitFlag()==bitval) {
|
||||||
LastBitFlag()= LastBitFlag()>>1;
|
LastBitFlag()= LastBitFlag()>>1;
|
||||||
|
|
@ -253,22 +259,23 @@ static inline bool DeleteBitFlag(int bitval)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
/// This function checks if the given user bit is true
|
/// 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
|
/// 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
|
/// This function clear the given user bit
|
||||||
void ClearUserBit(int userBit){Flags() &= (~userBit);}
|
void ClearUserBit(int userBit){this->Flags() &= (~userBit);}
|
||||||
|
|
||||||
template<class BoxType>
|
template<class BoxType>
|
||||||
void GetBBox( BoxType & bb ) const
|
void GetBBox( BoxType & bb ) const
|
||||||
{
|
{
|
||||||
bb.Set(P(0));
|
bb.Set(this->P(0));
|
||||||
bb.Add(P(1));
|
bb.Add(this->P(1));
|
||||||
bb.Add(P(2));
|
bb.Add(this->P(2));
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
template < typename T=int>
|
template < typename T=int>
|
||||||
class FaceDefaultDeriver : public T {};
|
class FaceDefaultDeriver : public T {};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue