MeVisLab Toolbox Reference
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:
33
35 static void initClass();
36
38 bool canCreateCSOs() const override { return true; }
39
41 int cursorShape() const override { return createCursor.getValue(); }
42
43 // Fields
44
46 SoSFInt32 moduleCreatorId;
51
56
58 SoSFEnum createCursor;
59 SoSFEnum moveAllCursor;
62
70 SoSFInt32 addCSOToGroupId;
91
92protected:
93
96
97 void initMembers() override;
98
104 return generatorAddCSO(csoList);
105 }
106
108 int getModuleCreatorId() const override { return moduleCreatorId.getValue(); }
110 std::string getModuleType() const override { return moduleCreatorString.getValue().getString(); }
111
113 void setCreationData(const SoPointerPosition& pos, ml::CSO* newCSO) override;
114
117
120 bool getShouldEmptyBeforeGeneration() const override { return shouldEmptyGroupBeforeGenerating.getValue() == 1; }
122 int getAddCSOToGroupMode() const override { return addCSOToGroupMode.getValue(); }
124 std::string getAddCSOToGroupLabel() const override { return addCSOToGroupLabel.getValue().getString(); }
126 int getAddCSOToGroupId() const override { return addCSOToGroupId.getValue(); }
127
129 int getDefaultPathPointStyle() const override { return defaultPathPointStyle.getValue(); }
131 float getDefaultPathPointWidth() const override { return defaultPathPointWidth.getValue(); }
134 {
135 SbVec3f color = defaultPathPointColor.getValue();
136 return ml::Vector3(color[0], color[1], color[2]);
137 }
139 float getDefaultPathPointAlpha() const override { return defaultPathPointAlpha.getValue(); }
140
142 int getDefaultSeedPointStyle() const override { return defaultSeedPointStyle.getValue(); }
144 float getDefaultSeedPointSize() const override { return defaultSeedPointSize.getValue(); }
147 {
148 SbVec3f color = defaultSeedPointColor.getValue();
149 return ml::Vector3(color[0], color[1], color[2]);
150 }
152 float getDefaultSeedPointAlpha() const override { return defaultSeedPointAlpha.getValue(); }
153
155 int getDefaultVoxelWriteMode() const override { return defaultVoxelWriteMode.getValue(); }
157 float getDefaultVoxelWriteValue() const override { return defaultVoxelWriteValue.getValue(); }
158
160 ml::CSO* getActiveCSO() const override { return _newCSO ? _newCSO: _hitCSO; }
161
165
168
171};
172
#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
Tvec3< MLdouble > Vector3
A vector with three components of type double.
Definition mlVector3.h:286