MeVisLab Toolbox Reference
Loading...
Searching...
No Matches
WEMPolygonPatch.h
Go to the documentation of this file.
1/*************************************************************************************
2**
3** Copyright 2007, MeVis Medical Solutions AG
4**
5** The user may use this file in accordance with the license agreement provided with
6** the Software or, alternatively, in accordance with the terms contained in a
7** written agreement between the user and MeVis Medical Solutions AG.
8**
9** For further information use the contact form at https://www.mevislab.de/contact
10**
11**************************************************************************************/
12
13#pragma once
14
15#include "WEMPatch.h"
16#include "WEMPolygon.h"
17#include "WEMIndexedFace.h"
18
20
22
25{
26public:
28 WEMPolygonPatch(unsigned int bs = 8192);
31 WEMPolygonPatch(WEM* wem, unsigned int bs = 8192);
37 ~WEMPolygonPatch() override;
39 WEMPatch* copy() override;
41 virtual void dispose();
42
44 inline PatchTypes getPatchType() const override
45 {
46 return WEM_PATCH_POLYGONS;
47 }
48
50
52 inline unsigned int getNumFaces() const override
53 {
54 return _polygons.num();
55 }
58 {
59 return &_polygons;
60 }
63 {
64 return const_cast<WEMPolygonPatch*>(this)->getFaces();
65 }
66
68
70 inline WEMFace* getFaceAt(unsigned int index) override
71 {
72 return _polygons.at(index);
73 }
75 inline const WEMFace* getFaceAt(unsigned int index) const override
76 {
77 return const_cast<WEMPolygonPatch*>(this)->getFaceAt(index);
78 }
80 inline WEMPolygon* getPolygonAt(unsigned int index)
81 {
82 return _polygons.at(index);
83 }
85 inline const WEMPolygon* getPolygonAt(unsigned int index) const
86 {
87 return const_cast<WEMPolygonPatch*>(this)->getPolygonAt(index);
88 }
91 WEMFace* addFace() override;
99
101
104
106 void sortFacesByZPosition() override;
107
108private:
111};
112
114
#define MLWEM_EXPORT
Definition MLWEMSystem.h:18
Defines the mesh component: face.
Definition WEMFace.h:30
Dynamic vector, based on a memory pool. Keeps track on entry numbers of stored primitives.
Defines the mesh component: an face holding a list of up to 100 indices.
Base class for triangle and quad patches.
Definition WEMPatch.h:61
virtual WEMFace * getFaceAt(unsigned int index)=0
Returns the face at the given index.
This represents a WEMPatch consisting of polygons only.
void convertIndexedFace(WEMIndexedFace *indexedFace)
Adds the given indexed face to this patch.
WEMPatch * copy() override
Create a (deep) copy of the patch.
WEMPolygon * getPolygonAt(unsigned int index)
Returns the WEMPolygon at the given index.
WEMPolygonPatch(WEM *wem, unsigned int bs=8192)
Constructor which takes a pointer to the WEM this WEMPatch is in.
virtual void dispose()
Disposes of internal data structures.
const WEMFace * getFaceAt(unsigned int index) const override
Returns the face at the given index.
WEMPolygonPatch(unsigned int bs=8192)
Standard constructor.
WEMPolygonPatch(WEMPolygonPatch &&wemPatch) noexcept
PatchTypes getPatchType() const override
Returns the mesh type of this patch.
const WEMIndexVector< WEMPolygon > * getFaces() const
Returns the pointer to the internal faces structure.
WEMPolygon * addPolygon()
Instantiates a new WEMPolygon and adds it to the internal faces vector.
WEMPolygonPatch & operator=(WEMPolygonPatch &&wemPatch) noexcept
void sortFacesByZPosition() override
Sorts the faces by the z-position of their centroids.
WEMIndexVector< WEMPolygon > * getFaces()
Returns the pointer to internal faces structure.
~WEMPolygonPatch() override
Standard destructor.
WEMPolygonPatch(const WEMPolygonPatch &wemPatch)
Copy constructor.
WEMFace * addFace() override
Instantiates a new WEMPolygon and adds it to the internal faces vector.
WEMFace * getFaceAt(unsigned int index) override
Returns the face at the given index.
const WEMPolygon * getPolygonAt(unsigned int index) const
Returns the WEMPolygon at the given index.
unsigned int getNumFaces() const override
Returns the number of faces in the patch.
void delPolygon(WEMPolygon *polygon)
Deletes a polygon and erases it from the internal faces vector.
WEMPolygon * addPolygonNoUpdatePrimitiveValueLists()
Creates and returns a new polygon without adding an entry to the face PLVs.
Defines the mesh component: polygon.
Definition WEMPolygon.h:22
A WEM comprises a number of WEMPatches.
Definition WEM.h:86
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
PatchTypes
Enumeration of mesh types.
@ WEM_PATCH_POLYGONS
Patch type: the faces can be n-polygons with up to WEM_MAX_NUM_NODES.