52 inline void getPosition(
double& x,
double& y,
double& z)
const { x=_position.x; y=_position.y; z=_position.z;}
54 #if ML_DEPRECATED_SINCE(3,5,0)
60 inline void getPosition(
float& x,
float& y,
float& z)
62 x=
static_cast<float>(_position.x);
63 y=
static_cast<float>(_position.y);
64 z=
static_cast<float>(_position.z);
70 inline void setPosition(
const Vector3& position) { _position = position; invalidateBoundingBoxesOfAdjacentFaces(); }
72 inline void setPosition(
double x,
double y,
double z) { _position.assign(x,y,z); invalidateBoundingBoxesOfAdjacentFaces(); }
74 inline void translate(
const Vector3& offset) { _position += offset; invalidateBoundingBoxesOfAdjacentFaces(); }
79 inline void scale(
const Vector3& scaleFactor) { _position *= scaleFactor; invalidateBoundingBoxesOfAdjacentFaces(); }
85 inline unsigned int getNumFaces()
const {
return getFaceValence(); }
87 inline unsigned int getNumEdges()
const {
return getEdgeValence(); }
93 inline void setColor(
float r,
float g,
float b) { _color[0] = r; _color[1] = g; _color[2] = b; }
95 inline void setColor(
float a) { _color[3] = a; }
101 inline void setNormal(
float x,
float y,
float z) { _normal.assign(x,y,z); }
113 inline WEMQuad*
getQuadAt(
unsigned int index) {
return (_faces.at(index)) ?
reinterpret_cast<WEMQuad*
>(_faces.at(index)) :
nullptr; }
137 inline bool isBoundary()
const {
return (_edges.num() && (_edges.num() != _faces.num())); }
154 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.
const WEMQuad * getQuadAt(unsigned int index) const
Returns the face at the given index and casts it to WEMQuad.
double getLargestDihedralAngle() const
Returns the largest angle between the node normal and any incident face's normal.
const Vector3 & getPosition() const
Returns the world position.
const WEMPolygon * getPolygonAt(unsigned int index) const
Returns the face at the given index and casts it to WEMPolygon.
const WEMTriangle * getTriangleAt(unsigned int index) const
Returns the face at the given index and casts it to WEMTriangle.
WEMNode & operator=(WEMNode &&n) noexcept
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.
WEMTriangle * getTriangleAt(unsigned int index)
Returns the face at the given index and casts it to WEMTriangle.
void setPosition(const Vector3 &position)
Sets the position in world coordinates.
WEMQuad * getQuadAt(unsigned int index)
Returns the face at the given index and casts it to WEMQuad.
unsigned int getFaceValence() const
Returns the face valence of node. The valence denotes the number of attached faces.
void setColor(float a)
Sets the alpha color of the 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.
void setNormal(float x, float y, float z)
Sets the normal of the node.
~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.
WEMEdge * getEdgeWith(WEMNode *node)
Returns the edge shared with the given 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.
void addEdge(WEMEdge *edge)
Adds the edge.
WEMPolygon * getPolygonAt(unsigned int index)
Returns the face at the given index and casts it to WEMPolygon.
void setPosition(double x, double y, double z)
Sets the position in world coordinates.
WEMEdge * getEdgeAt(unsigned int index)
Returns the edge at the given index.
void remove(WEMEdge *edge)
Removes the given edge.
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.
const WEMEdge * getEdgeAt(unsigned int index) const
Returns the edge at the given index.
Vector3 getNormal() const
Returns the normal of the node.
WEMNode(WEMNode &&n) noexcept
void remove(WEMFace *face)
Removes the given face.
const WEMFace * getFaceAt(unsigned int index) const
Returns the face at the given index.
WEMFace * getFaceAt(unsigned int index)
Returns the face at the given index.
void reset()
Resets the object to default constructed state.
void setColor(float r, float g, float b)
Sets the RGB 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.
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.
const WEMEdge * getEdgeWith(WEMNode *node) const
Returns the edge shared with the given node.
void computeNormal()
Computes the normal of the node.
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.
bool MLWEM_EXPORT nodesAtAlmostIdenticalPositions(const WEMNode &x, const WEMNode &y)