85 INTERACTION_MODE_EDIT = 0,
86 INTERACTION_MODE_MOVE = 1
94 TOGGLE_MODE_CONTROL = 2,
103 EDIT_OP_KEY_MOD_NONE = 0,
104 EDIT_OP_KEY_MOD_ALT = 1,
105 EDIT_OP_KEY_MOD_CONTROL = 2,
106 EDIT_OP_KEY_MOD_SHIFT = 3
112 EDIT_OP_KEY_A, EDIT_OP_KEY_B, EDIT_OP_KEY_C, EDIT_OP_KEY_D, EDIT_OP_KEY_E, EDIT_OP_KEY_F,
113 EDIT_OP_KEY_G, EDIT_OP_KEY_H, EDIT_OP_KEY_I, EDIT_OP_KEY_J, EDIT_OP_KEY_K, EDIT_OP_KEY_L,
114 EDIT_OP_KEY_M, EDIT_OP_KEY_N, EDIT_OP_KEY_O, EDIT_OP_KEY_P, EDIT_OP_KEY_Q, EDIT_OP_KEY_R,
115 EDIT_OP_KEY_S, EDIT_OP_KEY_T, EDIT_OP_KEY_U, EDIT_OP_KEY_V, EDIT_OP_KEY_W, EDIT_OP_KEY_X,
269 WR_ODD = GLU_TESS_WINDING_ODD,
270 WR_NONZERO = GLU_TESS_WINDING_NONZERO,
271 WR_POSITIVE = GLU_TESS_WINDING_POSITIVE,
272 WR_NEGATIVE = GLU_TESS_WINDING_NEGATIVE,
273 WR_ABS_GEQ_TWO = GLU_TESS_WINDING_ABS_GEQ_TWO
305 LABEL_SHOW_CSO_LABEL = 1,
306 LABEL_SHOW_CSO_DESCRIPTION = 2,
307 LABEL_SHOW_CSO_ID = 3,
308 LABEL_SHOW_CSO_INDEX = 4,
309 LABEL_SHOW_GROUP_LABEL = 5,
310 LABEL_SHOW_GROUP_DESCRIPTION = 6,
311 LABEL_SHOW_GROUP_ID = 7,
312 LABEL_SHOW_GROUP_INDEX = 8,
313 LABEL_SHOW_CSO_LENGTH = 9,
314 LABEL_SHOW_CSO_AREA = 10
327 LABEL_ALIGN_TOP_LEFT = 0,
328 LABEL_ALIGN_TOP_RIGHT = 1,
329 LABEL_ALIGN_BOTTOM_LEFT = 2,
330 LABEL_ALIGN_BOTTOM_RIGHT = 3,
332 LABEL_ALIGN_BOTTOM = 5,
333 LABEL_ALIGN_LEFT = 6,
334 LABEL_ALIGN_RIGHT = 7,
335 LABEL_ALIGN_CENTER = 8
341 LABEL_UNIT_SCALE_MM = 0,
342 LABEL_UNIT_SCALE_CM = 1,
343 LABEL_UNIT_SCALE_M = 2
449 CSOCrossings() {cso=
nullptr;sorted=
false;needsFilling=
false;}
450 std::vector < CrossingPoint > crossingPoints;
455 std::vector<CSOCrossings> crossings;
457 struct GroupBoundingBox
459 GroupBoundingBox() { group =
nullptr; firstCSOInGroup =
nullptr; }
464 std::vector<GroupBoundingBox> groupBoundingBoxes;
473 bool _isInNotificationCB;
475 bool _isNotifyingMyselfRepaint;
489 ml::CSO* _currentlyUnderMouseCursorCSO;
491 std::vector<ml::CSO*>_copiedCSOs;
497 int _startingTimePoint;
499 bool _isCurrentlyMovingCSOs;
511 SbVec3f _startWorldPositionCutCopy;
513 SbVec3f _currentWorldPosition;
516 SbVec3f _offsetVectorWorld;
518 bool _hasValidStylePalette;
526 bool _isMultiSelectionEnabled;
529 unsigned int _imageSerialNumber;
532 std::map <int, std::vector<int> > _csoGroupIds;
536 void inCSOListChanged(SoField*);
537 void inProcessorChanged(SoField*);
538 void inStylePaletteChanged(SoField*);
539 void keyChanged(SoField*);
540 void triggerCutCopyChanged(SoField*);
541 void triggerCopyChanged(SoField*);
542 void triggerPasteChanged(SoField*);
544 void notifyCSOList();
557 bool getUseIconFile()
const override {
return useIconFile.getValue() == 1; }
558 SbString
getIconFile()
const override {
return iconFile.getValue(); }
585 bool getShowSeedPoints()
const override {
return showSeedPoints.getValue() == 1; }
596 bool _evaluateKeyboardOperation(
View2DEvent* ec,
bool& deleteSeedPressed);
598 void _performCutCopySelected();
600 void _performCopySelected();
606 void _storeCopiedCSOGroupInformation();
608 void _resetInteractionClasses();
611 void _checkUniqueEditingOperationKeys();
613 static void _csoListNotificationCB(
void* userData,
int notificationFlag);
615 void doAction(SoAction *action)
override;
618 void _setMouseCursor(
SoView2D* view2D,
int mouseCursorShape);
626 SbVec3f& intersectionPoint);
632 void _glPathPointSettings(
const ml::CSO* cso);
634 void _glTessellationColor(
const ml::CSO* cso);
642 void _computeDeviceCoordinatesForLabel(
const std::string &labelText,
View2DFont* font,
float lblFontSize,
ml::CSOBoundingBox &csoVoxelBB,
View2DSlice* slice,
const float vz,
float& devX,
float& devY);
649 void _glDrawRect(
float startX,
float startY,
float endX,
float endY,
float lineWidth);
#define SOCSO_EXPORT
Header file for system independent resolution.
const int KEY_CODE_DELETE
Key code for: Delete.
INTERACTIVE_MODE
Enumeration for the interactive mode, depending on existing CSOs.
@ INTERACTIVE_MODE_MOVE_CSO
With the next click (and drag), a CSO can be moved.
@ INTERACTIVE_MODE_INSERT_SEED
With the next click a new seed point can be inserted into a CSO.
@ INTERACTIVE_MODE_CLOSE_CSO
With the next click (or release), a CSO is closed.
@ INTERACTIVE_MODE_START_CSO
With the next click, a new CSO can be started.
@ INTERACTIVE_MODE_SELECT_CSO
With the next click, a CSO is selected.
@ INTERACTIVE_MODE_EDIT_CSO
With the next click, a seed point of a CSO can be edited.
const int KEY_CODE_BCKSPC
Key code for: Backspace.
const int KEY_CODE_ENTER
Key code for: Enter.
const int KEY_CODE_SPACE
Key code for: Space.
View2DEventPhase
event phase for simple extensions that grab the focus, do something (motion) and are released afterwa...
The SoSFMLBase field is the interface used by Inventor Nodes to output ML Base objects to the outside...
virtual int getSelectionLineWidthMode() const =0
virtual bool getShowSeedPoints() const =0
virtual SbColor getSelectedSeedPointFixedColor() const =0
virtual float getSelectedSeedPointSize() const =0
virtual float getMouseOverLineWidthWidenValue() const =0
virtual float getMouseOverLineWidthLineWidth() const =0
virtual float getSelectedSeedPointBrightenColor() const =0
virtual float getSelectionTolerance() const =0
virtual bool getEnableMouseOverHighlighting() const =0
virtual SbColor getGeneralLabelColor() const =0
virtual int getSelectedSeedPointColoringMode() const =0
virtual int getStylePaletteUseIndexAs() const =0
virtual int getLabelColorMode() const =0
virtual float getGlobalAlphaFactor() const =0
virtual bool getUsePathPointColorForSeedPoints() const =0
virtual bool getShowCSOsOnAllTimePoints() const =0
virtual SbColor getMouseOverColorColor() const =0
virtual bool getUseStylePalette() const =0
virtual bool getHighlightSelectedGroups() const =0
virtual SbColor getSelectionFixedColor() const =0
virtual float getSelectionBrightenColor() const =0
virtual float getSelectedSeedPointAlpha() const =0
virtual float getSelectedSeedPointEnlargeSize() const =0
virtual bool getShouldOnlyInteractWithSelectedCSO() const =0
pure virtual access methods to fields every editor needs to implement
virtual bool getUseIconFile() const =0
virtual int getMouseOverLineWidthMode() const =0
virtual float getShowParallelThickness() const =0
virtual int getSelectedSeedPointSizeMode() const =0
virtual SbString getInternalIconFile() const =0
virtual float getSelectionFixedLineWidth() const =0
virtual float getMouseOverColorBrightenValue() const =0
virtual bool getOverwriteCurrentTimePoint() const =0
virtual int getSelectionColoringMode() const =0
virtual bool getShowOnlyParallelCSOs() const =0
virtual bool getOverwriteSelectionVisualizationSettings() const =0
virtual SbString getIconFile() const =0
virtual float getGeneralLabelAlpha() const =0
virtual int getNewCurrentTimePoint() const =0
virtual float getSelectionWidenLineWidth() const =0
virtual int getMouseOverColorMode() const =0
Provides 2D drawing and interaction for the contour segmentation objects.
SoSFEnum deleteCSOKey
Field for adjusting the key for the delete CSO operation.
SoSFFloat moveRatio
Sets the ratio of the selected CSO that need to be in the image for them to be able to be moved.
LABEL_ALIGNMENT_MODES
Enumeration of the label alignment.
bool evalEvent(SoView2D *view2d, View2DSliceList *slicelist, View2DEvent *ec, View2DEventPhase phase) override
Event handling.
SoSFString keyConfigurationStatus
Field displays the status of the key/key modifier configuration.
SoSFEnum redoKey
Field for adjusting the key for the redo operation.
~SoView2DCSOEditor() override
Standard destructor.
SoSFFloat ghostDepth
Defines the ghost depth.
SoSFBool combineLabelsForGroupsOnSlice
Shall only one label per group for all CSOs of that group on a slice be shown?
SoSFColor tessellationColor
Color for tessellation (if not as CSO).
SoSFBool shouldLevelCSO
Should the last generated / edited CSO be automatically leveled?
SoSFBool overwriteCurrentTimePoint
Should the current time point be overwritten?
SoSFFloat selectedSeedPointBrightenColor
Sets the brighten value for the color of the selected seed point.
SoSFBool highlightSelectedGroups
Should the module highlight all CSOs that are in selected Groups?
SoSFEnum labelAlignmentMode
Field for adjusting the label alignment mode.
SoSFFloat labelFontSize
Field for adjusting the font size.
SoSFFloat mouseOverColorBrightenValue
Sets the mouse-over highlighting brighten amount.
SoSFFloat selectionBrightenColor
Sets the brighten value for the selection color.
SoSFBool usePathPointColorForSeedPoints
Shall the seed points have the same color as the path points?
SoSFBool useHoleCorrection
Shall inner CSOs lead to holes in the rendering?
SoSFFloat ghostFadeOutAlpha
Defines the ghost fade out alpha (default is 0). If it is greater than 0, CSOs are drawn completely.
SoSFEnum forceStartNewCSOKeyModifier
(Modifier): If this key is pressed, a new contour is started, even if the first hit point is in the v...
SoSFBool shouldTouchItselfInEvalEvent
Should the module touch itself in the evalEvent method?
SoSFFloat mouseOverLineWidthWidenValue
Sets the mouse-over highlighting line widen amount.
SoSFFloat selectionFixedLineWidth
Sets the line width for the selection line width.
SoSFString internalIconFile
The internal icon file name. This field is filled by some MDL function (expand path).
static void initClass()
Initialization of inventor stuff.
SoSFTrigger triggerPaste
Trigger for the Paste operation.
SoSFEnum selectionColoringMode
Adjusts the selection coloring mode (brighten / fixed color).
SoSFEnum redoKeyModifier
Field for adjusting the keyboard modifier for the redo operation.
LABEL_UNITS_SCALES
Enumeration of unit scales.
SoSFFloat labelMarginX
Field for adjusting the x-margin of the label alignment.
SoSFEnum tessellationWindingRule
Sets the winding rule for tessellation.
SoSFEnum deleteSeedPointKey
Field for adjusting the key for the delete seed point operation.
SoSFString iconFile
The external icon file name. This field is used to hold a initial value with a path variable; the rea...
SoSFEnum fillingFromSideLineWidthMode
Defines the mode for setting the line width of side fillings.
SoSFBool shouldListenToSelectionChangedEvents
Should the module touch itself on selection change events?
SoSFEnum deleteSeedPointKeyModifier
Field for adjusting the keyboard modifier for the delete seed point operation.
SoSFEnum generalInteractionModeToggleKey
The modifier key that can toggle the general interaction mode.
SoSFMLBase inCSOList
Base input node: the CSOList.
SoSFBool ghostStyleAlpha
Defines the ghost style alpha.
SoSFColor boundingBoxColor
The color of the bounding boxes.
EDITING_OPERATION_KEYS
Enumeration of the keys for editing operations.
SoSFBool showCSOsOnAllTimePoints
Should the CSOs be shown on all time points of an image?
SoSFFloat mouseOverLineWidthLineWidth
Sets the mouse-over highlighting line fixed width.
SoSFEnum mouseOverLineWidthMode
Sets the mouse-over highlighting line width mode (widen or fixed).
SoSFEnum mouseOverColorMode
Sets the mouse-over highlighting color mode (brighten or fixed).
SoSFColor selectionFixedColor
Sets the color for the selection color (deprecatedName: selectionFallbackColor).
SoSFEnum nextInteractionStatus
Field for displaying the status of the (next) interaction.
SoSFBool useStylePalette
Should a style palette be used for adjusting display options if one is attached?
SoSFEnum cutCopyKeyModifier
Field for adjusting the keyboard modifier for the cut© operation.
SoSFTrigger triggerCutCopy
Trigger for the Cut&Copy operation.
SoSFBool showLabelUnits
Shall the units be shown? (for length and area).
SoSFBool shouldLimitCSOMovement
Should the moving of CSOs be limited at the border of an image?
SoSFBool ghostStyleStipple
Defines the ghost style stipple.
SoSFFloat generalLabelAlpha
Field for adjusting the label alpha.
SoSFBool shouldUpdateInteractionStateAndCSOId
Should the next interaction and the current CSO id under the cursor be updated on each interaction?
SoSFEnum undoKeyModifier
Field for adjusting the keyboard modifier for the undo operation.
SoSFColor generalLabelColor
Field for adjusting the label color.
SoSFEnum copyKeyModifier
Field for adjusting the keyboard modifier for the copy operation.
SoSFEnum forceStartNewCSOKey
If this key is pressed, a new contour is started, even if the first hit point is in the vicinity of a...
SoSFBool useTessellation
Shall the CSOs be tessellated?
SoSFFloat labelMarginY
Field for adjusting the y-margin of the label alignment.
SoSFBool shouldOnlyInteractWithSelectedCSO
SoSFMLBase inStylePalette
Input of a style palette.
EDITING_OPERATION_KEYBOARD_MODIFIERS
Enumeration of the keyboard modifiers for editing operations.
SoSFBool useAntiAliasing
Should the CSO be rendered with anti aliasing?
SoSFBool showBoundingBox
Should the bounding box of a CSO be displayed?
SoSFTrigger triggerCopy
Trigger for the Copy operation.
SoSFBool useHoleCorrectionForGroupsOnly
Shall the hole correction only be applied to CSOs of one group?
SoSFBool shouldNotifyItself
Should the module be able to notify itself?
SoSFEnum tessellationColorMode
Color mode for the tessellation.
SoSFEnum copyKey
Field for adjusting the key for the copy operation.
SoSFBool enableMultiSelection
Field for enabling/disabling multi selection.
SoSFEnum undoKey
Field for adjusting the key for the undo operation.
SoSFColor selectedSeedPointFixedColor
Sets the color for the selected seed point.
SoSFInt32 currentlyUnderMouseCursorCSOId
Provides id of the CSO currently under mouse.
SoSFBool ghostStyleLineWidth
Defines the ghost style line width.
SoSFFloat selectedSeedPointAlpha
Sets the alpha for the selected seed point.
SoSFBool shouldListenToFinishedEvents
Should the module touch itself on finished events?
SoSFEnum selectedSeedPointColoringMode
Adjusts the coloring mode for the selected seed point (brighten / fixed color).
SoSFBool ghostStyleBrighten
Defines the ghost style line brighten.
SoSFBool useIconFile
Shall the icon file be used?
SoSFFloat showParallelThickness
Defines the thickness of a point cloud in which all points should be in the test of being parallel to...
SoSFFloat boundingBoxAlpha
The alpha value of the bounding box.
INTERACTION_MODES
Enumeration of the interaction modes.
SoSFBool setPastedCSOsSelected
If checked, all pasted CSOs will be set as selected (and the previous selection will be cleared).
LABEL_SHOW_MODES
Enumeration of the label show modes.
SoSFEnum ghostUnitMode
Defines the ghost unit mode. (ghostDepth in mm or slices.)
SoSFEnum multiSelectionKeyModifier
Field for adjusting the keyboard modifier for multi-selections.
void draw(View2DSliceList *slicelist, View2DSlice *, int z) override
Drawing on slices.
SoSFFloat selectedSeedPointSize
Sets the size for the selected seed point.
SoSFFloat selectionWidenLineWidth
Sets the widen value for the selection line width (deprecatedName: selectionFallbackWidth).
SoSFMLBase inProcessor
Base input node: a processor modules that evaluates interaction events and interpolates the contours ...
SoSFBool useInterpolationTargetColor
Shall the target interpolation color be used?
SoSFEnum pasteKey
Field for adjusting the key for the paste operation.
SoSFFloat fillingFromSideManualLineWidthX
Sets the x-width of the virtual voxel in mm.
SoSFEnum selectionLineWidthMode
Adjusts the selection line width mode (widen / fixed width).
SoSFEnum stylePaletteUseIndexAs
Defines the use of style palette indices (CSO / Group).
SoSFInt32 newCurrentTimePoint
Sets the new current time point.
SoSFBool combinePastedCSOsToGroupsOfOriginalCSOs
If checked, all pasted CSOs will be associated to all CSOGroups of the original CSOs.
SoSFBool shouldListenToRepaintEvents
Should the module touch itself on repaint events?
SoSFBool showSeedPoints
Shall seed points be drawn?
SoView2DCSOEditor()
Standard constructor.
SoSFEnum deleteCSOKeyModifier
Field for adjusting the keyboard modifier for the delete CSO operation.
SoSFFloat selectedSeedPointEnlargeSize
Sets the enlarge value for the size of the selected seed point.
SoSFEnum labelUnitScale
Field for adjusting the label's unit scale (for length and area).
SoSFEnum ghostMode
Defines the ghost mode. (Seeing the contour on a slice being further away.)
SoSFEnum generalInteractionMode
The general interaction mode: edit or move.
SoSFBool showOnlyParallelCSOs
Shows only CSOs that are parallel to the current viewing plane if checked.
SoSFFloat globalAlphaFactor
A factor multiplied to the alpha values of each path point and each seed point.
SoSFFloat fillingFromSideManualLineWidthY
Sets the y-width of the virtual voxel in mm.
SoSFEnum selectedSeedPointSizeMode
Adjusts the selected seed point size mode (enlarge / fixed size).
SoSFFloat tessellationAlpha
Alpha value for tessellation (multiplies with the CSO's alpha no matter what tessellation color mode)...
SoSFBool overwriteSelectionVisualizationSettings
Shall the visualization settings be used instead of the CSOManagers settings?
SoSFEnum cutCopyKey
Field for adjusting the key for the cut© operation.
SoSFColor mouseOverColorColor
Sets the mouse-over highlighting fixed color.
SoSFBool useFillingFromSide
Shall the CSOs' filling be shown from the side?
SoSFEnum labelShowMode
Field for setting the label show mode.
SoSFBool movingOn
If checked, moving in general is allowed.
SoSFColor interpolationTargetColor
The target color for positionValue interpolation.
TOGGLE_MODE_KEYS
Enumeration of the keyboard modifiers to use for toggling seed point / whole CSO interaction.
SoSFBool selectGroupsParsProToto
If checked, the module selects all Groups the just selected CSO is in as well.
SoSFEnum labelColorMode
Field for adjusting the label color mode (as CSO / general).
SoSFBool labelUseTextShadow
Field for toggling text shadow on/off for labels.
SoSFEnum pasteKeyModifier
Field for adjusting the keyboard modifier for the paste operation.
SoSFBool enableMouseOverHighlighting
Activates the mouse-over highlighting.
SoView2DExtension Base class for all View2DExtensions used for drawing and event handling on the View...
void doAction(SoAction *action) override
SoView2D is a 2D viewer for image data.
View2DEvent stores all information on an event on a SoView2D.
Abstract GL font drawing using FTGL.
a list that holds all View2DSlice objects (lazily created) of a SoView2D
a single slice that is stored in a View2DSliceList, typically created by a View2DSliceList
The CSOBoundingBox defines an axis parallel bounding box with double precision.
A CSOGroup comprises a number of CSOs, which themselves can be in a number of different CSOGroups.
A CSOList comprises a number of CSOs and CSOGroups and is the central object for contour segmentation...
The CSOPathPoints is a list of world coordinates which are interpolated by a certain interpolation sc...
The CSOProcesorData provides the network data interchange object for processing interaction events an...
The CSOSeedPoint can be interactively set and modified and is the framework for contours.
The CSO represents a contour segmentation object.
Structure to hold visual parameters for the old editor.