MeVisLab Toolbox Reference
CSOBulgeProcessor.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 #ifndef CSOBULGE_PROCESSOR_H
14 #define CSOBULGE_PROCESSOR_H
15 
16 
18 
19 #include "SoCSOSystem.h"
21 
22 
23 ML_START_NAMESPACE
24 
25 
27 
30 {
31 
32 public:
33 
36 
39  bool process(CSOEvalEventView2DInfos view2DInfos, CSOEvalEventCSOInfos csoInfos) override;
40 
43  bool needsMemoryImage() override;
44 
46  bool isCurrentlyGenerating() override;
48  bool isCurrentlyEditing() override;
50  bool couldCloseCSO() override;
51 
53  void resetInteractionState() override;
54 
56  void triggerSetMouseCursor(SoView2D* view2d, bool shouldSetMouseCursor) override;
57 
58 protected:
59 
61  ~CSOBulgeProcessor() override;
62 
64  void activateAttachments() override;
65 
67  void handleNotification(Field* field) override;
68 
69 private:
70 
71  /* FIELDS */
72 
74  IntField* _influenceRangeFld;
76  BoolField* _restrictToCurvatureFld;
78  FloatField* _angleLimitFld;
80  BoolField* _adaptInfluenceWhileInteractingFld;
82  BoolField* _adaptInfluenceByDistanceFld;
83 
84  /* MEMBER VARIABLES */
85 
87  CSOList* _csoList;
88 
90  Vector3 _currentHitPointWorld;
92  Vector3 _startPointWorld;
93 
95  float _currentHitXPos;
97  float _currentHitYPos;
99  float _currentHitZPos;
100 
102  float _startHitXPos;
104  float _startHitYPos;
106  float _startHitZPos;
107 
109  int _timePoint;
110 
112  CSO* _currentlyActiveCSO;
114  CSOSeedPoint* _currentlyActiveSeedPoint;
116  CSOPathPoints* _currentlyActivePathPoints;
117 
119  bool _isMovingSeedPoint;
120 
121 
122  /* METHODS */
123 
126  void _convertCurrentCSO();
128  void _computeWeightsForCurrentCSO(View2DSliceList* slicelist);
130  float _getScreenDistance(View2DSliceList* slicelist, const Vector3& worldPos1, const Vector3& worldPos2);
133  void _getNormalAt(unsigned int pathIndex, unsigned int pointIndex, Vector3& normal);
135  float _getDeformationValue(float factor);
136 
138 };
139 
141 
142 
143 ML_END_NAMESPACE
144 
145 
146 #endif //__CSOBulgeProcessor_H
147 
#define SOCSO_EXPORT
Header file for system independent resolution.
Definition: SoCSOSystem.h:21
SoView2D is a 2D viewer for image data.
Definition: SoView2D.h:62
a list that holds all View2DSlice objects (lazily created) of a SoView2D
Field to encapsulate a boolean value.
Definition: mlFields.h:62
Module which allows for an interactive bulging of CSOs of all types.
bool couldCloseCSO() override
Returns whether the processor could close an open CSO by the processor's rules.
bool isCurrentlyEditing() override
Returns whether the processor is currently editing an existing contour.
~CSOBulgeProcessor() override
Standard destructor.
void activateAttachments() override
Initializes module after loading.
bool isCurrentlyGenerating() override
Returns whether the processor is currently generating a new contour.
bool process(CSOEvalEventView2DInfos view2DInfos, CSOEvalEventCSOInfos csoInfos) override
Processes the interaction events and interpolates the contours accordingly.
void handleNotification(Field *field) override
Called when input changes.
void resetInteractionState() override
Sets back the internal interaction state.
void triggerSetMouseCursor(SoView2D *view2d, bool shouldSetMouseCursor) override
Triggers the setting of the processors default mouse cursor.
CSOBulgeProcessor()
Standard constructor.
bool needsMemoryImage() override
Returns whether the processor need the current memory image for interpolation.
A CSOList comprises a number of CSOs and CSOGroups and is the central object for contour segmentation...
Definition: CSOList.h:61
The CSOPathPoints is a list of world coordinates which are interpolated by a certain interpolation sc...
Definition: CSOPathPoints.h:37
Base class for processor modules; those provide mechanisms for an interactive generation of seed poin...
Definition: CSOProcessor.h:42
The CSOSeedPoint can be interactively set and modified and is the framework for contours.
Definition: CSOSeedPoint.h:35
The CSO represents a contour segmentation object.
Definition: CSO.h:44
Base class for all fields used in the ML.
Definition: mlField.h:73
Field to encapsulate a float value.
Definition: mlFields.h:627
Field to encapsulate an integer value.
Definition: mlFields.h:161
#define ML_MODULE_CLASS_HEADER(className)
Like ML_CLASS_HEADER for the usage of derived classes from Module.