52 inline void getPosition(
double& x,
double& y,
double& z)
const { x=_position.x; y=_position.y; z=_position.z;}
55 inline void setPosition(
const Vector3& position) { _position = position; invalidateBoundingBoxesOfAdjacentFaces(); }
57 inline void setPosition(
double x,
double y,
double z) { _position.assign(x,y,z); invalidateBoundingBoxesOfAdjacentFaces(); }
59 inline void translate(
const Vector3& offset) { _position += offset; invalidateBoundingBoxesOfAdjacentFaces(); }
64 inline void scale(
const Vector3& scaleFactor) { _position *= scaleFactor; invalidateBoundingBoxesOfAdjacentFaces(); }
70 inline unsigned int getNumFaces()
const {
return getFaceValence(); }
72 inline unsigned int getNumEdges()
const {
return getEdgeValence(); }
78 inline void setColor(
float r,
float g,
float b) { _color[0] = r; _color[1] = g; _color[2] = b; }
80 inline void setColor(
float a) { _color[3] = a; }
86 inline void setNormal(
float x,
float y,
float z) { _normal.assign(x,y,z); }
98 inline WEMQuad*
getQuadAt(
unsigned int index) {
return (_faces.at(index)) ?
reinterpret_cast<WEMQuad*
>(_faces.at(index)) :
nullptr; }
122 inline bool isBoundary()
const {
return (_edges.num() && (_edges.num() != _faces.num())); }
139 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.
void setColor(float a)
Sets the alpha color of the node.
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.
void setNormal(float x, float y, float z)
Sets the normal 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.
WEMFace * getFaceAt(unsigned int index)
Returns the face at the given index.
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.
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.
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(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.
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)