diff --git a/vcg/simplex/face/base.h b/vcg/simplex/face/base.h index 05565f78..01d1b171 100644 --- a/vcg/simplex/face/base.h +++ b/vcg/simplex/face/base.h @@ -124,17 +124,17 @@ public: /// checks if the Face is deleted - bool IsD() const {return (this->Flags() & DELETED) != 0;} + bool IsD() const {return (this->cFlags() & DELETED) != 0;} /// checks if the Face is readable - bool IsR() const {return (this->Flags() & NOTREAD) == 0;} + bool IsR() const {return (this->cFlags() & NOTREAD) == 0;} /// checks if the Face is modifiable - bool IsW() const {return (this->Flags() & NOTWRITE)== 0;} + bool IsW() const {return (this->cFlags() & NOTWRITE)== 0;} /// This funcion checks whether the Face is both readable and modifiable - bool IsRW() const {return (this->Flags() & (NOTREAD | NOTWRITE)) == 0;} + bool IsRW() const {return (this->cFlags() & (NOTREAD | NOTWRITE)) == 0;} /// checks if the Face is Modified - bool IsS() const {return (this->Flags() & SELECTED) != 0;} + bool IsS() const {return (this->cFlags() & SELECTED) != 0;} /// checks if the Face is Modified - bool IsV() const {return (this->Flags() & VISITED) != 0;} + bool IsV() const {return (this->cFlags() & VISITED) != 0;} /** Set the flag value @param flagp Valore da inserire nel flag @@ -168,14 +168,14 @@ public: void ClearV() {this->Flags() &= ~VISITED;} /// This function checks if the face is selected - bool IsB(int i) const {return (this->Flags() & (BORDER0<cFlags() & (BORDER0<Flags() |=(BORDER0<Flags() &= (~(BORDER0<Flags() & (CREASE0<cFlags() & (CREASE0<Flags() |=(CREASE0<Flags() & (FAUX0<Flags() & (FAUX0|FAUX1|FAUX2)) != 0;} + bool IsF(int i) const {return (this->cFlags() & (FAUX0<cFlags() & (FAUX0|FAUX1|FAUX2)) != 0;} /// This function select the face void SetF(int i) {this->Flags() |=(FAUX0< & name){name.push_back(std::st }; /*------------------------- BitFlags -----------------------------------------*/ +/*! \brief \em Component: Per face \b Flags + +This component stores a 32 bit array of bit flags. These bit flags are used for keeping track of selection, deletion, visiting etc. \sa \ref flags for more details on common uses of flags. +*/ template class BitFlags: public T { public: BitFlags(){_flags=0;} - int &Flags() {return _flags; } - int Flags() const {return _flags; } - const int & cFlags() const {return _flags; } - template - void ImportData(const RightF & rightF){ Flags() = rightF.cFlags();T::ImportData(rightF);} - inline void Alloc(const int & ns){T::Alloc(ns);} - inline void Dealloc(){T::Dealloc();} + int &Flags() {return _flags; } + int cFlags() const {return _flags; } + template + void ImportData(const RightF & rightF){ Flags() = rightF.cFlags();T::ImportData(rightF);} + inline void Alloc(const int & ns){T::Alloc(ns);} + inline void Dealloc(){T::Dealloc();} static bool HasFlags() { return true; } static void Name(std::vector & name){name.push_back(std::string("BitFlags"));T::Name(name);} - private: int _flags; }; diff --git a/vcg/simplex/vertex/component.h b/vcg/simplex/vertex/component.h index fedf4684..507902b7 100644 --- a/vcg/simplex/vertex/component.h +++ b/vcg/simplex/vertex/component.h @@ -47,7 +47,7 @@ template class EmptyCore: public TT { public: typedef int FlagType; int &Flags() { static int dummyflags(0); assert(0); return dummyflags; } - int cFlags() const { return 0; } + int cFlags() const { assert(0); return 0; } static bool HasFlags() { return false; } typedef vcg::Point3f CoordType; @@ -281,9 +281,9 @@ public: BitFlags(){_flags=0;} typedef int FlagType; int &Flags() {return _flags; } - int Flags() const {return _flags; } - template < class LeftV> - void ImportData(const LeftV & left ) { if(LeftV::HasFlags()) Flags() = left.Flags(); T::ImportData( left); } + int cFlags() const {return _flags; } + template < class LeftV> + void ImportData(const LeftV & left ) { if(LeftV::HasFlags()) Flags() = left.cFlags(); T::ImportData( left); } static bool HasFlags() { return true; } static void Name(std::vector & name){name.push_back(std::string("BitFlags"));T::Name(name);}