MeVisLab Toolbox Reference
Loading...
Searching...
No Matches
SoCSOCreatorEditorExtension.h
Go to the documentation of this file.
1/*************************************************************************************
2**
3** Copyright 2012, 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
16
17#pragma once
18
20
22
23
25
29{
30 SO_NODE_ABSTRACT_HEADER(SoCSOCreatorEditorExtension);
31
32public:
34 static void initClass();
35
37 bool canCreateCSOs() const override
38 {
39 return true;
40 }
41
43 int cursorShape() const override
44 {
45 return createCursor.getValue();
46 }
47
48 // Fields
49
56
61
67
96
97protected:
100
101 void initMembers() override;
102
107 {
109 return generatorAddCSO(csoList);
110 }
111
113 int getModuleCreatorId() const override
114 {
115 return moduleCreatorId.getValue();
116 }
118 std::string getModuleType() const override
119 {
120 return moduleCreatorString.getValue().getString();
121 }
122
124 void setCreationData(const SoPointerPosition& pos, ml::CSO* newCSO) override;
125
128
131 bool getShouldEmptyBeforeGeneration() const override
132 {
133 return shouldEmptyGroupBeforeGenerating.getValue() == 1;
134 }
136 int getAddCSOToGroupMode() const override
137 {
138 return addCSOToGroupMode.getValue();
139 }
141 std::string getAddCSOToGroupLabel() const override
142 {
143 return addCSOToGroupLabel.getValue().getString();
144 }
146 int getAddCSOToGroupId() const override
147 {
148 return addCSOToGroupId.getValue();
149 }
150
152 int getDefaultPathPointStyle() const override
153 {
154 return defaultPathPointStyle.getValue();
155 }
157 float getDefaultPathPointWidth() const override
158 {
159 return defaultPathPointWidth.getValue();
160 }
163 {
164 SbVec3f color = defaultPathPointColor.getValue();
165 return ml::Vector3(color[0], color[1], color[2]);
166 }
168 float getDefaultPathPointAlpha() const override
169 {
170 return defaultPathPointAlpha.getValue();
171 }
172
174 int getDefaultSeedPointStyle() const override
175 {
176 return defaultSeedPointStyle.getValue();
177 }
179 float getDefaultSeedPointSize() const override
180 {
181 return defaultSeedPointSize.getValue();
182 }
185 {
186 SbVec3f color = defaultSeedPointColor.getValue();
187 return ml::Vector3(color[0], color[1], color[2]);
188 }
190 float getDefaultSeedPointAlpha() const override
191 {
192 return defaultSeedPointAlpha.getValue();
193 }
194
196 int getDefaultVoxelWriteMode() const override
197 {
198 return defaultVoxelWriteMode.getValue();
199 }
201 float getDefaultVoxelWriteValue() const override
202 {
203 return defaultVoxelWriteValue.getValue();
204 }
205
207 ml::CSO* getActiveCSO() const override
208 {
209 return _newCSO ? _newCSO : _hitCSO;
210 }
211
215
218
221};
222
#define SOCSO_EXPORT
Header file for system independent resolution.
Definition SoCSOSystem.h:21
Base class for extensions that extend the editor with interaction and rendering for specific CSO type...
SoSFFloat defaultSeedPointSize
Sets the default seed point size.
std::string getModuleType() const override
Returns the module's type string.
SoSFBool shouldEmptyGroupBeforeGenerating
Should the CSO group be emptied before generating new CSOs into it?
static void initClass()
init class in inventor runtime
int getAddCSOToGroupMode() const override
Returns the group generation mode.
SoSFEnum defaultPathPointStyle
Sets the default path point style.
float getDefaultPathPointAlpha() const override
Returns the set default path point alpha for a new CSO.
ml::Vector3 getDefaultSeedPointColor() const override
Returns the set default seed point color for a new CSO.
int cursorShape() const override
Returns the cursor shape that indicates the next creation.
void initMembers() override
SoSFString labelPrefixString
Sets a label prefix string.
int getAddCSOToGroupId() const override
Returns the id of a target group.
SoSFInt32 pointerPositionEpsilonForCreatingCSO
The pointer position movement epsilon distance in pixel to trigger CSO creation.
SoSFInt32 moduleCreatorId
Sets the module's creator id.
SoSFString moduleCreatorString
Sets the module's type string.
float getDefaultPathPointWidth() const override
Returns the set default path point width for a new CSO.
SoSFColor defaultSeedPointColor
Sets the default seed point color.
ml::CSO * getActiveCSO() const override
Returns the currently active CSO.
SoSFFloat defaultPathPointAlpha
Sets the default path point alpha.
bool getShouldEmptyBeforeGeneration() const override
Returns whether the module should empty a group before generating CSOs into it.
std::string getAddCSOToGroupLabel() const override
Returns the label string of a target group.
SoSFInt32 addCSOToGroupId
Sets the group's id for CSO generation.
SoSFFloat defaultSeedPointAlpha
Sets the default seed point alpha.
ml::Vector3 getDefaultPathPointColor() const override
Returns the set default path point color for a new CSO.
float getDefaultSeedPointSize() const override
Returns the set default seed point size for a new CSO.
int getDefaultVoxelWriteMode() const override
Returns the set default voxel write mode for a new CSO.
ml::CSO * editorAddCSO(ml::CSOList *csoList)
Adds and returns a new CSO.
float getDefaultSeedPointAlpha() const override
Returns the set default seed point alpha for a new CSO.
SoSFEnum addCSOToGroupMode
Sets whether the group's label or its id should be used for cso-into-group generation.
int getModuleCreatorId() const override
Returns the module's creator id.
SoSFEnum defaultVoxelWriteMode
Sets the default voxel write mode.
int getDefaultSeedPointStyle() const override
Returns the set default seed point style for a new CSO.
SoSFFloat defaultPathPointWidth
Sets the default path point width.
int getMaxAvailableId()
Returns the current id for CSOs created by this editor. It is the maximum available id.
SoSFEnum defaultSeedPointStyle
Sets the default seed point style.
void setCreationData(const SoPointerPosition &pos, ml::CSO *newCSO) override
Sets creation data to a newly created CSO.
float getDefaultVoxelWriteValue() const override
Returns the set default voxel write value for a new CSO.
SoSFFloat defaultVoxelWriteValue
Sets the default voxel write value.
int getDefaultPathPointStyle() const override
Returns the set default path point style for a new CSO.
SoSFColor defaultPathPointColor
Sets the default path point color.
SoSFString addCSOToGroupLabel
Sets the group's label for CSO generation.
bool isFartherThanEpsilon(const SoPointerPosition &pos) const
Returns whether the given position is farther away from the start position than the epsilon in pixel.
SoCSOCreatorEditorExtension()
Hidden constructor.
bool canCreateCSOs() const override
Returns whether the editor can create a CSO.
SoSFBool requirePointerPositionMovementToCreateCSO
Should the mouse have to be moved a bit before creating a CSO?
SbVec2f _startDevicePointerPosition
The device position of the pointer at creation start.
Base class for an editor extension for the SoView2DCSOExtensibleEditor.
SoPointerPosition manages the current position of the mouse cursor.
void generatorEmptyGroupOnDemand(CSOList *csoList)
Empties a CSOGroup on demand of the given CSOList with the set label.
CSO * generatorAddCSO(CSOList *csoList, bool useUndoRedo=true)
Adds a new CSO to the CSOList.
A CSOList comprises a number of CSOs and CSOGroups and is the central object for contour segmentation...
Definition CSOList.h:61
The CSO represents a contour segmentation object.
Definition CSO.h:44
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
Tvec3< MLdouble > Vector3
A vector with three components of type double.
Definition mlVector3.h:274