MeVisLab Toolbox Reference
Loading...
Searching...
No Matches
WEMQuadPatch.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 "WEMQuad.h"
17
19
21
24{
25public:
27 WEMQuadPatch(unsigned int bs = 8192);
30 WEMQuadPatch(WEM* wem, unsigned int bs = 8192);
36 ~WEMQuadPatch() override;
38 WEMPatch* copy() override;
40 virtual void dispose();
41
43 inline PatchTypes getPatchType() const override
44 {
45 return WEM_PATCH_QUADS;
46 }
47
49
51 inline unsigned int getNumFaces() const override
52 {
53 return _quads.num();
54 }
57 {
58 return &_quads;
59 }
61 inline const WEMIndexVector<WEMQuad>* getFaces() const
62 {
63 return const_cast<WEMQuadPatch*>(this)->getFaces();
64 }
65
67
69 inline WEMFace* getFaceAt(unsigned int index) override
70 {
71 return _quads.at(index);
72 }
74 inline const WEMFace* getFaceAt(unsigned int index) const override
75 {
76 return const_cast<WEMQuadPatch*>(this)->getFaceAt(index);
77 }
79 inline WEMQuad* getQuadAt(unsigned int index)
80 {
81 return _quads.at(index);
82 }
84 inline const WEMQuad* getQuadAt(unsigned int index) const
85 {
86 return const_cast<WEMQuadPatch*>(this)->getQuadAt(index);
87 }
89 WEMFace* addFace() override;
97
99
101 void sortFacesByZPosition() override;
102
103private:
106};
107
109
#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.
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 quads only.
WEMIndexVector< WEMQuad > * getFaces()
Returns the pointer to the internal faces structure.
const WEMIndexVector< WEMQuad > * getFaces() const
Returns the pointer to the internal faces structure.
WEMFace * addFace() override
Instantiates a new WEMQuad and adds it to the internal faces vector. Returns a pointer to this newly ...
WEMQuadPatch(WEM *wem, unsigned int bs=8192)
Constructor which takes a pointer to the WEM this WEMPatch is in.
PatchTypes getPatchType() const override
Get mesh type.
void delQuad(WEMQuad *quad)
Deletes a quad and erases it from the internal faces vector.
WEMQuadPatch(unsigned int bs=8192)
Standard constructor.
WEMPatch * copy() override
Create a (deep) copy of the patch.
WEMQuad * addQuad()
Instantiates a new WEMQuad and adds it to the internal faces vector.
const WEMQuad * getQuadAt(unsigned int index) const
Returns the WEMQuad at the given index.
~WEMQuadPatch() override
Standard destructor.
WEMFace * getFaceAt(unsigned int index) override
Returns the face at the given index.
WEMQuadPatch(WEMQuadPatch &&wemPatch) noexcept
WEMQuad * getQuadAt(unsigned int index)
Returns the WEMQuad at the given index.
WEMQuadPatch(const WEMQuadPatch &wemPatch)
Copy constructor.
void sortFacesByZPosition() override
Sorts the faces by the z-position of their centroids.
virtual void dispose()
Disposes of internal data structures.
WEMQuad * addQuadNoUpdatePrimitiveValueLists()
Creates and return a new quad without adding any entry to the the face PVLs.
const WEMFace * getFaceAt(unsigned int index) const override
Returns the face at the given index.
unsigned int getNumFaces() const override
Returns the number of faces in the patch.
WEMQuadPatch & operator=(WEMQuadPatch &&wemPatch) noexcept
Defines the mesh component: quad.
Definition WEMQuad.h:25
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_QUADS
Patch type: all faces are quads.