MeVisLab Toolbox Reference
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:
26
28 WEMQuadPatch(unsigned int bs = 8192);
31 WEMQuadPatch(WEM* wem, unsigned int bs = 8192);
37 ~WEMQuadPatch() override;
39 WEMPatch* copy() override;
41 virtual void dispose();
42
44 inline PatchTypes getPatchType() const override { return WEM_PATCH_QUADS; }
45
47
49 inline unsigned int getNumFaces() const override { return _quads.num(); }
51 inline WEMIndexVector<WEMQuad>* getFaces() { return &_quads; }
53 inline const WEMIndexVector<WEMQuad>* getFaces() const { return const_cast<WEMQuadPatch*>(this)->getFaces(); }
54
56
58 inline WEMFace* getFaceAt(unsigned int index) override { return _quads.at(index); }
60 inline const WEMFace* getFaceAt(unsigned int index) const override { return const_cast<WEMQuadPatch*>(this)->getFaceAt(index); }
62 inline WEMQuad* getQuadAt(unsigned int index) { return _quads.at(index); }
64 inline const WEMQuad* getQuadAt(unsigned int index) const { return const_cast<WEMQuadPatch*>(this)->getQuadAt(index); }
66 WEMFace* addFace() override;
74
76
78 void sortFacesByZPosition() override;
79
80private:
83};
84
86
#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:48
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:88
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.