22#define WEM_TRAVERSED_BIT 16
54 return ((_bitFlag & (1U <<
bit)) != 0);
59 _bitFlag |= (1U <<
bit);
64 _bitFlag &= (~(1U <<
bit));
86 return (_heapPosition != -1);
91 _heapPosition = heapPosition;
#define WEM_TRAVERSED_BIT
Traversed bit.
This is the base class for the WEM elements nodes, edges, and faces.
WEMPrimitive(WEMPrimitive &&p) noexcept
int getHeapPosition() const
Returns the heap position.
double _heapValue
Element value, used for heap sorting.
int _entryNumber
Entry number in index vector, for easy deletion and reference.
int getEntryNumber() const
Returns the entry number.
void setFlag(unsigned int bit)
Sets the given bit-flag.
void setTraversed(bool traversed)
Sets the traversed flag.
int _heapPosition
Heap position, same like entryNumber but for heaps.
void resetPrimitive()
Resets the object to its default constructed state.
bool isTraversed() const
Returns whether this primitive has been traversed.
virtual ~WEMPrimitive()=default
Standard destructor.
void setHeapPosition(int heapPosition)
Sets the heap position.
unsigned int _bitFlag
Bit-wise flag for custom use.
void setHeapValue(double heapValue)
Sets the heap value.
WEMPrimitive & operator=(WEMPrimitive &&p) noexcept
void clearFlag()
Clears the bit-flag.
void setEntryNumber(int e)
Sets the entry number.
void unsetFlag(unsigned int bit)
Unsets the given bit-flag.
WEMPrimitive & operator=(const WEMPrimitive &)=default
double getHeapValue() const
Returns the heap value.
bool inHeap() const
Returns whether this primitive is in the heap.
bool isSet(unsigned int bit) const
Returns whether the bit-flag is set.
WEMPrimitive(const WEMPrimitive &)=default
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
static bool less(const WEMPrimitive &x, const WEMPrimitive &y)