50 inline unsigned int getNumNodes()
const override {
return 3; }
61 _nodes[0] = node1; _nodes[1] = node2; _nodes[2] = node3;
82 _edges[0] = edge1; _edges[1] = edge2; _edges[2] = edge3;
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.
WEMEdge * getEdgeAt(unsigned int index) override
Returns the edge at the given index in this face.
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.
const WEMEdge * getOther(WEMEdge *e1, WEMEdge *e2) const override
Returns the edge incident to this face that is not given as a parameter.
~WEMTriangle() override
Standard destructor.
int getIndex(WEMEdge *edge) const override
Returns the index of the given edge.
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.
int isConcave() const override
Checks whether this face a concave polygon. Return the number of concavities.
WEMTriangle()
Standard constructor.
WEMNode * getNodeAt(unsigned int index) override
Returns the node at the given index in this face.
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.
void removeEdges() override
Removes all edge pointers of this face.
int getIndex(WEMNode *node) const override
Returns the index of the given node.
const WEMNode * getOther(WEMNode *n1, WEMNode *n2) const override
Returns the node incident to this face that is not given as a parameter.
WEMTriangle & operator=(WEMTriangle &&t) noexcept
Move assignment operator.
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...
const WEMEdge * getEdgeNotContaining(WEMNode *n) const override
Returns the edge not containing given node.
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 WEMNode * getNodeAt(unsigned int index) const override
Returns the node at the given index in this face.
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...
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.
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.
WEMEdge * getOther(WEMEdge *e1, WEMEdge *e2) override
Returns the edge incident to this face that is not given as a parameter.
const WEMEdge * getEdgeAt(unsigned int index) const override
Returns the edge at the given index in this face.
std::array< WEMNode *, 3 > _nodes
Node pointers.
void replace(WEMNode *orig, WEMNode *replacement) override
Replaces the given orig node by the given replace node.
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.
WEMNode * getOther(WEMNode *n1, WEMNode *n2) override
Returns the node incident to this face that is not given as a parameter.
friend bool MLWEM_EXPORT operator!=(const WEMTriangle &x, const WEMTriangle &y)
Operator for not equality.
WEMEdge * getEdgeNotContaining(WEMNode *n) override
Returns the edge not containing given node.