MeVisLab Toolbox Reference
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:
27
29 WEMPolygonPatch(unsigned int bs = 8192);
32 WEMPolygonPatch(WEM* wem, unsigned int bs = 8192);
38 ~WEMPolygonPatch() override;
40 WEMPatch* copy() override;
42 virtual void dispose();
43
45 inline PatchTypes getPatchType() const override { return WEM_PATCH_POLYGONS; }
46
48
50 inline unsigned int getNumFaces() const override { return _polygons.num(); }
52 inline WEMIndexVector<WEMPolygon>* getFaces() { return &_polygons; }
54 inline const WEMIndexVector<WEMPolygon>* getFaces() const { return const_cast<WEMPolygonPatch*>(this)->getFaces(); }
55
57
59 inline WEMFace* getFaceAt(unsigned int index) override { return _polygons.at(index); }
61 inline const WEMFace* getFaceAt(unsigned int index) const override { return const_cast<WEMPolygonPatch*>(this)->getFaceAt(index); }
63 inline WEMPolygon* getPolygonAt(unsigned int index) { return _polygons.at(index); }
65 inline const WEMPolygon* getPolygonAt(unsigned int index) const { return const_cast<WEMPolygonPatch*>(this)->getPolygonAt(index); }
67 WEMFace* addFace() override;
75
77
80
82 void sortFacesByZPosition() override;
83
84private:
87};
88
90
#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:48
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. Returns a pointer to this new...
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:88
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.