Important Change: ** LastBitFlag ** now is named ** FirstUnusedBitFlag **
Corrected the name of the function allocating a user bit among the flags of the simplexes. Changed in ALL the simplexes (vertex, edge, face, etc) and updating functions. Note that the LastBitFlag should never be used by common users...
This commit is contained in:
parent
36d9030955
commit
45b0deb7eb
|
@ -245,7 +245,7 @@ static void FaceBorderFromVF(MeshType &m)
|
||||||
vfi.f->Flags() |= BORDERFLAG[(vfi.z+2)%3];
|
vfi.f->Flags() |= BORDERFLAG[(vfi.z+2)%3];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
VertexType::DeleteBitFlag(VertexType::LastBitFlag());
|
VertexType::DeleteBitFlag(visitedBit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -141,33 +141,39 @@ public:
|
||||||
void SetV() {this->Flags() |=VISITED;}
|
void SetV() {this->Flags() |=VISITED;}
|
||||||
void ClearV() {this->Flags() &=~VISITED;}
|
void ClearV() {this->Flags() &=~VISITED;}
|
||||||
|
|
||||||
/// Return the first bit that is not still used
|
/// Return the first bit that is not still used
|
||||||
static int &LastBitFlag()
|
static int &FirstUnusedBitFlag()
|
||||||
{
|
{
|
||||||
static int b =USER0;
|
static int b =USER0;
|
||||||
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. It updates the FirstUnusedBitFlag.
|
||||||
static inline int NewBitFlag()
|
static inline int NewBitFlag()
|
||||||
{
|
{
|
||||||
LastBitFlag()=LastBitFlag()<<1;
|
int bitForTheUser = FirstUnusedBitFlag();
|
||||||
return LastBitFlag();
|
FirstUnusedBitFlag()=FirstUnusedBitFlag()<<1;
|
||||||
|
return bitForTheUser;
|
||||||
}
|
}
|
||||||
// de-allocate a bit among the flags that can be used by user.
|
|
||||||
static inline bool DeleteBitFlag(int bitval)
|
/// De-allocate a pre allocated bit. It updates the FirstUnusedBitFlag.
|
||||||
|
// Note you must deallocate bit in the inverse order of the allocation (as in a stack)
|
||||||
|
static inline bool DeleteBitFlag(int bitval)
|
||||||
{
|
{
|
||||||
if(LastBitFlag()==bitval) {
|
if(FirstUnusedBitFlag()>>1==bitval) {
|
||||||
LastBitFlag()= LastBitFlag()>>1;
|
FirstUnusedBitFlag() = FirstUnusedBitFlag()>>1;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
assert(0);
|
assert(0);
|
||||||
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 (this->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){this->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){this->Flags() &= (~userBit);}
|
void ClearUserBit(int userBit){this->Flags() &= (~userBit);}
|
||||||
|
|
||||||
|
|
|
@ -143,33 +143,39 @@ public:
|
||||||
void SetV() {this->Flags() |=VISITED;}
|
void SetV() {this->Flags() |=VISITED;}
|
||||||
void ClearV() {this->Flags() &=~VISITED;}
|
void ClearV() {this->Flags() &=~VISITED;}
|
||||||
|
|
||||||
/// Return the first bit that is not still used
|
/// Return the first bit that is not still used
|
||||||
static int &LastBitFlag()
|
static int &FirstUnusedBitFlag()
|
||||||
{
|
{
|
||||||
static int b =USER0;
|
static int b =USER0;
|
||||||
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. It updates the FirstUnusedBitFlag.
|
||||||
static inline int NewBitFlag()
|
static inline int NewBitFlag()
|
||||||
{
|
{
|
||||||
LastBitFlag()=LastBitFlag()<<1;
|
int bitForTheUser = FirstUnusedBitFlag();
|
||||||
return LastBitFlag();
|
FirstUnusedBitFlag()=FirstUnusedBitFlag()<<1;
|
||||||
|
return bitForTheUser;
|
||||||
}
|
}
|
||||||
// de-allocate a bit among the flags that can be used by user.
|
|
||||||
static inline bool DeleteBitFlag(int bitval)
|
/// De-allocate a pre allocated bit. It updates the FirstUnusedBitFlag.
|
||||||
|
// Note you must deallocate bit in the inverse order of the allocation (as in a stack)
|
||||||
|
static inline bool DeleteBitFlag(int bitval)
|
||||||
{
|
{
|
||||||
if(LastBitFlag()==bitval) {
|
if(FirstUnusedBitFlag()>>1==bitval) {
|
||||||
LastBitFlag()= LastBitFlag()>>1;
|
FirstUnusedBitFlag() = FirstUnusedBitFlag()>>1;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
assert(0);
|
assert(0);
|
||||||
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 (this->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){this->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){this->Flags() &= (~userBit);}
|
void ClearUserBit(int userBit){this->Flags() &= (~userBit);}
|
||||||
|
|
||||||
|
|
|
@ -206,33 +206,39 @@ public:
|
||||||
void ClearF(int i) {this->Flags() &= (~(FAUX0<<i));}
|
void ClearF(int i) {this->Flags() &= (~(FAUX0<<i));}
|
||||||
void ClearAllF() { this->Flags() &= (~(FAUX0|FAUX1|FAUX2)); }
|
void ClearAllF() { this->Flags() &= (~(FAUX0|FAUX1|FAUX2)); }
|
||||||
|
|
||||||
/// Return the first bit that is not still used
|
/// Return the first bit that is not still used
|
||||||
static int &LastBitFlag()
|
static int &FirstUnusedBitFlag()
|
||||||
{
|
{
|
||||||
static int b =USER0;
|
static int b =USER0;
|
||||||
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. It updates the FirstUnusedBitFlag.
|
||||||
static inline int NewBitFlag()
|
static inline int NewBitFlag()
|
||||||
{
|
{
|
||||||
LastBitFlag()=LastBitFlag()<<1;
|
int bitForTheUser = FirstUnusedBitFlag();
|
||||||
return LastBitFlag();
|
FirstUnusedBitFlag()=FirstUnusedBitFlag()<<1;
|
||||||
|
return bitForTheUser;
|
||||||
}
|
}
|
||||||
// de-allocate a bit among the flags that can be used by user.
|
|
||||||
|
/// De-allocate a pre allocated bit. It updates the FirstUnusedBitFlag.
|
||||||
|
// Note you must deallocate bit in the inverse order of the allocation (as in a stack)
|
||||||
static inline bool DeleteBitFlag(int bitval)
|
static inline bool DeleteBitFlag(int bitval)
|
||||||
{
|
{
|
||||||
if(LastBitFlag()==bitval) {
|
if(FirstUnusedBitFlag()>>1==bitval) {
|
||||||
LastBitFlag()= LastBitFlag()>>1;
|
FirstUnusedBitFlag() = FirstUnusedBitFlag()>>1;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
assert(0);
|
assert(0);
|
||||||
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 (this->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){this->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){this->Flags() &= (~userBit);}
|
void ClearUserBit(int userBit){this->Flags() &= (~userBit);}
|
||||||
|
|
||||||
|
|
|
@ -232,33 +232,39 @@ public:
|
||||||
/// This funcion execute the inverse operation of SetS()
|
/// This funcion execute the inverse operation of SetS()
|
||||||
void ClearB(int i) {this->Flags() &= (~(BORDER0<<i));}
|
void ClearB(int i) {this->Flags() &= (~(BORDER0<<i));}
|
||||||
|
|
||||||
/// Return the first bit that is not still used
|
/// Return the first bit that is not still used
|
||||||
static int &LastBitFlag()
|
static int &FirstUnusedBitFlag()
|
||||||
{
|
{
|
||||||
static int b =USER0;
|
static int b =USER0;
|
||||||
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. It updates the FirstUnusedBitFlag.
|
||||||
static inline int NewBitFlag()
|
static inline int NewBitFlag()
|
||||||
{
|
{
|
||||||
LastBitFlag()=LastBitFlag()<<1;
|
int bitForTheUser = FirstUnusedBitFlag();
|
||||||
return LastBitFlag();
|
FirstUnusedBitFlag()=FirstUnusedBitFlag()<<1;
|
||||||
|
return bitForTheUser;
|
||||||
}
|
}
|
||||||
// de-allocate a bit among the flags that can be used by user.
|
|
||||||
|
/// De-allocate a pre allocated bit. It updates the FirstUnusedBitFlag.
|
||||||
|
// Note you must deallocate bit in the inverse order of the allocation (as in a stack)
|
||||||
static inline bool DeleteBitFlag(int bitval)
|
static inline bool DeleteBitFlag(int bitval)
|
||||||
{
|
{
|
||||||
if(LastBitFlag()==bitval) {
|
if(FirstUnusedBitFlag()>>1==bitval) {
|
||||||
LastBitFlag()= LastBitFlag()>>1;
|
FirstUnusedBitFlag() = FirstUnusedBitFlag()>>1;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
assert(0);
|
assert(0);
|
||||||
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 (this->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){this->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){this->Flags() &= (~userBit);}
|
void ClearUserBit(int userBit){this->Flags() &= (~userBit);}
|
||||||
|
|
||||||
|
|
|
@ -190,33 +190,39 @@ public:
|
||||||
void SetV() {this->Flags() |=VISITED;}
|
void SetV() {this->Flags() |=VISITED;}
|
||||||
void ClearV() {this->Flags() &=~VISITED;}
|
void ClearV() {this->Flags() &=~VISITED;}
|
||||||
|
|
||||||
/// Return the first bit that is not still used
|
/// Return the first bit that is not still used
|
||||||
static int &LastBitFlag()
|
static int &FirstUnusedBitFlag()
|
||||||
{
|
{
|
||||||
static int b =USER0;
|
static int b =USER0;
|
||||||
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. It updates the FirstUnusedBitFlag.
|
||||||
static inline int NewBitFlag()
|
static inline int NewBitFlag()
|
||||||
{
|
{
|
||||||
LastBitFlag()=LastBitFlag()<<1;
|
int bitForTheUser = FirstUnusedBitFlag();
|
||||||
return LastBitFlag();
|
FirstUnusedBitFlag()=FirstUnusedBitFlag()<<1;
|
||||||
|
return bitForTheUser;
|
||||||
}
|
}
|
||||||
// de-allocate a bit among the flags that can be used by user.
|
|
||||||
static inline bool DeleteBitFlag(int bitval)
|
/// De-allocate a pre allocated bit. It updates the FirstUnusedBitFlag.
|
||||||
|
// Note you must deallocate bit in the inverse order of the allocation (as in a stack)
|
||||||
|
static inline bool DeleteBitFlag(int bitval)
|
||||||
{
|
{
|
||||||
if(LastBitFlag()==bitval) {
|
if(FirstUnusedBitFlag()>>1==bitval) {
|
||||||
LastBitFlag()= LastBitFlag()>>1;
|
FirstUnusedBitFlag() = FirstUnusedBitFlag()>>1;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
assert(0);
|
assert(0);
|
||||||
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 (this->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){this->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){this->Flags() &= (~userBit);}
|
void ClearUserBit(int userBit){this->Flags() &= (~userBit);}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue