MeVisLab Toolbox Reference
ml::WEMTriangle Class Reference

Defines the mesh component: triangle. More...

#include <WEMTriangle.h>

Inheritance diagram for ml::WEMTriangle:
ml::WEMFace ml::WEMPrimitive

Public Member Functions

 WEMTriangle ()
 Standard constructor. More...
 
 WEMTriangle (const WEMTriangle &t)
 Standard copy constructor. More...
 
 WEMTriangle (WEMTriangle &&t) noexcept
 Move constructor. More...
 
WEMTriangleoperator= (WEMTriangle &&t) noexcept
 Move assignment operator. More...
 
 ~WEMTriangle () override
 Standard destructor. More...
 
void reset ()
 Resets the object to default constructed state. More...
 
void clone (WEMTriangle *triangle)
 Clones given triangle. More...
 
void computeNormal () override
 Computes the normal. More...
 
unsigned int getNumNodes () const override
 Returns the number of nodes. More...
 
int getIndex (WEMNode *node) const override
 Returns the index of the given node. More...
 
WEMNodegetNodeAt (unsigned int index) override
 Returns the node at the given index in this face. More...
 
const WEMNodegetNodeAt (unsigned int index) const override
 Returns the node at the given index in this face. More...
 
void setNode (unsigned int index, WEMNode *node) override
 Sets the given node to the given index in this face. More...
 
virtual void setNodes (WEMNode *node1, WEMNode *node2, WEMNode *node3)
 Sets the given nodes. More...
 
void replace (WEMNode *orig, WEMNode *replacement) override
 Replaces the given orig node by the given replace node. More...
 
bool contains (WEMNode *node) const override
 Returns whether this face contains the given node. More...
 
Vector3 getNodePositionAt (unsigned int index) const override
 Returns the position of a node at the given index. More...
 
int getIndex (WEMEdge *edge) const override
 Returns the index of the given edge. More...
 
WEMEdgegetEdgeAt (unsigned int index) override
 Returns the edge at the given index in this face. More...
 
const WEMEdgegetEdgeAt (unsigned int index) const override
 Returns the edge at the given index in this face. More...
 
void setEdge (unsigned int index, WEMEdge *edge) override
 Sets the given edge to the given index in this face. More...
 
virtual void setEdges (WEMEdge *edge1, WEMEdge *edge2, WEMEdge *edge3)
 Sets the given edges. More...
 
void replace (WEMEdge *orig, WEMEdge *replacement) override
 Replaces the given orig node by the given replace edge. More...
 
bool contains (WEMEdge *edge) const override
 Returns whether this face contains the given edge. More...
 
void removeEdges () override
 Removes all edge pointers of this face. More...
 
Vector3 getCentroid () const override
 Returns the geometric centroid of this face. More...
 
void getCentroid (Vector3 &centroid) const override
 
double getPerimeter () const override
 Calculates the perimeter of this face. More...
 
double getArea () const override
 Calculates the area of this face. More...
 
WEMNodegetOther (WEMNode *n1, WEMNode *n2) override
 Returns the node incident to this face that is not given as a parameter. More...
 
const WEMNodegetOther (WEMNode *n1, WEMNode *n2) const override
 Returns the node incident to this face that is not given as a parameter. More...
 
WEMEdgegetOther (WEMEdge *e1, WEMEdge *e2) override
 Returns the edge incident to this face that is not given as a parameter. More...
 
const WEMEdgegetOther (WEMEdge *e1, WEMEdge *e2) const override
 Returns the edge incident to this face that is not given as a parameter. More...
 
WEMEdgegetEdgeNotContaining (WEMNode *n) override
 Returns the edge not containing given node. More...
 
const WEMEdgegetEdgeNotContaining (WEMNode *n) const override
 Returns the edge not containing given node. More...
 
double getQuality () const override
 Calculates the quality of the face. More...
 
int isConcave () const override
 Checks whether this face a concave polygon. Return the number of concavities. More...
 
virtual bool isFolding (WEMNode *node, const Vector3 &position) const
 Returns whether this face is folding? More...
 
virtual bool pointInTriangle (const Vector3 &position) const
 Returns whether the given point is in this triangle. More...
 
virtual bool rayIntersect (const Vector3 &origin, const Vector3 &direction) const
 Returns whether the given ray intersects this triangle? More...
 
void mirror () override
 Mirrors this face. Note that the edge information gets corrupted! Use WEM::buildEdgeConnectivity afterwards! More...
 
- Public Member Functions inherited from ml::WEMFace
 WEMFace ()
 Standard constructor. More...
 
 WEMFace (const WEMFace &f)
 Standard copy constructor. More...
 
 WEMFace (WEMFace &&f) noexcept
 
WEMFaceoperator= (WEMFace &&f) noexcept
 
 ~WEMFace () override
 Standard destructor. More...
 
void reset ()
 Resets the object to default constructed state. More...
 
void clone (WEMFace *face)
 Clones given face. More...
 
Vector3 getNormal () const
 Returns the normal. More...
 
void setNormal (const Vector3 &normal)
 Sets the normal. More...
 
virtual WEMBoundingBox getBoundingBox ()
 Calculates the bounding box of face. More...
 
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. More...
 
void resetPrimitive ()
 Resets the object to its default constructed state. More...
 
int getEntryNumber () const
 Returns the entry number. More...
 
void setEntryNumber (int e)
 Sets the entry number. More...
 
bool isSet (unsigned int bit) const
 Returns whether the bit-flag is set. More...
 
void setFlag (unsigned int bit)
 Sets the given bit-flag. More...
 
void unsetFlag (unsigned int bit)
 Unsets the given bit-flag. More...
 
void clearFlag ()
 Clears the bit-flag. More...
 
bool isTraversed () const
 Returns whether this primitive has been traversed. More...
 
void setTraversed (bool traversed)
 Sets the traversed flag. More...
 
int getHeapPosition () const
 Returns the heap position. More...
 
bool inHeap () const
 Returns whether this primitive is in the heap. More...
 
void setHeapPosition (int heapPosition)
 Sets the heap position. More...
 
double getHeapValue () const
 Returns the heap value. More...
 
void setHeapValue (double heapValue)
 Sets the heap value. More...
 

Public Attributes

std::array< WEMNode *, 3 > _nodes
 Node pointers. More...
 
std::array< WEMEdge *, 3 > _edges
 Edge pointers. More...
 

Friends

bool MLWEM_EXPORT operator== (const WEMTriangle &x, const WEMTriangle &y)
 Operator for equality. Currently only the node positions of the triangles and their orientation are compared. More...
 
bool MLWEM_EXPORT operator!= (const WEMTriangle &x, const WEMTriangle &y)
 Operator for not equality. More...
 

Additional Inherited Members

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

Detailed Description

Defines the mesh component: triangle.

Definition at line 26 of file WEMTriangle.h.

Constructor & Destructor Documentation

◆ WEMTriangle() [1/3]

ml::WEMTriangle::WEMTriangle ( )

Standard constructor.

◆ WEMTriangle() [2/3]

ml::WEMTriangle::WEMTriangle ( const WEMTriangle t)

Standard copy constructor.

◆ WEMTriangle() [3/3]

ml::WEMTriangle::WEMTriangle ( WEMTriangle &&  t)
noexcept

Move constructor.

◆ ~WEMTriangle()

ml::WEMTriangle::~WEMTriangle ( )
override

Standard destructor.

Member Function Documentation

◆ clone()

void ml::WEMTriangle::clone ( WEMTriangle triangle)

Clones given triangle.

◆ computeNormal()

void ml::WEMTriangle::computeNormal ( )
overridevirtual

Computes the normal.

Implements ml::WEMFace.

◆ contains() [1/2]

bool ml::WEMTriangle::contains ( WEMEdge edge) const
overridevirtual

Returns whether this face contains the given edge.

Implements ml::WEMFace.

◆ contains() [2/2]

bool ml::WEMTriangle::contains ( WEMNode node) const
overridevirtual

Returns whether this face contains the given node.

Implements ml::WEMFace.

◆ getArea()

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

Calculates the area of this face.

Implements ml::WEMFace.

◆ getCentroid() [1/2]

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

Returns the geometric centroid of this face.

Implements ml::WEMFace.

◆ getCentroid() [2/2]

void ml::WEMTriangle::getCentroid ( Vector3 centroid) const
overridevirtual

Implements ml::WEMFace.

◆ getEdgeAt() [1/2]

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

Returns the edge at the given index in this face.

Reimplemented from ml::WEMFace.

Definition at line 76 of file WEMTriangle.h.

References getEdgeAt().

Referenced by getEdgeAt().

◆ getEdgeAt() [2/2]

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

Returns the edge at the given index in this face.

Reimplemented from ml::WEMFace.

Definition at line 74 of file WEMTriangle.h.

◆ getEdgeNotContaining() [1/2]

const WEMEdge* ml::WEMTriangle::getEdgeNotContaining ( WEMNode n) const
inlineoverridevirtual

Returns the edge not containing given node.

Implements ml::WEMFace.

Definition at line 111 of file WEMTriangle.h.

References getEdgeNotContaining().

Referenced by getEdgeNotContaining().

◆ getEdgeNotContaining() [2/2]

WEMEdge* ml::WEMTriangle::getEdgeNotContaining ( WEMNode n)
overridevirtual

Returns the edge not containing given node.

Implements ml::WEMFace.

◆ getIndex() [1/2]

int ml::WEMTriangle::getIndex ( WEMEdge edge) const
overridevirtual

Returns the index of the given edge.

Implements ml::WEMFace.

◆ getIndex() [2/2]

int ml::WEMTriangle::getIndex ( WEMNode node) const
overridevirtual

Returns the index of the given node.

Implements ml::WEMFace.

◆ getNodeAt() [1/2]

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

Returns the node at the given index in this face.

Implements ml::WEMFace.

Definition at line 56 of file WEMTriangle.h.

References getNodeAt().

Referenced by getNodeAt().

◆ getNodeAt() [2/2]

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

Returns the node at the given index in this face.

Implements ml::WEMFace.

Definition at line 54 of file WEMTriangle.h.

◆ getNodePositionAt()

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

Returns the position of a node at the given index.

Implements ml::WEMFace.

Definition at line 69 of file WEMTriangle.h.

◆ getNumNodes()

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

Returns the number of nodes.

Implements ml::WEMFace.

Definition at line 50 of file WEMTriangle.h.

◆ getOther() [1/4]

const WEMEdge* ml::WEMTriangle::getOther ( WEMEdge e1,
WEMEdge e2 
) const
inlineoverridevirtual

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

Implements ml::WEMFace.

Definition at line 107 of file WEMTriangle.h.

References getOther().

Referenced by getOther().

◆ getOther() [2/4]

WEMEdge* ml::WEMTriangle::getOther ( WEMEdge e1,
WEMEdge e2 
)
overridevirtual

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

Implements ml::WEMFace.

◆ getOther() [3/4]

const WEMNode* ml::WEMTriangle::getOther ( WEMNode n1,
WEMNode n2 
) const
inlineoverridevirtual

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

Implements ml::WEMFace.

Definition at line 103 of file WEMTriangle.h.

References getOther().

Referenced by getOther().

◆ getOther() [4/4]

WEMNode* ml::WEMTriangle::getOther ( WEMNode n1,
WEMNode n2 
)
overridevirtual

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

Implements ml::WEMFace.

◆ getPerimeter()

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

Calculates the perimeter of this face.

Implements ml::WEMFace.

◆ getQuality()

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

Calculates the quality of the 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::WEMTriangle::isConcave ( ) const
inlineoverridevirtual

Checks whether this face a concave polygon. Return the number of concavities.

Implements ml::WEMFace.

Definition at line 120 of file WEMTriangle.h.

◆ isFolding()

virtual bool ml::WEMTriangle::isFolding ( WEMNode node,
const Vector3 position 
) const
virtual

Returns whether this face is folding?

◆ mirror()

void ml::WEMTriangle::mirror ( )
overridevirtual

Mirrors this face. Note that the edge information gets corrupted! Use WEM::buildEdgeConnectivity afterwards!

Implements ml::WEMFace.

◆ operator=()

WEMTriangle& ml::WEMTriangle::operator= ( WEMTriangle &&  t)
noexcept

Move assignment operator.

◆ pointInTriangle()

virtual bool ml::WEMTriangle::pointInTriangle ( const Vector3 position) const
virtual

Returns whether the given point is in this triangle.

◆ rayIntersect()

virtual bool ml::WEMTriangle::rayIntersect ( const Vector3 origin,
const Vector3 direction 
) const
virtual

Returns whether the given ray intersects this triangle?

◆ removeEdges()

void ml::WEMTriangle::removeEdges ( )
overridevirtual

Removes all edge pointers of this face.

Implements ml::WEMFace.

◆ replace() [1/2]

void ml::WEMTriangle::replace ( WEMEdge orig,
WEMEdge replacement 
)
overridevirtual

Replaces the given orig node by the given replace edge.

Implements ml::WEMFace.

◆ replace() [2/2]

void ml::WEMTriangle::replace ( WEMNode orig,
WEMNode replacement 
)
overridevirtual

Replaces the given orig node by the given replace node.

Implements ml::WEMFace.

◆ reset()

void ml::WEMTriangle::reset ( )

Resets the object to default constructed state.

◆ setEdge()

void ml::WEMTriangle::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 78 of file WEMTriangle.h.

References ml::WEMFace::invalidateBoundingBox().

◆ setEdges()

virtual void ml::WEMTriangle::setEdges ( WEMEdge edge1,
WEMEdge edge2,
WEMEdge edge3 
)
inlinevirtual

Sets the given edges.

Definition at line 80 of file WEMTriangle.h.

References ml::WEMFace::invalidateBoundingBox().

◆ setNode()

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

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

Reimplemented from ml::WEMFace.

Definition at line 58 of file WEMTriangle.h.

References ml::WEMFace::invalidateBoundingBox().

◆ setNodes()

virtual void ml::WEMTriangle::setNodes ( WEMNode node1,
WEMNode node2,
WEMNode node3 
)
inlinevirtual

Sets the given nodes.

Definition at line 60 of file WEMTriangle.h.

References ml::WEMFace::invalidateBoundingBox().

Friends And Related Function Documentation

◆ operator!=

bool MLWEM_EXPORT operator!= ( const WEMTriangle x,
const WEMTriangle y 
)
friend

Operator for not equality.

◆ operator==

bool MLWEM_EXPORT operator== ( const WEMTriangle x,
const WEMTriangle y 
)
friend

Operator for equality. Currently only the node positions of the triangles and their orientation are compared.

Member Data Documentation

◆ _edges

std::array<WEMEdge*, 3> ml::WEMTriangle::_edges

Edge pointers.

Definition at line 141 of file WEMTriangle.h.

◆ _nodes

std::array<WEMNode*, 3> ml::WEMTriangle::_nodes

Node pointers.

Definition at line 139 of file WEMTriangle.h.


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