MeVisLab Toolbox Reference
ml::WEMPatch Class Referenceabstract

Base class for triangle and quad patches. More...

#include <WEMPatch.h>

Inheritance diagram for ml::WEMPatch:
ml::WEMPolygonPatch ml::WEMQuadPatch ml::WEMTrianglePatch

Public Member Functions

 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.
 
virtual WEMPatchcopy ()=0
 Create a (deep) copy of the patch.
 
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.
 
virtual PatchTypes getPatchType () const =0
 Returns the mesh type of this patch.
 
virtual unsigned int getNumFaces () const
 Returns the number of faces in 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.
 
virtual WEMFacegetFaceAt (unsigned int index)=0
 Returns the face at the given index.
 
virtual const WEMFacegetFaceAt (unsigned int index) const =0
 Returns the face at the given index.
 
virtual WEMFaceaddFace ()=0
 Instantiates a new face and adds it to the internal faces vector.
 
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.
 
virtual void sortFacesByZPosition ()=0
 Sorts the faces by the z-position of their centroids.
 
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.
 

Protected Member Functions

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

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.
 

Friends

class WEMPatchPersistence
 

Detailed Description

Base class for triangle and quad patches.

Definition at line 47 of file WEMPatch.h.

Constructor & Destructor Documentation

◆ WEMPatch() [1/4]

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

Standard constructor.

◆ WEMPatch() [2/4]

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

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

In this method, the unique id is set.

◆ WEMPatch() [3/4]

ml::WEMPatch::WEMPatch ( const WEMPatch & wemPatch)

Copy constructor.

◆ WEMPatch() [4/4]

ml::WEMPatch::WEMPatch ( WEMPatch && other)
noexcept

Move c'tor.

◆ ~WEMPatch()

virtual ml::WEMPatch::~WEMPatch ( )
virtual

Standard destructor.

Member Function Documentation

◆ _addFaceUpdatePrimitiveValueLists()

virtual void ml::WEMPatch::_addFaceUpdatePrimitiveValueLists ( )
protectedvirtual

Updates primitive value lists on addFace.

◆ _delFaceUpdatePrimitiveValueLists()

virtual void ml::WEMPatch::_delFaceUpdatePrimitiveValueLists ( WEMFace * face)
protectedvirtual

Updates primitive value lists on delFace.

◆ _getReorderedIndicesForFaces()

void ml::WEMPatch::_getReorderedIndicesForFaces ( std::vector< unsigned int > & reorderedIndices)
protected

◆ addEdge()

WEMEdge * ml::WEMPatch::addEdge ( )
inline

Instantiates a new WEMEdge and adds it to the internal edges vector.

Returns a pointer to this newly added edge.

Definition at line 125 of file WEMPatch.h.

◆ addEdgeValues()

void ml::WEMPatch::addEdgeValues ( WEMEdge * target,
WEMEdge * source,
double modifier )

Adds the edge values from edge source to given target edge.

Multiplies by given modifier. Used in constructing new edges out of N edges by averaging.

◆ addFace()

virtual WEMFace * ml::WEMPatch::addFace ( )
pure virtual

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

Returns a pointer to this newly added face.

Implemented in ml::WEMPolygonPatch, ml::WEMQuadPatch, and ml::WEMTrianglePatch.

◆ addFaceValues()

void ml::WEMPatch::addFaceValues ( WEMFace * target,
WEMFace * source,
double modifier )

Adds the face values from face source to given target face.

Multiplies by given modifier. Used in constructing new faces out of N faces by averaging.

◆ addNode()

WEMNode * ml::WEMPatch::addNode ( )

Instantiates a new WEMNode and adds it to the internal nodes vector.

Returns a pointer to this newly added node. Also updates all node value lists with a new default value.

◆ addNodeNoUpdatePrimitiveValueLists()

WEMNode * ml::WEMPatch::addNodeNoUpdatePrimitiveValueLists ( )

Creates and returns a new node without changing the nodes PVL.

◆ addNodeValues()

void ml::WEMPatch::addNodeValues ( WEMNode * target,
WEMNode * source,
double modifier )

Adds node values from node source to given target node.

Multiplies by given modifier. Used in constructing new nodes out of N nodes by averaging.

◆ addPatch()

void ml::WEMPatch::addPatch ( WEMPatch * wemPatch)

Adds the primitives of the given patch to this patch.

◆ applyMatrix()

void ml::WEMPatch::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.

◆ averageNodeValues()

void ml::WEMPatch::averageNodeValues ( WEMNode * target,
WEMNode * source1,
WEMNode * source2 )

Averages the given source node values and stores values in the given target node.

◆ buildEdgeConnectivity()

virtual void ml::WEMPatch::buildEdgeConnectivity ( )
virtual

Builds edge connectivity for the whole WEM.

Only nodes and faces have to be set and known to each other.

◆ buildLocalEdgeConnectivity()

void ml::WEMPatch::buildLocalEdgeConnectivity ( WEMFace * face)

Builds local edge connectivity, only provided face is rebuild.

Only nodes and faces have to be set and known to each other.

◆ centerByBoundingBox()

void ml::WEMPatch::centerByBoundingBox ( )

Centers the patch by its bounding box.

◆ computeBoundingBox()

void ml::WEMPatch::computeBoundingBox ( )

Computes the bounding box.

◆ computeNormals()

void ml::WEMPatch::computeNormals ( )

Computes all normals.

◆ copy()

virtual WEMPatch * ml::WEMPatch::copy ( )
pure virtual

Create a (deep) copy of the patch.

Implemented in ml::WEMPolygonPatch, ml::WEMQuadPatch, and ml::WEMTrianglePatch.

◆ createOrGetPrimitiveValueList()

WEMPrimitiveValueList * ml::WEMPatch::createOrGetPrimitiveValueList ( const std::string & name)

Creates a PVL under the given name and returns a pointer to it.

If the PVL already exists, a pointer to the existing PVL is returned.

◆ delEdge()

void ml::WEMPatch::delEdge ( WEMEdge * edge)
inline

Deletes an edge and erases it from the internal edges vector.

Definition at line 127 of file WEMPatch.h.

◆ deleteOrphanNodes()

void ml::WEMPatch::deleteOrphanNodes ( )

Deletes orphan nodes (number of edges == number of faces == 0).

◆ delNode()

void ml::WEMPatch::delNode ( WEMNode * node)

Deletes the given node and erases it from the internal nodes vector.

Also updates all node value lists by deleting the corresponding value.

◆ dispose()

void ml::WEMPatch::dispose ( )

Disposes of internal data structures.

◆ extendEdgeValueLists()

void ml::WEMPatch::extendEdgeValueLists ( unsigned int number,
double value )

Extends all edge value lists with given value.

◆ extendFaceValueLists()

void ml::WEMPatch::extendFaceValueLists ( unsigned int number,
double value )

Extends all face value lists with the given value.

◆ extendNodeValueLists()

void ml::WEMPatch::extendNodeValueLists ( unsigned int number,
double value )

Extends all node value lists with the given value.

◆ flipNormals()

void ml::WEMPatch::flipNormals ( )

Flip all normals.

◆ getArea()

double ml::WEMPatch::getArea ( ) const

Returns the area of this patch in square mm.

◆ getBlocksize()

unsigned int ml::WEMPatch::getBlocksize ( ) const
inline

Returns the block size for the patch.

Definition at line 71 of file WEMPatch.h.

◆ getBoundingBox() [1/2]

WEMBoundingBox * ml::WEMPatch::getBoundingBox ( )
inline

Returns the bounding box.

Definition at line 180 of file WEMPatch.h.

◆ getBoundingBox() [2/2]

const WEMBoundingBox * ml::WEMPatch::getBoundingBox ( ) const
inline

Returns the bounding box.

Definition at line 182 of file WEMPatch.h.

References getBoundingBox().

Referenced by getBoundingBox().

◆ getCreatorId()

int ml::WEMPatch::getCreatorId ( ) const
inline

Returns the creator ID of the WEMPatch.

Definition at line 219 of file WEMPatch.h.

◆ getDescription()

std::string ml::WEMPatch::getDescription ( ) const
inline

Returns the 'description' attribute of this WEMPatch.

Definition at line 240 of file WEMPatch.h.

◆ getEdgeAt() [1/2]

WEMEdge * ml::WEMPatch::getEdgeAt ( unsigned int index)
inline

Returns the edge at the given index.

Definition at line 120 of file WEMPatch.h.

◆ getEdgeAt() [2/2]

const WEMEdge * ml::WEMPatch::getEdgeAt ( unsigned int index) const
inline

Returns the edge at the given index.

Definition at line 122 of file WEMPatch.h.

References getEdgeAt().

Referenced by getEdgeAt().

◆ getEdges() [1/2]

WEMIndexVector< WEMEdge > * ml::WEMPatch::getEdges ( )
inline

Returns the pointer to the internal edges structure.

Definition at line 116 of file WEMPatch.h.

◆ getEdges() [2/2]

const WEMIndexVector< WEMEdge > * ml::WEMPatch::getEdges ( ) const
inline

Returns the pointer to the internal edges structure.

Definition at line 118 of file WEMPatch.h.

References getEdges().

Referenced by getEdges().

◆ getFaceAt() [1/2]

virtual const WEMFace * ml::WEMPatch::getFaceAt ( unsigned int index) const
pure virtual

Returns the face at the given index.

Implemented in ml::WEMPolygonPatch, ml::WEMQuadPatch, and ml::WEMTrianglePatch.

◆ getFaceAt() [2/2]

virtual WEMFace * ml::WEMPatch::getFaceAt ( unsigned int index)
pure virtual

Returns the face at the given index.

Implemented in ml::WEMPolygonPatch, ml::WEMQuadPatch, and ml::WEMTrianglePatch.

◆ getId()

unsigned int ml::WEMPatch::getId ( ) const
inline

Returns the unique ID of this WEMPatch.

Definition at line 245 of file WEMPatch.h.

◆ getLabel()

std::string ml::WEMPatch::getLabel ( ) const
inline

Returns the 'label' attribute of this WEMPatch.

Definition at line 235 of file WEMPatch.h.

◆ getLUTMax()

double ml::WEMPatch::getLUTMax ( ) const
inline

Returns the maximum value of the LUT PVL for range determination.

Returns 0 if no LUT PVL has been registered.

Definition at line 203 of file WEMPatch.h.

References mlrange_cast().

◆ getLUTMin()

double ml::WEMPatch::getLUTMin ( ) const
inline

Returns the minimum value of the LUT PVL for range determination.

Returns 0 if no LUT PVL has been registered.

Definition at line 195 of file WEMPatch.h.

References mlrange_cast().

◆ getNodeAt() [1/2]

WEMNode * ml::WEMPatch::getNodeAt ( unsigned int index)
inline

Returns the node at the given index.

Definition at line 91 of file WEMPatch.h.

◆ getNodeAt() [2/2]

const WEMNode * ml::WEMPatch::getNodeAt ( unsigned int index) const
inline

Returns the node at the given index.

Definition at line 93 of file WEMPatch.h.

References getNodeAt().

Referenced by getNodeAt().

◆ getNodes() [1/2]

WEMIndexVector< WEMNode > * ml::WEMPatch::getNodes ( )
inline

Returns the pointer to the internal nodes structure.

Definition at line 87 of file WEMPatch.h.

◆ getNodes() [2/2]

const WEMIndexVector< WEMNode > * ml::WEMPatch::getNodes ( ) const
inline

Returns the pointer to internal nodes structure.

Definition at line 89 of file WEMPatch.h.

References getNodes().

Referenced by getNodes().

◆ getNumEdges()

unsigned int ml::WEMPatch::getNumEdges ( ) const
inline

Returns the number of edges in the patch.

Definition at line 114 of file WEMPatch.h.

◆ getNumFaces()

virtual unsigned int ml::WEMPatch::getNumFaces ( ) const
inlinevirtual

Returns the number of faces in the patch.

Reimplemented in ml::WEMPolygonPatch, ml::WEMQuadPatch, and ml::WEMTrianglePatch.

Definition at line 75 of file WEMPatch.h.

◆ getNumNodes()

unsigned int ml::WEMPatch::getNumNodes ( ) const
inline

Returns the number of nodes in the patch.

Definition at line 85 of file WEMPatch.h.

◆ getNumSingleColoredFaces()

unsigned int ml::WEMPatch::getNumSingleColoredFaces ( )

Return the number of single-colored faces.

◆ getPatchType()

virtual PatchTypes ml::WEMPatch::getPatchType ( ) const
pure virtual

Returns the mesh type of this patch.

Implemented in ml::WEMPolygonPatch, ml::WEMQuadPatch, and ml::WEMTrianglePatch.

◆ getPrimitiveValueList() [1/2]

WEMPrimitiveValueList * ml::WEMPatch::getPrimitiveValueList ( const std::string & name)

Returns a pointer to the PVL with the given name.

If such a PVL is not existing, NULL is returned.

◆ getPrimitiveValueList() [2/2]

const WEMPrimitiveValueList * ml::WEMPatch::getPrimitiveValueList ( const std::string & name) const

Returns a pointer to the PVL with the given name.

If such a PVL is not existing, NULL is returned.

◆ getPrimitiveValueLists()

const std::vector< WEMPrimitiveValueList * > & ml::WEMPatch::getPrimitiveValueLists ( ) const
inline

Returns an array of the primitive value lists.

Definition at line 309 of file WEMPatch.h.

◆ getRegisteredPrimitiveValueLists()

std::vector< std::string > ml::WEMPatch::getRegisteredPrimitiveValueLists ( ) const

Returns all available primitive value lists as a vector filled with the registered names of the PVLs.

◆ getType()

std::string ml::WEMPatch::getType ( ) const
inline

Returns the type of the WEMPatch.

Definition at line 215 of file WEMPatch.h.

◆ getVolume()

double ml::WEMPatch::getVolume ( ) const

Returns the volume of this patch in cubic mm.

◆ getWEM() [1/2]

WEM * ml::WEMPatch::getWEM ( )
inline

Returns the internal pointer to the embracing WEM.

Definition at line 226 of file WEMPatch.h.

◆ getWEM() [2/2]

const WEM * ml::WEMPatch::getWEM ( ) const
inline

Returns the internal pointer to the embracing WEM.

Definition at line 228 of file WEMPatch.h.

References getWEM().

Referenced by getWEM().

◆ hasAllFacesSingleColored()

bool ml::WEMPatch::hasAllFacesSingleColored ( )

Returns whether all faces are single colored.

◆ hasEdges()

bool ml::WEMPatch::hasEdges ( ) const
inline

Returns whether this patch has any edges.

Definition at line 129 of file WEMPatch.h.

◆ hasSingleColoredPVL()

bool ml::WEMPatch::hasSingleColoredPVL ( )

Returns whether the patch has a PVL set for single colored faces.

◆ isQuadPatch()

bool ml::WEMPatch::isQuadPatch ( ) const
inline

Helper method to check if the patch is a quad patch.

Definition at line 80 of file WEMPatch.h.

References ml::WEM_PATCH_QUADS.

◆ isSingleColored() [1/3]

bool ml::WEMPatch::isSingleColored ( WEMEdge * edge)

Returns whether an adjacent face to the given edge is single colored.

◆ isSingleColored() [2/3]

bool ml::WEMPatch::isSingleColored ( WEMFace * face)

Returns whether the given face is single colored.

◆ isSingleColored() [3/3]

bool ml::WEMPatch::isSingleColored ( WEMNode * node)

Returns whether an adjacent face to the given node is single colored.

◆ isTrianglePatch()

bool ml::WEMPatch::isTrianglePatch ( ) const
inline

Helper method to check if the patch is a triangle patch.

Definition at line 78 of file WEMPatch.h.

References ml::WEM_PATCH_TRIANGLES.

◆ loadFrom()

unsigned int ml::WEMPatch::loadFrom ( FileMapWrapper & mapper,
const WEMPersistenceParameters & persistenceParameters,
const WEMReadParameters & parameters,
WEMProgressUpdater & progressUpdater )

Loads this patch from given memory map.

◆ makeCompatible()

WEMPatch * ml::WEMPatch::makeCompatible ( WEMRequirements * requirements,
TriangulationModes triangulationMode )

Makes WEMPatch compatible with the given requirements.

◆ mirror()

void ml::WEMPatch::mirror ( )

Mirrors the faces in this patch.

◆ operator=()

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

Move assignment operator.

◆ pointsOutwards()

bool ml::WEMPatch::pointsOutwards ( ) const

Checks and returns whether this patch has most normals pointing outwards.

◆ removeAllEdges()

void ml::WEMPatch::removeAllEdges ( )

Removes all edges.

◆ removePrimitiveValueList()

bool ml::WEMPatch::removePrimitiveValueList ( const std::string & name)

Removes the PVL with the given name. Returns whether the operation was successful.

◆ saveTo()

void ml::WEMPatch::saveTo ( OutStreamWrapper & ostreamWrapper,
const WEMPersistenceParameters & writeParameters,
WEMProgressUpdater & progressUpdater )

Saves this patch to given output stream.

◆ setCreatorId()

void ml::WEMPatch::setCreatorId ( int id)
inline

Sets the creator ID of the WEMPatch.

Definition at line 217 of file WEMPatch.h.

◆ setDescription()

void ml::WEMPatch::setDescription ( std::string desc)
inline

Sets the 'description' attribute of this WEMPatch.

Definition at line 238 of file WEMPatch.h.

References mlrange_cast().

◆ setEdgeTraversalState()

void ml::WEMPatch::setEdgeTraversalState ( bool state)

Sets the specified traversal state to all edges.

◆ setFaceTraversalState()

void ml::WEMPatch::setFaceTraversalState ( bool state)

Sets the specified traversal state to all faces.

◆ setId()

void ml::WEMPatch::setId ( unsigned int newId)
inline

Sets the unique ID of this WEMPatch. Beware: do not set this ID unless you really know what you do!

Definition at line 248 of file WEMPatch.h.

◆ setLabel()

void ml::WEMPatch::setLabel ( std::string label)
inline

Sets the 'label' attribute of this WEMPatch.

Definition at line 233 of file WEMPatch.h.

◆ setNodeTraversalState()

void ml::WEMPatch::setNodeTraversalState ( bool state)

Sets the specified traversal state to all nodes.

◆ setType()

void ml::WEMPatch::setType ( std::string type)
inline

Sets the type of the WEMPatch.

Definition at line 213 of file WEMPatch.h.

◆ setWEM()

void ml::WEMPatch::setWEM ( WEM * wem)
inline

Sets the internal pointer to the embracing WEM.

Definition at line 224 of file WEMPatch.h.

References mlrange_cast().

◆ sortFacesByZPosition()

virtual void ml::WEMPatch::sortFacesByZPosition ( )
pure virtual

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

Implemented in ml::WEMPolygonPatch, ml::WEMQuadPatch, and ml::WEMTrianglePatch.

◆ translate()

void ml::WEMPatch::translate ( const Vector3 & offset)

Translate all nodes by the given offset.

◆ triangulate()

void ml::WEMPatch::triangulate ( WEMTrianglePatch * wemPatch,
TriangulationModes triangulationMode )

Triangulates the patch and adds triangles to the given triangle patch.

Friends And Related Symbol Documentation

◆ WEMPatchPersistence

Definition at line 366 of file WEMPatch.h.

Member Data Documentation

◆ _attributes

WEMAttributes ml::WEMPatch::_attributes
protected

The attributes of this WEMPatch.

Definition at line 353 of file WEMPatch.h.

◆ _blocksize

unsigned int ml::WEMPatch::_blocksize
protected

Initial blocksize for the WEMVector, WEMObjectVector variables used.

Definition at line 338 of file WEMPatch.h.

◆ _boundingBox

WEMBoundingBox ml::WEMPatch::_boundingBox
protected

The bounding box of this WEMPatch.

Definition at line 355 of file WEMPatch.h.

◆ _creatorId

int ml::WEMPatch::_creatorId
protected

ID of the creator of this WEMPatch.

Definition at line 350 of file WEMPatch.h.

◆ _edges

WEMIndexVector<WEMEdge> ml::WEMPatch::_edges
protected

The vector that holds all the edges of the wem.

Definition at line 342 of file WEMPatch.h.

◆ _nodes

WEMIndexVector<WEMNode> ml::WEMPatch::_nodes
protected

The vector that holds all the nodes of the wem.

Definition at line 340 of file WEMPatch.h.

◆ _primitiveValueLists

std::vector<WEMPrimitiveValueList*> ml::WEMPatch::_primitiveValueLists
protected

The registered primitive value lists vector.

Definition at line 358 of file WEMPatch.h.

◆ _type

std::string ml::WEMPatch::_type
protected

Type of this WEMPatch.

Definition at line 348 of file WEMPatch.h.

◆ _uniqueId

unsigned int ml::WEMPatch::_uniqueId {}
protected

Unique ID of this WEM.

Definition at line 346 of file WEMPatch.h.

◆ _wem

WEM* ml::WEMPatch::_wem {}
protected

A pointer to the WEM this WEMPart is in.

Definition at line 344 of file WEMPatch.h.


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