MeVisLab Toolbox Reference
ml::WEMPolygon Class Reference

Defines the mesh component: polygon. More...

#include <WEMPolygon.h>

Inheritance diagram for ml::WEMPolygon:
ml::WEMFace ml::WEMPrimitive

Public Member Functions

 WEMPolygon ()
 Standard constructor.
 
 WEMPolygon (const WEMPolygon &p)
 Standard copy constructor.
 
 ~WEMPolygon () override
 Standard destructor.
 
void clone (WEMPolygon *polygon)
 Clones given triangle.
 
void computeNormal () override
 Computes the normal.
 
unsigned int getNumNodes () const override
 Returns the number of nodes.
 
virtual void setNumNodes (unsigned int numNodes)
 Sets the number of nodes.
 
int getIndex (WEMNode *node) const override
 Returns the index of the given node.
 
WEMNodegetNodeAt (unsigned int index) override
 Returns the node at the given index in the face.
 
const WEMNodegetNodeAt (unsigned int index) const override
 Returns the node at the given index in the face.
 
void setNode (unsigned int index, WEMNode *node) override
 Sets the given node to the given index in face.
 
void replace (WEMNode *orig, WEMNode *replacement) override
 Replaces the given orig node by the given replace node.
 
bool contains (WEMNode *node) const override
 Returns whether this face contains the given node.
 
virtual void addNode (WEMNode *node)
 Adds the given node (dynamic).
 
Vector3 getNodePositionAt (unsigned int index) const override
 Returns the world position of a node at the given index.
 
int getIndex (WEMEdge *edge) const override
 Returns the index of the given edge.
 
WEMEdgegetEdgeAt (unsigned int index) override
 Returns the edge at the given index in this face.
 
const WEMEdgegetEdgeAt (unsigned int index) const override
 Returns the edge at the given index in this face.
 
void setEdge (unsigned int index, WEMEdge *edge) override
 Sets the given edge to the given index in this face.
 
void replace (WEMEdge *orig, WEMEdge *replacement) override
 Replaces the given orig node by the given replace edge.
 
bool contains (WEMEdge *edge) const override
 Returns whether this face contains the given edge.
 
void removeEdges () override
 Removes all edge pointers of this face.
 
Vector3 getCentroid () const override
 Returns the geometric centroid of this face.
 
void getCentroid (Vector3 &centroid) const override
 
double getPerimeter () const override
 Calculates the perimeter of this face.
 
double getArea () const override
 Calculates the area of this face.
 
WEMNodegetOther (WEMNode *, WEMNode *) override
 Returns the node incident to this face that is not given as a parameter.
 
const WEMNodegetOther (WEMNode *, WEMNode *) const override
 Returns the node incident to this face that is not given as a parameter.
 
WEMEdgegetOther (WEMEdge *, WEMEdge *) override
 Returns the edge incident to this face that is not given as a parameter.
 
const WEMEdgegetOther (WEMEdge *, WEMEdge *) const override
 Returns the edge incident to this face that is not given as a parameter.
 
WEMEdgegetEdgeNotContaining (WEMNode *) override
 Returns the edge not containing given node.
 
const WEMEdgegetEdgeNotContaining (WEMNode *) const override
 Returns the edge not containing given node.
 
double getQuality () const override
 Calculates the quality of this face.
 
int isConcave () const override
 Checks whether this face is concave and returns the number of concavities.
 
void mirror () override
 Mirrors this face.
 
- Public Member Functions inherited from ml::WEMFace
 WEMFace ()
 Standard constructor.
 
 WEMFace (const WEMFace &f)
 Standard copy constructor.
 
 WEMFace (WEMFace &&f) noexcept
 
WEMFaceoperator= (WEMFace &&f) noexcept
 
 ~WEMFace () override
 Standard destructor.
 
void reset ()
 Resets the object to default constructed state.
 
void clone (WEMFace *face)
 Clones given face.
 
Vector3 getNormal () const
 Returns the normal.
 
void setNormal (const Vector3 &normal)
 Sets the normal.
 
virtual WEMBoundingBox getBoundingBox ()
 Calculates the bounding box of face.
 
bool isBoundingBoxValid () const
 
void invalidateBoundingBox ()
 
- Public Member Functions inherited from ml::WEMPrimitive
 WEMPrimitive ()
 
 WEMPrimitive (const WEMPrimitive &)=default
 
 WEMPrimitive (WEMPrimitive &&p) noexcept
 
WEMPrimitiveoperator= (const WEMPrimitive &)=default
 
WEMPrimitiveoperator= (WEMPrimitive &&p) noexcept
 
virtual ~WEMPrimitive ()=default
 Standard destructor.
 
void resetPrimitive ()
 Resets the object to its default constructed state.
 
int getEntryNumber () const
 Returns the entry number.
 
void setEntryNumber (int e)
 Sets the entry number.
 
bool isSet (unsigned int bit) const
 Returns whether the bit-flag is set.
 
void setFlag (unsigned int bit)
 Sets the given bit-flag.
 
void unsetFlag (unsigned int bit)
 Unsets the given bit-flag.
 
void clearFlag ()
 Clears the bit-flag.
 
bool isTraversed () const
 Returns whether this primitive has been traversed.
 
void setTraversed (bool traversed)
 Sets the traversed flag.
 
int getHeapPosition () const
 Returns the heap position.
 
bool inHeap () const
 Returns whether this primitive is in the heap.
 
void setHeapPosition (int heapPosition)
 Sets the heap position.
 
double getHeapValue () const
 Returns the heap value.
 
void setHeapValue (double heapValue)
 Sets the heap value.
 

Additional Inherited Members

- Protected Attributes inherited from ml::WEMFace
Vector3 _normal
 Normal.
 
WEMBoundingBox _boundingBox
 Bounding Box.
 
bool _isBoundingBoxValid
 Is the bounding box valid?
 
- Protected Attributes inherited from ml::WEMPrimitive
unsigned int _bitFlag
 Bit-wise flag for custom use.
 
int _entryNumber
 Entry number in index vector, for easy deletion and reference.
 
int _heapPosition
 Heap position, same like entryNumber but for heaps.
 
double _heapValue
 Element value, used for heap sorting.
 

Detailed Description

Defines the mesh component: polygon.

Definition at line 21 of file WEMPolygon.h.

Constructor & Destructor Documentation

◆ WEMPolygon() [1/2]

ml::WEMPolygon::WEMPolygon ( )

Standard constructor.

◆ WEMPolygon() [2/2]

ml::WEMPolygon::WEMPolygon ( const WEMPolygon & p)

Standard copy constructor.

◆ ~WEMPolygon()

ml::WEMPolygon::~WEMPolygon ( )
override

Standard destructor.

Member Function Documentation

◆ addNode()

virtual void ml::WEMPolygon::addNode ( WEMNode * node)
inlinevirtual

Adds the given node (dynamic).

Definition at line 54 of file WEMPolygon.h.

References ml::WEMFace::invalidateBoundingBox().

◆ clone()

void ml::WEMPolygon::clone ( WEMPolygon * polygon)

Clones given triangle.

◆ computeNormal()

void ml::WEMPolygon::computeNormal ( )
overridevirtual

Computes the normal.

Implements ml::WEMFace.

◆ contains() [1/2]

bool ml::WEMPolygon::contains ( WEMEdge * edge) const
overridevirtual

Returns whether this face contains the given edge.

Implements ml::WEMFace.

◆ contains() [2/2]

bool ml::WEMPolygon::contains ( WEMNode * node) const
overridevirtual

Returns whether this face contains the given node.

Implements ml::WEMFace.

◆ getArea()

double ml::WEMPolygon::getArea ( ) const
overridevirtual

Calculates the area of this face.

Implements ml::WEMFace.

◆ getCentroid() [1/2]

Vector3 ml::WEMPolygon::getCentroid ( ) const
overridevirtual

Returns the geometric centroid of this face.

Implements ml::WEMFace.

◆ getCentroid() [2/2]

void ml::WEMPolygon::getCentroid ( Vector3 & centroid) const
overridevirtual

Implements ml::WEMFace.

◆ getEdgeAt() [1/2]

const WEMEdge * ml::WEMPolygon::getEdgeAt ( unsigned int index) const
inlineoverridevirtual

Returns the edge at the given index in this face.

Reimplemented from ml::WEMFace.

Definition at line 63 of file WEMPolygon.h.

References getEdgeAt().

Referenced by getEdgeAt().

◆ getEdgeAt() [2/2]

WEMEdge * ml::WEMPolygon::getEdgeAt ( unsigned int index)
inlineoverridevirtual

Returns the edge at the given index in this face.

Reimplemented from ml::WEMFace.

Definition at line 61 of file WEMPolygon.h.

◆ getEdgeNotContaining() [1/2]

const WEMEdge * ml::WEMPolygon::getEdgeNotContaining ( WEMNode * ) const
inlineoverridevirtual

Returns the edge not containing given node.

Implements ml::WEMFace.

Definition at line 91 of file WEMPolygon.h.

◆ getEdgeNotContaining() [2/2]

WEMEdge * ml::WEMPolygon::getEdgeNotContaining ( WEMNode * )
inlineoverridevirtual

Returns the edge not containing given node.

Implements ml::WEMFace.

Definition at line 89 of file WEMPolygon.h.

◆ getIndex() [1/2]

int ml::WEMPolygon::getIndex ( WEMEdge * edge) const
overridevirtual

Returns the index of the given edge.

Implements ml::WEMFace.

◆ getIndex() [2/2]

int ml::WEMPolygon::getIndex ( WEMNode * node) const
overridevirtual

Returns the index of the given node.

Implements ml::WEMFace.

◆ getNodeAt() [1/2]

const WEMNode * ml::WEMPolygon::getNodeAt ( unsigned int index) const
inlineoverridevirtual

Returns the node at the given index in the face.

Implements ml::WEMFace.

Definition at line 45 of file WEMPolygon.h.

References getNodeAt().

Referenced by getNodeAt().

◆ getNodeAt() [2/2]

WEMNode * ml::WEMPolygon::getNodeAt ( unsigned int index)
inlineoverridevirtual

Returns the node at the given index in the face.

Implements ml::WEMFace.

Definition at line 43 of file WEMPolygon.h.

◆ getNodePositionAt()

Vector3 ml::WEMPolygon::getNodePositionAt ( unsigned int index) const
inlineoverridevirtual

Returns the world position of a node at the given index.

Implements ml::WEMFace.

Definition at line 56 of file WEMPolygon.h.

◆ getNumNodes()

unsigned int ml::WEMPolygon::getNumNodes ( ) const
inlineoverridevirtual

Returns the number of nodes.

Implements ml::WEMFace.

Definition at line 37 of file WEMPolygon.h.

◆ getOther() [1/4]

const WEMEdge * ml::WEMPolygon::getOther ( WEMEdge * ,
WEMEdge *  ) const
inlineoverridevirtual

Returns the edge incident to this face that is not given as a parameter.

Implements ml::WEMFace.

Definition at line 87 of file WEMPolygon.h.

◆ getOther() [2/4]

WEMEdge * ml::WEMPolygon::getOther ( WEMEdge * ,
WEMEdge *  )
inlineoverridevirtual

Returns the edge incident to this face that is not given as a parameter.

Implements ml::WEMFace.

Definition at line 85 of file WEMPolygon.h.

◆ getOther() [3/4]

const WEMNode * ml::WEMPolygon::getOther ( WEMNode * ,
WEMNode *  ) const
inlineoverridevirtual

Returns the node incident to this face that is not given as a parameter.

Implements ml::WEMFace.

Definition at line 83 of file WEMPolygon.h.

◆ getOther() [4/4]

WEMNode * ml::WEMPolygon::getOther ( WEMNode * ,
WEMNode *  )
inlineoverridevirtual

Returns the node incident to this face that is not given as a parameter.

Implements ml::WEMFace.

Definition at line 81 of file WEMPolygon.h.

◆ getPerimeter()

double ml::WEMPolygon::getPerimeter ( ) const
overridevirtual

Calculates the perimeter of this face.

Implements ml::WEMFace.

◆ getQuality()

double ml::WEMPolygon::getQuality ( ) const
overridevirtual

Calculates the quality of this face.

The quality of a triangle is defined as the ratio of the square root of its surface area to its perimeter relative to this same ratio for an equilateral triangle with the same area. The quality is then one for an equilateral triangle and tends to zero for a very stretched triangle.

Implements ml::WEMFace.

◆ isConcave()

int ml::WEMPolygon::isConcave ( ) const
overridevirtual

Checks whether this face is concave and returns the number of concavities.

Implements ml::WEMFace.

◆ mirror()

void ml::WEMPolygon::mirror ( )
overridevirtual

Mirrors this face.

Note that the edge information gets corrupted! Use WEM::buildEdgeConnectivity afterwards!

Implements ml::WEMFace.

◆ removeEdges()

void ml::WEMPolygon::removeEdges ( )
overridevirtual

Removes all edge pointers of this face.

Implements ml::WEMFace.

◆ replace() [1/2]

void ml::WEMPolygon::replace ( WEMEdge * orig,
WEMEdge * replacement )
overridevirtual

Replaces the given orig node by the given replace edge.

Implements ml::WEMFace.

◆ replace() [2/2]

void ml::WEMPolygon::replace ( WEMNode * orig,
WEMNode * replacement )
overridevirtual

Replaces the given orig node by the given replace node.

Implements ml::WEMFace.

◆ setEdge()

void ml::WEMPolygon::setEdge ( unsigned int index,
WEMEdge * edge )
inlineoverridevirtual

Sets the given edge to the given index in this face.

Reimplemented from ml::WEMFace.

Definition at line 65 of file WEMPolygon.h.

◆ setNode()

void ml::WEMPolygon::setNode ( unsigned int index,
WEMNode * node )
inlineoverridevirtual

Sets the given node to the given index in face.

Note that the number of nodes is not changed here!

Reimplemented from ml::WEMFace.

Definition at line 48 of file WEMPolygon.h.

References ml::WEMFace::invalidateBoundingBox().

◆ setNumNodes()

virtual void ml::WEMPolygon::setNumNodes ( unsigned int numNodes)
inlinevirtual

Sets the number of nodes.

Definition at line 39 of file WEMPolygon.h.


The documentation for this class was generated from the following file: