MeVisLab Toolbox Reference
WEMFaceCut.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 
16 
17 ML_START_NAMESPACE
18 
20 
21 const int WEMFACECUT_SINGLE_PART = 0;
24 const int WEMFACECUT_SAME_EDGE = 3;
25 const int WEMFACECUT_STAB = 4;
26 
28 
31 {
32 public:
33 
39  void clear();
40 
42  inline int getType() const { return _type; }
44  inline Vector3 getEntryPosition() const { return _entryPosition; }
46  inline Vector3 getExitPosition() const { return _exitPosition; }
48  inline int getEntryEdgeIndex() const { return _entryEdgeIndex; }
50  inline int getExitEdgeIndex() const { return _exitEdgeIndex; }
52  inline int getEntryFaceIndex() const { return _entryFaceIndex; }
54  inline int getExitFaceIndex() const { return _exitFaceIndex; }
56  inline bool isTraversed() const { return _traversed; }
58  inline bool isValid() const { return _valid; }
59 
61  bool isContinuable(int edgeIndex, int degenerateEdgeIndex) const;
63  bool isContinuable(Vector3 position) const;
65  bool isStabClosed(Vector3 position) const;
66 
68  inline void setType(int type) { _type = type; }
70  void checkSameEdge();
72  void setEntry(Vector3 position, int edgeIndex, int faceIndex);
74  void setExit(Vector3 position, int edgeIndex, int faceIndex);
76  void addIntermediatePoint(Vector3 position, int entryNumber, int degenerateEntryNumber);
78  inline void setTraversed(bool traversed) { _traversed = traversed; }
80  inline void setValid(bool valid) { _valid = valid; }
81 
83  std::vector<Vector3> intermediatePoints;
85  std::vector<int> intermediateEdgeEntryNumbers;
88 
89 private:
90 
92  int _type;
94  int _entryEdgeIndex;
96  int _exitEdgeIndex;
98  Vector3 _entryPosition;
100  Vector3 _exitPosition;
102  int _entryFaceIndex;
104  int _exitFaceIndex;
106  bool _traversed;
108  bool _valid;
109 };
110 
112 
113 ML_END_NAMESPACE
#define MLWEM_EXPORT
Definition: MLWEMSystem.h:18
Helper class for performing a cutting on a face.
Definition: WEMFaceCut.h:31
void clear()
Clears the internal structure.
void setValid(bool valid)
Sets the valid flag.
Definition: WEMFaceCut.h:80
Vector3 getExitPosition() const
Returns the exit position.
Definition: WEMFaceCut.h:46
void checkSameEdge()
Updates the type to SAME_EDGE if entry and exit edge are the same.
std::vector< Vector3 > intermediatePoints
Intermediate points.
Definition: WEMFaceCut.h:83
void setType(int type)
Sets the type.
Definition: WEMFaceCut.h:68
Vector3 getEntryPosition() const
Returns the entry position.
Definition: WEMFaceCut.h:44
void setTraversed(bool traversed)
Sets the traversed flag.
Definition: WEMFaceCut.h:78
bool isValid() const
Returns whether this face cut is valid.
Definition: WEMFaceCut.h:58
void setEntry(Vector3 position, int edgeIndex, int faceIndex)
Sets the entry.
std::vector< int > intermediateEdgeEntryNumbers
Intermediate edge entry numbers.
Definition: WEMFaceCut.h:85
~WEMFaceCut()
Standard destructor.
WEMFaceCut()
Standard constructor.
int getType() const
Returns the type.
Definition: WEMFaceCut.h:42
bool isContinuable(int edgeIndex, int degenerateEdgeIndex) const
Returns whether this face cut can be continued.
int getEntryFaceIndex() const
Returns the entry face index.
Definition: WEMFaceCut.h:52
int getEntryEdgeIndex() const
Returns the entry edge index.
Definition: WEMFaceCut.h:48
std::vector< int > intermediateDegenerateEdgeEntryNumbers
Intermediate degenerate edge entry numbers.
Definition: WEMFaceCut.h:87
bool isStabClosed(Vector3 position) const
Returns whether the stab is closed.
int getExitFaceIndex() const
Returns the exit face index.
Definition: WEMFaceCut.h:54
void addIntermediatePoint(Vector3 position, int entryNumber, int degenerateEntryNumber)
Adds a new intermediate point.
bool isContinuable(Vector3 position) const
Returns whether this face cut (stab) can be continued.
int getExitEdgeIndex() const
Returns the exit edge index.
Definition: WEMFaceCut.h:50
bool isTraversed() const
Returns whether this face cut is traversed.
Definition: WEMFaceCut.h:56
void setExit(Vector3 position, int edgeIndex, int faceIndex)
Sets the exit.
const int WEMFACECUT_STAB
Local cut definition: stab.
Definition: WEMFaceCut.h:25
const int WEMFACECUT_SINGLE_INTERMEDIATE
Local cut definition: single intermediate.
Definition: WEMFaceCut.h:22
const int WEMFACECUT_SAME_EDGE
Local cut definition: same edge.
Definition: WEMFaceCut.h:24
const int WEMFACECUT_MULTI_INTERMEDIATE
Local cut definition: multi intermediate.
Definition: WEMFaceCut.h:23
const int WEMFACECUT_SINGLE_PART
Local cut definition: single part.
Definition: WEMFaceCut.h:21