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 
18 ML_START_NAMESPACE
19 
21 
24 {
25 public:
26 
28  WEMQuadPatch(unsigned int bs = 8192);
31  WEMQuadPatch(WEM* wem, unsigned int bs = 8192);
33  WEMQuadPatch(const WEMQuadPatch &wemPatch);
34  WEMQuadPatch(WEMQuadPatch &&wemPatch) noexcept;
35  WEMQuadPatch& operator=(WEMQuadPatch &&wemPatch) noexcept;
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;
73  void delQuad(WEMQuad* quad);
74 
76 
78  void sortFacesByZPosition() override;
79 
80 private:
83 };
84 
86 
87 ML_END_NAMESPACE
#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.
Definition: WEMQuadPatch.h:24
const WEMQuad * getQuadAt(unsigned int index) const
Returns the WEMQuad at the given index.
Definition: WEMQuadPatch.h:64
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.
Definition: WEMQuadPatch.h:44
void delQuad(WEMQuad *quad)
Deletes a quad and erases it from the internal faces vector.
WEMQuadPatch(unsigned int bs=8192)
Standard constructor.
WEMQuad * getQuadAt(unsigned int index)
Returns the WEMQuad at the given index.
Definition: WEMQuadPatch.h:62
const WEMIndexVector< WEMQuad > * getFaces() const
Returns the pointer to the internal faces structure.
Definition: WEMQuadPatch.h:53
WEMIndexVector< WEMQuad > * getFaces()
Returns the pointer to the internal faces structure.
Definition: WEMQuadPatch.h:51
WEMQuadPatch & operator=(WEMQuadPatch &&wemPatch) noexcept
~WEMQuadPatch() override
Standard destructor.
const WEMFace * getFaceAt(unsigned int index) const override
Returns the face at the given index.
Definition: WEMQuadPatch.h:60
WEMQuadPatch(WEMQuadPatch &&wemPatch) noexcept
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.
WEMFace * getFaceAt(unsigned int index) override
Returns the face at the given index.
Definition: WEMQuadPatch.h:58
unsigned int getNumFaces() const override
Returns the number of faces in the patch.
Definition: WEMQuadPatch.h:49
WEMQuad * addQuad()
Instantiates a new WEMQuad and adds it to the internal faces vector.
WEMFace * addFace() override
Instantiates a new WEMQuad and adds it to the internal faces vector. Returns a pointer to this newly ...
WEMPatch * copy() override
Create a (deep) copy of the patch.
WEMQuad * addQuadNoUpdatePrimitiveValueLists()
Creates and return a new quad without adding any entry to the the face PVLs.
Defines the mesh component: quad.
Definition: WEMQuad.h:25
A WEM comprises a number of WEMPatches.
Definition: WEM.h:88
PatchTypes
Enumeration of mesh types.
@ WEM_PATCH_QUADS
Patch type: all faces are quads.