MeVisLab Toolbox Reference
ml::WEMPolygonPatch Class Reference

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

#include <WEMPolygonPatch.h>

Inheritance diagram for ml::WEMPolygonPatch:
ml::WEMPatch

Public Member Functions

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

Additional Inherited Members

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

Detailed Description

This represents a WEMPatch consisting of polygons only.

Definition at line 24 of file WEMPolygonPatch.h.

Constructor & Destructor Documentation

◆ WEMPolygonPatch() [1/4]

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

Standard constructor.

◆ WEMPolygonPatch() [2/4]

ml::WEMPolygonPatch::WEMPolygonPatch ( 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.

◆ WEMPolygonPatch() [3/4]

ml::WEMPolygonPatch::WEMPolygonPatch ( const WEMPolygonPatch wemPatch)

Copy constructor.

◆ WEMPolygonPatch() [4/4]

ml::WEMPolygonPatch::WEMPolygonPatch ( WEMPolygonPatch &&  wemPatch)
noexcept

◆ ~WEMPolygonPatch()

ml::WEMPolygonPatch::~WEMPolygonPatch ( )
override

Standard destructor.

Member Function Documentation

◆ addFace()

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

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

Implements ml::WEMPatch.

◆ addPolygon()

WEMPolygon* ml::WEMPolygonPatch::addPolygon ( )

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

Returns a pointer to this newly added face. Also adds entries to the face PVLs.

◆ addPolygonNoUpdatePrimitiveValueLists()

WEMPolygon* ml::WEMPolygonPatch::addPolygonNoUpdatePrimitiveValueLists ( )

Creates and returns a new polygon without adding an entry to the face PLVs.

◆ convertIndexedFace()

void ml::WEMPolygonPatch::convertIndexedFace ( WEMIndexedFace indexedFace)

Adds the given indexed face to this patch.

◆ copy()

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

Create a (deep) copy of the patch.

Implements ml::WEMPatch.

◆ delPolygon()

void ml::WEMPolygonPatch::delPolygon ( WEMPolygon polygon)

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

◆ dispose()

virtual void ml::WEMPolygonPatch::dispose ( )
virtual

Disposes of internal data structures.

◆ getFaceAt() [1/2]

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

Returns the face at the given index.

Implements ml::WEMPatch.

Definition at line 61 of file WEMPolygonPatch.h.

References getFaceAt().

Referenced by getFaceAt().

◆ getFaceAt() [2/2]

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

Returns the face at the given index.

Implements ml::WEMPatch.

Definition at line 59 of file WEMPolygonPatch.h.

◆ getFaces() [1/2]

WEMIndexVector<WEMPolygon>* ml::WEMPolygonPatch::getFaces ( )
inline

Returns the pointer to internal faces structure.

Definition at line 52 of file WEMPolygonPatch.h.

◆ getFaces() [2/2]

const WEMIndexVector<WEMPolygon>* ml::WEMPolygonPatch::getFaces ( ) const
inline

Returns the pointer to the internal faces structure.

Definition at line 54 of file WEMPolygonPatch.h.

References getFaces().

Referenced by getFaces().

◆ getNumFaces()

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

Returns the number of faces in the patch.

Reimplemented from ml::WEMPatch.

Definition at line 50 of file WEMPolygonPatch.h.

◆ getPatchType()

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

Returns the mesh type of this patch.

Implements ml::WEMPatch.

Definition at line 45 of file WEMPolygonPatch.h.

References ml::WEM_PATCH_POLYGONS.

◆ getPolygonAt() [1/2]

WEMPolygon* ml::WEMPolygonPatch::getPolygonAt ( unsigned int  index)
inline

Returns the WEMPolygon at the given index.

Definition at line 63 of file WEMPolygonPatch.h.

◆ getPolygonAt() [2/2]

const WEMPolygon* ml::WEMPolygonPatch::getPolygonAt ( unsigned int  index) const
inline

Returns the WEMPolygon at the given index.

Definition at line 65 of file WEMPolygonPatch.h.

References getPolygonAt().

Referenced by getPolygonAt().

◆ operator=()

WEMPolygonPatch& ml::WEMPolygonPatch::operator= ( WEMPolygonPatch &&  wemPatch)
noexcept

◆ sortFacesByZPosition()

void ml::WEMPolygonPatch::sortFacesByZPosition ( )
overridevirtual

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

Implements ml::WEMPatch.


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