MeVisLab Toolbox Reference
ml::WEMTrianglePatch Class Reference

This represents a WEMPatch consisting of triangles only. More...

#include <WEMTrianglePatch.h>

Inheritance diagram for ml::WEMTrianglePatch:
ml::WEMPatch

Public Member Functions

 WEMTrianglePatch (unsigned int bs=8192)
 Standard constructor.
 
 WEMTrianglePatch (WEM *wem, unsigned int bs=8192)
 Constructor which takes a pointer to the WEM this WEMPatch is in.
 
 WEMTrianglePatch (const WEMTrianglePatch &wemPatch)
 Copy constructor.
 
 WEMTrianglePatch (WEMTrianglePatch &&other) noexcept
 Move c'tor.
 
WEMTrianglePatchoperator= (WEMTrianglePatch &&other) noexcept
 Move assignment operator.
 
 ~WEMTrianglePatch () override=default
 Standard destructor.
 
WEMPatchcopy () override
 Create a (deep) copy of the patch.
 
virtual void dispose ()
 Disposes of internal data structures.
 
PatchTypes getPatchType () const override
 Returns the mesh type.
 
unsigned int getNumFaces () const override
 Returns the number of faces in the patch.
 
WEMIndexVector< WEMTriangle > * getFaces ()
 Returns the pointer to the internal faces structure.
 
const WEMIndexVector< WEMTriangle > * getFaces () const
 Returns the pointer to the internal faces structure.
 
WEMFacegetFaceAt (unsigned int index) override
 Returns the face at the given index.
 
const WEMFacegetFaceAt (unsigned int index) const override
 Returns the face at the given index.
 
WEMTrianglegetTriangleAt (unsigned int index)
 Returns the WEMTriangle at the given index.
 
const WEMTrianglegetTriangleAt (unsigned int index) const
 Returns the WEMTriangle at the given index.
 
WEMFaceaddFace () override
 Instantiates a new WEMTriangle and adds it to the internal faces vector. Returns a pointer to this newly added face.
 
WEMTriangleaddTriangle ()
 Instantiates a new WEMTriangle and adds it to the internal faces vector.
 
WEMTriangleaddTriangleNoUpdatePrimitiveValueLists ()
 Creates and adds a triangle to the internal faces vector. Returns a pointer to this new face.
 
void delTriangle (WEMTriangle *triangle)
 Deletes a triangle and erases it from the internal faces vector.
 
void removeNodeFromPatch (WEMNode *node)
 Removes the given node from this patch.
 
void deleteNodesWithValenceThree ()
 Deletes all nodes with a valence of three.
 
bool deleteNodeWithValenceThree (WEMNode *node)
 Deletes a single node with a valence of three.
 
void deleteTetrahedron (WEMNode *node)
 Deletes a tetrahedron.
 
void convertIndexedFace (WEMIndexedFace *indexedFace, TriangulationModes triangulationMode)
 Adds the given indexed face to this patch.
 
void sortFacesByZPosition () override
 Sorts the faces by the z-position of their centroids.
 
- Public Member Functions inherited from ml::WEMPatch
 WEMPatch (unsigned int bs=8192)
 Standard constructor.
 
 WEMPatch (WEM *wem, unsigned int bs=8192)
 Constructor which takes a pointer to the WEM this WEM is in.
 
 WEMPatch (const WEMPatch &wemPatch)
 Copy constructor.
 
 WEMPatch (WEMPatch &&other) noexcept
 Move c'tor.
 
WEMPatchoperator= (WEMPatch &&other) noexcept
 Move assignment operator.
 
virtual ~WEMPatch ()
 Standard destructor.
 
void dispose ()
 Disposes of internal data structures.
 
void addPatch (WEMPatch *wemPatch)
 Adds the primitives of the given patch to this patch.
 
unsigned int getBlocksize () const
 Returns the block size for the patch.
 
bool isTrianglePatch () const
 Helper method to check if the patch is a triangle patch.
 
bool isQuadPatch () const
 Helper method to check if the patch is a quad patch.
 
unsigned int getNumNodes () const
 Returns the number of nodes in the patch.
 
WEMIndexVector< WEMNode > * getNodes ()
 Returns the pointer to the internal nodes structure.
 
const WEMIndexVector< WEMNode > * getNodes () const
 Returns the pointer to internal nodes structure.
 
WEMNodegetNodeAt (unsigned int index)
 Returns the node at the given index.
 
const WEMNodegetNodeAt (unsigned int index) const
 Returns the node at the given index.
 
WEMNodeaddNode ()
 Instantiates a new WEMNode and adds it to the internal nodes vector.
 
WEMNodeaddNodeNoUpdatePrimitiveValueLists ()
 Creates and returns a new node without changing the nodes PVL.
 
void delNode (WEMNode *node)
 Deletes the given node and erases it from the internal nodes vector.
 
void addNodeValues (WEMNode *target, WEMNode *source, double modifier)
 Adds node values from node source to given target node.
 
void averageNodeValues (WEMNode *target, WEMNode *source1, WEMNode *source2)
 Averages the given source node values and stores values in the given target node.
 
void extendNodeValueLists (unsigned int number, double value)
 Extends all node value lists with the given value.
 
unsigned int getNumEdges () const
 Returns the number of edges in the patch.
 
WEMIndexVector< WEMEdge > * getEdges ()
 Returns the pointer to the internal edges structure.
 
const WEMIndexVector< WEMEdge > * getEdges () const
 Returns the pointer to the internal edges structure.
 
WEMEdgegetEdgeAt (unsigned int index)
 Returns the edge at the given index.
 
const WEMEdgegetEdgeAt (unsigned int index) const
 Returns the edge at the given index.
 
WEMEdgeaddEdge ()
 Instantiates a new WEMEdge and adds it to the internal edges vector.
 
void delEdge (WEMEdge *edge)
 Deletes an edge and erases it from the internal edges vector.
 
bool hasEdges () const
 Returns whether this patch has any edges.
 
void addEdgeValues (WEMEdge *target, WEMEdge *source, double modifier)
 Adds the edge values from edge source to given target edge.
 
void extendEdgeValueLists (unsigned int number, double value)
 Extends all edge value lists with given value.
 
void addFaceValues (WEMFace *target, WEMFace *source, double modifier)
 Adds the face values from face source to given target face.
 
void extendFaceValueLists (unsigned int number, double value)
 Extends all face value lists with the given value.
 
void setNodeTraversalState (bool state)
 Sets the specified traversal state to all nodes.
 
void setEdgeTraversalState (bool state)
 Sets the specified traversal state to all edges.
 
void setFaceTraversalState (bool state)
 Sets the specified traversal state to all faces.
 
void computeNormals ()
 Computes all normals.
 
void flipNormals ()
 Flip all normals.
 
void applyMatrix (const Matrix4 &transformationMatrix)
 Applies the given matrix on all nodes, applies the inverse transposed matrix on all node normals, and invalidates all face bounding boxes.
 
double getArea () const
 Returns the area of this patch in square mm.
 
double getVolume () const
 Returns the volume of this patch in cubic mm.
 
bool pointsOutwards () const
 Checks and returns whether this patch has most normals pointing outwards.
 
WEMBoundingBoxgetBoundingBox ()
 Returns the bounding box.
 
const WEMBoundingBoxgetBoundingBox () const
 Returns the bounding box.
 
void computeBoundingBox ()
 Computes the bounding box.
 
void centerByBoundingBox ()
 Centers the patch by its bounding box.
 
void translate (const Vector3 &offset)
 Translate all nodes by the given offset.
 
double getLUTMin () const
 Returns the minimum value of the LUT PVL for range determination.
 
double getLUTMax () const
 Returns the maximum value of the LUT PVL for range determination.
 
void setType (std::string type)
 Sets the type of the WEMPatch.
 
std::string getType () const
 Returns the type of the WEMPatch.
 
void setCreatorId (int id)
 Sets the creator ID of the WEMPatch.
 
int getCreatorId () const
 Returns the creator ID of the WEMPatch.
 
void setWEM (WEM *wem)
 Sets the internal pointer to the embracing WEM.
 
WEMgetWEM ()
 Returns the internal pointer to the embracing WEM.
 
const WEMgetWEM () const
 Returns the internal pointer to the embracing WEM.
 
void setLabel (std::string label)
 Sets the 'label' attribute of this WEMPatch.
 
std::string getLabel () const
 Returns the 'label' attribute of this WEMPatch.
 
void setDescription (std::string desc)
 Sets the 'description' attribute of this WEMPatch.
 
std::string getDescription () const
 Returns the 'description' attribute of this WEMPatch.
 
unsigned int getId () const
 Returns the unique ID of this WEMPatch.
 
void setId (unsigned int newId)
 Sets the unique ID of this WEMPatch. Beware: do not set this ID unless you really know what you do!
 
void deleteOrphanNodes ()
 Deletes orphan nodes (number of edges == number of faces == 0).
 
void triangulate (WEMTrianglePatch *wemPatch, TriangulationModes triangulationMode)
 Triangulates the patch and adds triangles to the given triangle patch.
 
void mirror ()
 Mirrors the faces in this patch.
 
WEMPatchmakeCompatible (WEMRequirements *requirements, TriangulationModes triangulationMode)
 Makes WEMPatch compatible with the given requirements.
 
virtual void buildEdgeConnectivity ()
 Builds edge connectivity for the whole WEM.
 
void buildLocalEdgeConnectivity (WEMFace *face)
 Builds local edge connectivity, only provided face is rebuild.
 
void removeAllEdges ()
 Removes all edges.
 
void saveTo (OutStreamWrapper &ostreamWrapper, const WEMPersistenceParameters &writeParameters, WEMProgressUpdater &progressUpdater)
 Saves this patch to given output stream.
 
unsigned int loadFrom (FileMapWrapper &mapper, const WEMPersistenceParameters &persistenceParameters, const WEMReadParameters &parameters, WEMProgressUpdater &progressUpdater)
 Loads this patch from given memory map.
 
WEMPrimitiveValueListcreateOrGetPrimitiveValueList (const std::string &name)
 Creates a PVL under the given name and returns a pointer to it.
 
WEMPrimitiveValueListgetPrimitiveValueList (const std::string &name)
 Returns a pointer to the PVL with the given name.
 
const WEMPrimitiveValueListgetPrimitiveValueList (const std::string &name) const
 Returns a pointer to the PVL with the given name.
 
std::vector< std::string > getRegisteredPrimitiveValueLists () const
 Returns all available primitive value lists as a vector filled with the registered names of the PVLs.
 
const std::vector< WEMPrimitiveValueList * > & getPrimitiveValueLists () const
 Returns an array of the primitive value lists.
 
bool removePrimitiveValueList (const std::string &name)
 Removes the PVL with the given name. Returns whether the operation was successful.
 
bool hasSingleColoredPVL ()
 Returns whether the patch has a PVL set for single colored faces.
 
bool hasAllFacesSingleColored ()
 Returns whether all faces are single colored.
 
unsigned int getNumSingleColoredFaces ()
 Return the number of single-colored faces.
 
bool isSingleColored (WEMFace *face)
 Returns whether the given face is single colored.
 
bool isSingleColored (WEMEdge *edge)
 Returns whether an adjacent face to the given edge is single colored.
 
bool isSingleColored (WEMNode *node)
 Returns whether an adjacent face to the given node is single colored.
 

Friends

bool MLWEM_EXPORT operator== (const WEMTrianglePatch &x, const WEMTrianglePatch &y)
 Operator for equality.
 
bool MLWEM_EXPORT operator!= (const WEMTrianglePatch &x, const WEMTrianglePatch &y)
 Operator for not equality.
 

Additional Inherited Members

- Protected Member Functions inherited from ml::WEMPatch
virtual void _addFaceUpdatePrimitiveValueLists ()
 Updates primitive value lists on addFace.
 
virtual void _delFaceUpdatePrimitiveValueLists (WEMFace *face)
 Updates primitive value lists on delFace.
 
void _getReorderedIndicesForFaces (std::vector< unsigned int > &reorderedIndices)
 
- Protected Attributes inherited from ml::WEMPatch
unsigned int _blocksize
 Initial blocksize for the WEMVector, WEMObjectVector variables used.
 
WEMIndexVector< WEMNode_nodes
 The vector that holds all the nodes of the wem.
 
WEMIndexVector< WEMEdge_edges
 The vector that holds all the edges of the wem.
 
WEM_wem {}
 A pointer to the WEM this WEMPart is in.
 
unsigned int _uniqueId {}
 Unique ID of this WEM.
 
std::string _type
 Type of this WEMPatch.
 
int _creatorId
 ID of the creator of this WEMPatch.
 
WEMAttributes _attributes
 The attributes of this WEMPatch.
 
WEMBoundingBox _boundingBox
 The bounding box of this WEMPatch.
 
std::vector< WEMPrimitiveValueList * > _primitiveValueLists
 The registered primitive value lists vector.
 

Detailed Description

This represents a WEMPatch consisting of triangles only.

Definition at line 25 of file WEMTrianglePatch.h.

Constructor & Destructor Documentation

◆ WEMTrianglePatch() [1/4]

ml::WEMTrianglePatch::WEMTrianglePatch ( unsigned int bs = 8192)

Standard constructor.

◆ WEMTrianglePatch() [2/4]

ml::WEMTrianglePatch::WEMTrianglePatch ( WEM * wem,
unsigned int bs = 8192 )

Constructor which takes a pointer to the WEM this WEMPatch is in.

In this method, the unique id is set.

◆ WEMTrianglePatch() [3/4]

ml::WEMTrianglePatch::WEMTrianglePatch ( const WEMTrianglePatch & wemPatch)

Copy constructor.

◆ WEMTrianglePatch() [4/4]

ml::WEMTrianglePatch::WEMTrianglePatch ( WEMTrianglePatch && other)
noexcept

Move c'tor.

◆ ~WEMTrianglePatch()

ml::WEMTrianglePatch::~WEMTrianglePatch ( )
overridedefault

Standard destructor.

Member Function Documentation

◆ addFace()

WEMFace * ml::WEMTrianglePatch::addFace ( )
overridevirtual

Instantiates a new WEMTriangle and adds it to the internal faces vector. Returns a pointer to this newly added face.

Implements ml::WEMPatch.

◆ addTriangle()

WEMTriangle * ml::WEMTrianglePatch::addTriangle ( )

Instantiates a new WEMTriangle and adds it to the internal faces vector.

Returns a pointer to this newly added face. By calling this method, a new entry for the FACE PVL is added.

◆ addTriangleNoUpdatePrimitiveValueLists()

WEMTriangle * ml::WEMTrianglePatch::addTriangleNoUpdatePrimitiveValueLists ( )

Creates and adds a triangle to the internal faces vector. Returns a pointer to this new face.

◆ convertIndexedFace()

void ml::WEMTrianglePatch::convertIndexedFace ( WEMIndexedFace * indexedFace,
TriangulationModes triangulationMode )

Adds the given indexed face to this patch.

◆ copy()

WEMPatch * ml::WEMTrianglePatch::copy ( )
overridevirtual

Create a (deep) copy of the patch.

Implements ml::WEMPatch.

◆ deleteNodesWithValenceThree()

void ml::WEMTrianglePatch::deleteNodesWithValenceThree ( )

Deletes all nodes with a valence of three.

◆ deleteNodeWithValenceThree()

bool ml::WEMTrianglePatch::deleteNodeWithValenceThree ( WEMNode * node)

Deletes a single node with a valence of three.

◆ deleteTetrahedron()

void ml::WEMTrianglePatch::deleteTetrahedron ( WEMNode * node)

Deletes a tetrahedron.

◆ delTriangle()

void ml::WEMTrianglePatch::delTriangle ( WEMTriangle * triangle)

Deletes a triangle and erases it from the internal faces vector.

◆ dispose()

virtual void ml::WEMTrianglePatch::dispose ( )
virtual

Disposes of internal data structures.

◆ getFaceAt() [1/2]

const WEMFace * ml::WEMTrianglePatch::getFaceAt ( unsigned int index) const
inlineoverridevirtual

Returns the face at the given index.

Implements ml::WEMPatch.

Definition at line 63 of file WEMTrianglePatch.h.

References getFaceAt().

Referenced by getFaceAt().

◆ getFaceAt() [2/2]

WEMFace * ml::WEMTrianglePatch::getFaceAt ( unsigned int index)
inlineoverridevirtual

Returns the face at the given index.

Implements ml::WEMPatch.

Definition at line 61 of file WEMTrianglePatch.h.

◆ getFaces() [1/2]

WEMIndexVector< WEMTriangle > * ml::WEMTrianglePatch::getFaces ( )
inline

Returns the pointer to the internal faces structure.

Definition at line 54 of file WEMTrianglePatch.h.

◆ getFaces() [2/2]

const WEMIndexVector< WEMTriangle > * ml::WEMTrianglePatch::getFaces ( ) const
inline

Returns the pointer to the internal faces structure.

Definition at line 56 of file WEMTrianglePatch.h.

References getFaces().

Referenced by getFaces().

◆ getNumFaces()

unsigned int ml::WEMTrianglePatch::getNumFaces ( ) const
inlineoverridevirtual

Returns the number of faces in the patch.

Reimplemented from ml::WEMPatch.

Definition at line 52 of file WEMTrianglePatch.h.

◆ getPatchType()

PatchTypes ml::WEMTrianglePatch::getPatchType ( ) const
inlineoverridevirtual

Returns the mesh type.

Implements ml::WEMPatch.

Definition at line 47 of file WEMTrianglePatch.h.

References ml::WEM_PATCH_TRIANGLES.

◆ getTriangleAt() [1/2]

WEMTriangle * ml::WEMTrianglePatch::getTriangleAt ( unsigned int index)
inline

Returns the WEMTriangle at the given index.

Definition at line 65 of file WEMTrianglePatch.h.

◆ getTriangleAt() [2/2]

const WEMTriangle * ml::WEMTrianglePatch::getTriangleAt ( unsigned int index) const
inline

Returns the WEMTriangle at the given index.

Definition at line 67 of file WEMTrianglePatch.h.

References getTriangleAt().

Referenced by getTriangleAt().

◆ operator=()

WEMTrianglePatch & ml::WEMTrianglePatch::operator= ( WEMTrianglePatch && other)
noexcept

Move assignment operator.

◆ removeNodeFromPatch()

void ml::WEMTrianglePatch::removeNodeFromPatch ( WEMNode * node)

Removes the given node from this patch.

◆ sortFacesByZPosition()

void ml::WEMTrianglePatch::sortFacesByZPosition ( )
overridevirtual

Sorts the faces by the z-position of their centroids.

Implements ml::WEMPatch.

Friends And Related Symbol Documentation

◆ operator!=

Operator for not equality.

◆ operator==

Operator for equality.

Currently only the node positions of the triangles and their orientation are compared


The documentation for this class was generated from the following file: