50 inline unsigned int getNumNodes()
const override {
return 3; }
144 void resetTriangle();
Defines the mesh component: edge.
Defines the mesh component: face.
void invalidateBoundingBox()
Defines the mesh component: node.
Defines the mesh component: triangle.
void getCentroid(Vector3 ¢roid) const override
void setEdge(unsigned int index, WEMEdge *edge) override
Sets the given edge to the given index in this face.
double getArea() const override
Calculates the area of this face.
~WEMTriangle() override
Standard destructor.
int getIndex(WEMEdge *edge) const override
Returns the index of the given edge.
WEMEdge * getEdgeNotContaining(WEMNode *n) override
Returns the edge not containing given node.
virtual void setNodes(WEMNode *node1, WEMNode *node2, WEMNode *node3)
Sets the given nodes.
void setNode(unsigned int index, WEMNode *node) override
Sets the given node to the given index in this face.
WEMEdge * getOther(WEMEdge *e1, WEMEdge *e2) override
Returns the edge incident to this face that is not given as a parameter.
WEMTriangle & operator=(WEMTriangle &&t) noexcept
Move assignment operator.
int isConcave() const override
Checks whether this face a concave polygon. Return the number of concavities.
WEMNode * getNodeAt(unsigned int index) override
Returns the node at the given index in this face.
WEMTriangle()
Standard constructor.
virtual bool rayIntersect(const Vector3 &origin, const Vector3 &direction) const
Returns whether the given ray intersects this triangle?
double getPerimeter() const override
Calculates the perimeter of this face.
WEMNode * getOther(WEMNode *n1, WEMNode *n2) override
Returns the node incident to this face that is not given as a parameter.
void removeEdges() override
Removes all edge pointers of this face.
int getIndex(WEMNode *node) const override
Returns the index of the given node.
friend 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 c...
virtual void setEdges(WEMEdge *edge1, WEMEdge *edge2, WEMEdge *edge3)
Sets the given edges.
unsigned int getNumNodes() const override
Returns the number of nodes.
void reset()
Resets the object to default constructed state.
double getQuality() const override
Calculates the quality of the face.
WEMTriangle(const WEMTriangle &t)
Standard copy constructor.
const WEMEdge * getOther(WEMEdge *e1, WEMEdge *e2) const override
Returns the edge incident to this face that is not given as a parameter.
virtual bool isFolding(WEMNode *node, const Vector3 &position) const
Returns whether this face is folding?
void mirror() override
Mirrors this face. Note that the edge information gets corrupted! Use WEM::buildEdgeConnectivity afte...
WEMEdge * getEdgeAt(unsigned int index) override
Returns the edge at the given index in this face.
Vector3 getCentroid() const override
Returns the geometric centroid of this face.
Vector3 getNodePositionAt(unsigned int index) const override
Returns the position of a node at the given index.
const WEMEdge * getEdgeAt(unsigned int index) const override
Returns the edge at the given index in this face.
bool contains(WEMNode *node) const override
Returns whether this face contains the given node.
void computeNormal() override
Computes the normal.
void clone(WEMTriangle *triangle)
Clones given triangle.
bool contains(WEMEdge *edge) const override
Returns whether this face contains the given edge.
const WEMNode * getOther(WEMNode *n1, WEMNode *n2) const override
Returns the node incident to this face that is not given as a parameter.
const WEMEdge * getEdgeNotContaining(WEMNode *n) const override
Returns the edge not containing given node.
std::array< WEMNode *, 3 > _nodes
Node pointers.
void replace(WEMNode *orig, WEMNode *replacement) override
Replaces the given orig node by the given replace node.
const WEMNode * getNodeAt(unsigned int index) const override
Returns the node at the given index in this face.
std::array< WEMEdge *, 3 > _edges
Edge pointers.
void replace(WEMEdge *orig, WEMEdge *replacement) override
Replaces the given orig node by the given replace edge.
virtual bool pointInTriangle(const Vector3 &position) const
Returns whether the given point is in this triangle.
WEMTriangle(WEMTriangle &&t) noexcept
Move constructor.
friend bool MLWEM_EXPORT operator!=(const WEMTriangle &x, const WEMTriangle &y)
Operator for not equality.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.