54 inline void getPosition(
double& x,
double& y,
double& z)
const
65 invalidateBoundingBoxesOfAdjacentFaces();
70 _position.assign(x, y, z);
71 invalidateBoundingBoxesOfAdjacentFaces();
81 _position.assign(x, y, z);
87 invalidateBoundingBoxesOfAdjacentFaces();
95 _position *= scaleFactor;
96 invalidateBoundingBoxesOfAdjacentFaces();
111 return getFaceValence();
116 return getEdgeValence();
153 _normal.assign(x, y, z);
160 return _faces.at(index);
165 return const_cast<WEMNode*
>(
this)->getFaceAt(index);
170 return (_faces.at(index)) ?
reinterpret_cast<WEMTriangle*
>(_faces.at(index)) :
nullptr;
175 return const_cast<WEMNode*
>(
this)->getTriangleAt(index);
180 return (_faces.at(index)) ?
reinterpret_cast<WEMQuad*
>(_faces.at(index)) :
nullptr;
185 return const_cast<WEMNode*
>(
this)->getQuadAt(index);
190 return (_faces.at(index)) ?
reinterpret_cast<WEMPolygon*
>(_faces.at(index)) :
nullptr;
195 return const_cast<WEMNode*
>(
this)->getPolygonAt(index);
205 _faces.resize(numFaces);
210 _faces.set(index,
face);
217 return _edges.at(index);
222 return const_cast<WEMNode*
>(
this)->getEdgeAt(index);
236 return const_cast<WEMNode*
>(
this)->getEdgeWith(node);
241 return (_edges.num() && (_edges.num() != _faces.num()));
264 void invalidateBoundingBoxesOfAdjacentFaces();
Defines the mesh component: edge.
Defines the mesh component: face.
Defines the mesh component: node.
void removeFaces()
Removes all faces attached to this node.
double getLargestDihedralAngle() const
Returns the largest angle between the node normal and any incident face's normal.
WEMTriangle * getTriangleAt(unsigned int index)
Returns the face at the given index and casts it to WEMTriangle.
void replace(WEMEdge *orig, WEMEdge *replacement)
Replaces an edge orig in the internal edge's vector by another edge replace.
void clone(WEMNode *n)
Clones given node.
void setPosition(const Vector3 &position)
Sets the position in world coordinates.
unsigned int getFaceValence() const
Returns the face valence of node. The valence denotes the number of attached faces.
const WEMPolygon * getPolygonAt(unsigned int index) const
Returns the face at the given index and casts it to WEMPolygon.
const WEMEdge * getEdgeWith(WEMNode *node) const
Returns the edge shared with the given node.
unsigned int getEdgeValence() const
Returns the edge valence of node. The valence denotes the number of attached edges.
void setNormal(const Vector3 &normal)
Sets the normal of the node.
void setColor(const Vector4 &color)
Sets the color of the node.
const WEMFace * getFaceAt(unsigned int index) const
Returns the face at the given index.
~WEMNode() override
Standard destructor.
void translate(const Vector3 &offset)
Translates the position by the given vector.
void getPosition(double &x, double &y, double &z) const
Returns the world position.
Vector4 getColor() const
Returns the color of the node.
unsigned int getNumFaces() const
Returns the number of faces attached to this node.
void applyMatrix(const Matrix4 &transformMatrix)
Multiplies the node's position with the given transformation matrix.
WEMEdge * getEdgeAt(unsigned int index)
Returns the edge at the given index.
void addEdge(WEMEdge *edge)
Adds the edge.
void setPositionNoInvalidationOfBoundingBoxes(const Vector3 &position)
Sets the position in world coordinates without invalidating the bounding boxes of adjacent faces.
WEMFace * getFaceAt(unsigned int index)
Returns the face at the given index.
void resizeFaces(unsigned int numFaces)
Resizes the internal face vector to the given number of faces.
const WEMEdge * getEdgeAt(unsigned int index) const
Returns the edge at the given index.
void setPosition(double x, double y, double z)
Sets the position in world coordinates.
const Vector3 & getPosition() const
Returns the world position.
WEMEdge * getEdgeWith(WEMNode *node)
Returns the edge shared with the given node.
const WEMTriangle * getTriangleAt(unsigned int index) const
Returns the face at the given index and casts it to WEMTriangle.
void remove(WEMEdge *edge)
Removes the given edge.
void setNormal(double x, double y, double z)
Sets the normal of the node.
void setFace(unsigned int index, WEMFace *face)
Sets the given face at the given index.
WEMQuad * getQuadAt(unsigned int index)
Returns the face at the given index and casts it to WEMQuad.
WEMNode(const WEMNode &n)
Copy constructor.
void replace(WEMFace *orig, WEMFace *replacement)
Replaces a face orig in the internal face's vector by another face replace.
void removeEdges()
Removes all edges attached to this node.
Vector3 getNormal() const
Returns the normal of the node.
void setPositionNoInvalidationOfBoundingBoxes(double x, double y, double z)
Sets the position in world coordinates without invalidating the bounding boxes of adjacent faces.
void setColor(double r, double g, double b)
Sets the RGB color of the node.
WEMNode(WEMNode &&n) noexcept
void remove(WEMFace *face)
Removes the given face.
WEMNode & operator=(WEMNode &&n) noexcept
void reset()
Resets the object to default constructed state.
void setColor(double a)
Sets the alpha color of the node.
bool isBoundary() const
Returns whether the node has any edge which is a boundary edge.
unsigned int getNumEdges() const
Returns the number of edges attached to this node.
const WEMQuad * getQuadAt(unsigned int index) const
Returns the face at the given index and casts it to WEMQuad.
void scale(const Vector3 &scaleFactor)
Scales the position by given vector.
double getPrimitiveValue(const WEMPrimitiveValueList *valueList) const
Returns the node value from the given primitive value list.
void computeNormal()
Computes the normal of the node.
WEMPolygon * getPolygonAt(unsigned int index)
Returns the face at the given index and casts it to WEMPolygon.
void addFace(WEMFace *face)
Adds the given face.
WEMNode()
Standard constructor.
Defines the mesh component: polygon.
Stores a value list where the values are associated to primitives (WEMNode, WEMEdge,...
This is the base class for the WEM elements nodes, edges, and faces.
Defines the mesh component: quad.
Defines the mesh component: triangle.
Dynamic templated vector.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
bool MLWEM_EXPORT nodesAtAlmostIdenticalPositions(const WEMNode &x, const WEMNode &y)