Reformatted and compacted flags code.
This commit is contained in:
parent
db9a497910
commit
b3db79d874
|
@ -24,6 +24,9 @@
|
||||||
History
|
History
|
||||||
|
|
||||||
$Log: not supported by cvs2svn $
|
$Log: not supported by cvs2svn $
|
||||||
|
Revision 1.4 2005/11/16 22:59:35 cignoni
|
||||||
|
Standardized name of flags. It is plural becouse each simplex has many flag.
|
||||||
|
|
||||||
Revision 1.3 2005/11/12 18:36:51 cignoni
|
Revision 1.3 2005/11/12 18:36:51 cignoni
|
||||||
Added 'Visited' flag functions
|
Added 'Visited' flag functions
|
||||||
|
|
||||||
|
@ -144,49 +147,33 @@ class VertexArityMax: public G<VertexArity6<BVT,BET,BFT,BTT, A, B, C, D, E, F> >
|
||||||
|
|
||||||
// ----- Flags stuff -----
|
// ----- Flags stuff -----
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
const int Flags() const { return 0; }
|
||||||
|
int &Flags() { static int dummyflags(0); return dummyflags; }
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
// This bit indicate that the vertex is deleted from the mesh
|
|
||||||
DELETED = 0x0001, // cancellato
|
DELETED = 0x0001, // This bit indicate that the vertex is deleted from the mesh
|
||||||
// This bit indicate that the vertex of the mesh is not readable
|
NOTREAD = 0x0002, // This bit indicate that the vertex of the mesh is not readable
|
||||||
NOTREAD = 0x0002, // non leggibile (ma forse modificabile)
|
NOTWRITE = 0x0004, // This bit indicate that the vertex is not modifiable
|
||||||
// This bit indicate that the vertex is not modifiable
|
MODIFIED = 0x0008, // This bit indicate that the vertex is modified
|
||||||
NOTWRITE = 0x0004, // non modificabile (ma forse leggibile)
|
VISITED = 0x0010, // This bit can be used to mark the visited vertex
|
||||||
// This bit indicate that the vertex is modified
|
SELECTED = 0x0020, // This bit can be used to select
|
||||||
MODIFIED = 0x0008, // modificato
|
BORDER = 0x0100, // Border Flag
|
||||||
// This bit can be used to mark the visited vertex
|
USER0 = 0x0200 // First user bit
|
||||||
VISITED = 0x0010, // Visited
|
|
||||||
// This bit can be used to select
|
|
||||||
SELECTED = 0x0020, // Selection flag
|
|
||||||
// Border Flag
|
|
||||||
BORDER = 0x0100,
|
|
||||||
// First user bit
|
|
||||||
USER0 = 0x0200 // Fisrt user bit
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
inline int & UberFlags () { return Flags(); }
|
||||||
|
inline const int UberFlags() const { return Flags(); }
|
||||||
|
|
||||||
inline int & UberFlags ()
|
bool IsD() const {return (Flags() & DELETED) != 0;} /// checks if the vertex is deleted
|
||||||
{
|
bool IsR() const {return (Flags() & NOTREAD) == 0;} /// checks if the vertex is readable
|
||||||
return Flags();
|
bool IsW() const {return (Flags() & NOTWRITE)== 0;}/// checks if the vertex is modifiable
|
||||||
}
|
bool IsRW() const {return (Flags() & (NOTREAD | NOTWRITE)) == 0;}/// This funcion checks whether the vertex is both readable and modifiable
|
||||||
inline const int UberFlags() const
|
bool IsS() const {return (Flags() & SELECTED) != 0;}/// checks if the vertex is Selected
|
||||||
{
|
bool IsB() const {return (Flags() & BORDER) != 0;}/// checks if the vertex is a border one
|
||||||
return Flags();
|
bool IsV() const {return (Flags() & VISITED) != 0;}/// checks if the vertex Has been visited
|
||||||
}
|
|
||||||
|
|
||||||
/// checks if the vertex is deleted
|
|
||||||
bool IsD() const {return (Flags() & DELETED) != 0;}
|
|
||||||
/// checks if the vertex is readable
|
|
||||||
bool IsR() const {return (Flags() & NOTREAD) == 0;}
|
|
||||||
/// checks if the vertex is modifiable
|
|
||||||
bool IsW() const {return (Flags() & NOTWRITE)== 0;}
|
|
||||||
/// This funcion checks whether the vertex is both readable and modifiable
|
|
||||||
bool IsRW() const {return (Flags() & (NOTREAD | NOTWRITE)) == 0;}
|
|
||||||
/// checks if the vertex is Selected
|
|
||||||
bool IsS() const {return (Flags() & SELECTED) != 0;}
|
|
||||||
/// checks if the vertex is a border one
|
|
||||||
bool IsB() const {return (Flags() & BORDER) != 0;}
|
|
||||||
/// checks if the vertex Has been visited
|
|
||||||
bool IsV() const {return (Flags() & VISITED) != 0;}
|
|
||||||
|
|
||||||
/** Set the flag value
|
/** Set the flag value
|
||||||
@param flagp Valore da inserire nel flag
|
@param flagp Valore da inserire nel flag
|
||||||
|
@ -197,23 +184,14 @@ public:
|
||||||
@param flagp Valore da inserire nel flag
|
@param flagp Valore da inserire nel flag
|
||||||
*/
|
*/
|
||||||
void ClearFlags() {Flags()=0;}
|
void ClearFlags() {Flags()=0;}
|
||||||
|
void SetD() {Flags() |=DELETED;}/// deletes the vertex from the mesh
|
||||||
/// deletes the vertex from the mesh
|
void ClearD() {Flags() &=(~DELETED);}/// un-delete a vertex
|
||||||
void SetD() {Flags() |=DELETED;}
|
void SetR() {Flags() &=(~NOTREAD);}/// marks the vertex as readable
|
||||||
/// un-delete a vertex
|
void ClearR() {Flags() |=NOTREAD;}/// marks the vertex as not readable
|
||||||
void ClearD() {Flags() &=(~DELETED);}
|
void ClearW() {Flags() |=NOTWRITE;}/// marks the vertex as writable
|
||||||
/// marks the vertex as readable
|
void SetW() {Flags() &=(~NOTWRITE);}/// marks the vertex as not writable
|
||||||
void SetR() {Flags() &=(~NOTREAD);}
|
void SetS() {Flags() |=SELECTED;}/// select the vertex
|
||||||
/// marks the vertex as not readable
|
void ClearS() {Flags() &= ~SELECTED;}/// Un-select a vertex
|
||||||
void ClearR() {Flags() |=NOTREAD;}
|
|
||||||
/// marks the vertex as writable
|
|
||||||
void ClearW() {Flags() |=NOTWRITE;}
|
|
||||||
/// marks the vertex as not writable
|
|
||||||
void SetW() {Flags() &=(~NOTWRITE);}
|
|
||||||
/// select the vertex
|
|
||||||
void SetS() {Flags() |=SELECTED;}
|
|
||||||
/// Un-select a vertex
|
|
||||||
void ClearS() {Flags() &= ~SELECTED;}
|
|
||||||
void SetB() {Flags() |=BORDER;}
|
void SetB() {Flags() |=BORDER;}
|
||||||
void ClearB() {Flags() &=~BORDER;}
|
void ClearB() {Flags() &=~BORDER;}
|
||||||
void SetV() {Flags() |=VISITED;}
|
void SetV() {Flags() |=VISITED;}
|
||||||
|
|
Loading…
Reference in New Issue