MeVisLab Toolbox Reference
SoView2DCSOEditorBase.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 
15 
16 #pragma once
17 
18 #include "SoCSOSystem.h"
19 #include "SoCSODefines.h"
20 
21 #include <SoView2D.h>
22 
23 #include <View2DFont.h>
24 #include <View2DIcons.h>
25 
26 #include <mlStylePalette.h>
27 
29 
30 namespace ml
31 {
32  class CSOProcessorData;
33 }
34 
35 class SoCSOTransform;
36 
38 
40 {
41 public:
44 
46  void setUpVisualization(ml::CSOList* csoList, ml::CSO* cso, const CSOEditorState& editorState, ml::StylePalette* stylePalette, CSOVisualParameters& visualParameters);
48  int getStylePaletteIndex(const ml::CSO* cso, ml::StylePalette* stylePalette) const;
50  int evaluateHitPoint(View2DSliceList* slicelist,const ml::Vector3& currentHitPoint,
51  const ml::CSOList* csoList, const std::string& editorId, const ml::CSOBoundingBox& slabBB, int pickingMode,
52  ml::CSO*& hitCSO, ml::CSOSeedPoint*& hitSeedPoint, ml::CSOPathPoints*& hitPathPoints, float& distance);
54  bool isEditable(const ml::CSO* cso, View2DSliceList* slicelist, int currentSlice) const;
59  virtual int getTimePoint(View2DSliceList* slicelist, int slice) const;
62  bool shouldSkipCSOOnSlice(ml::CSO* cso, View2DSliceList* slicelist, int z);
65  bool getHitCoordinates(View2DSliceList* slicelist, View2DEvent* ec, const ml::CSOBoundingBox& slabBB, ml::Vector3& hitPoint);
67  void setUpIcons();
68 
70  void drawSeedPoints(CSOVisualParameters& visualParameters, const CSODrawCSOInfos& csoInfos,
71  const CSODrawView2DInfos& view2DInfos, ml::CSOSeedPoint* underCursorSeedPoint,
72  SoView2DExtension* extension, bool useIcons) const;
73 
76  void drawSeedPoints(CSOVisualParameters& visualParameters, ml::CSO* cso, const CSODrawCSOInfos& csoInfos,
77  const CSODrawView2DInfos& view2DInfos, ml::CSOSeedPoint* underCursorSeedPoint,
78  SoView2DExtension* extension, bool useIcons) const;
79 
80 protected:
83 
86 
88  virtual bool getShouldOnlyInteractWithSelectedCSO() const = 0;
89  virtual float getSelectionTolerance() const = 0;
90  virtual bool getShowOnlyParallelCSOs() const = 0;
91  virtual bool getShowCSOsOnAllTimePoints() const = 0;
92  virtual bool getOverwriteCurrentTimePoint() const = 0;
93  virtual int getNewCurrentTimePoint() const = 0;
94 
95  virtual float getShowParallelThickness() const = 0;
96  virtual bool getUseStylePalette() const = 0;
97  virtual float getGlobalAlphaFactor() const = 0;
98  virtual int getStylePaletteUseIndexAs() const = 0;
99  virtual bool getUseIconFile() const = 0;
100  virtual SbString getIconFile() const = 0;
101  virtual SbString getInternalIconFile() const = 0;
102  virtual bool getHighlightSelectedGroups() const = 0;
103 
105  virtual int getSelectionColoringMode() const = 0;
106  virtual float getSelectionBrightenColor() const = 0;
107  virtual SbColor getSelectionFixedColor() const = 0;
108  virtual int getSelectionLineWidthMode() const = 0;
109  virtual float getSelectionWidenLineWidth() const = 0;
110  virtual float getSelectionFixedLineWidth() const = 0;
111  virtual int getSelectedSeedPointColoringMode() const = 0;
112  virtual int getSelectedSeedPointSizeMode() const = 0;
113  virtual float getSelectedSeedPointBrightenColor() const = 0;
114  virtual float getSelectedSeedPointAlpha() const = 0;
115  virtual SbColor getSelectedSeedPointFixedColor() const = 0;
116  virtual float getSelectedSeedPointEnlargeSize() const = 0;
117  virtual float getSelectedSeedPointSize() const = 0;
118 
119  virtual bool getEnableMouseOverHighlighting() const = 0;
120  virtual int getMouseOverColorMode() const = 0;
121  virtual SbColor getMouseOverColorColor() const = 0;
122  virtual float getMouseOverColorBrightenValue() const = 0;
123  virtual int getMouseOverLineWidthMode() const = 0;
124  virtual float getMouseOverLineWidthLineWidth() const = 0;
125  virtual float getMouseOverLineWidthWidenValue() const = 0;
126  virtual bool getUsePathPointColorForSeedPoints() const = 0;
127  virtual bool getShowSeedPoints() const = 0;
128 
130  virtual int getLabelColorMode() const = 0;
131  virtual SbColor getGeneralLabelColor() const = 0;
132  virtual float getGeneralLabelAlpha() const = 0;
134 };
135 
Abstract Open Inventor base class for uniform shader parameter nodes.
virtual int getSelectionLineWidthMode() const =0
bool shouldSkipCSOOnSlice(ml::CSO *cso, View2DSliceList *slicelist, int z)
Returns whether the given CSO should be skipped (rendering, interacting with) on the given slice.
void setUpIcons()
Sets up the internal icon list from an external icon file.
virtual bool getShowSeedPoints() const =0
virtual SbColor getSelectedSeedPointFixedColor() const =0
virtual float getSelectedSeedPointSize() const =0
bool getHitCoordinates(View2DSliceList *slicelist, View2DEvent *ec, const ml::CSOBoundingBox &slabBB, ml::Vector3 &hitPoint)
Fills up a hit point with world coordinates and returns true if the image was hit.
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 int getTimePoint(View2DSliceList *slicelist, int slice) const
Returns the current timepoint which is either the actual shown timepoint or the timepoint overwritten...
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 ~SoView2DCSOEditorBase()
Destructor.
virtual bool getHighlightSelectedGroups() const =0
virtual SbColor getSelectionFixedColor() const =0
int evaluateHitPoint(View2DSliceList *slicelist, const ml::Vector3 &currentHitPoint, const ml::CSOList *csoList, const std::string &editorId, const ml::CSOBoundingBox &slabBB, int pickingMode, ml::CSO *&hitCSO, ml::CSOSeedPoint *&hitSeedPoint, ml::CSOPathPoints *&hitPathPoints, float &distance)
Checks for hits of the given point with a CSO and returns the hit mode.
virtual float getSelectionBrightenColor() const =0
void setUpVisualization(ml::CSOList *csoList, ml::CSO *cso, const CSOEditorState &editorState, ml::StylePalette *stylePalette, CSOVisualParameters &visualParameters)
Sets up CSO visualization parameters for the given CSO.
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
void drawSeedPoints(CSOVisualParameters &visualParameters, ml::CSO *cso, const CSODrawCSOInfos &csoInfos, const CSODrawView2DInfos &view2DInfos, ml::CSOSeedPoint *underCursorSeedPoint, SoView2DExtension *extension, bool useIcons) const
\old Renders seed points of the given CSO.
virtual int getMouseOverLineWidthMode() const =0
virtual float getShowParallelThickness() const =0
virtual int getSelectedSeedPointSizeMode() const =0
int getStylePaletteIndex(const ml::CSO *cso, ml::StylePalette *stylePalette) const
Returns the index into the StylePalette depending on the module's settings.
virtual SbString getInternalIconFile() const =0
virtual float getSelectionFixedLineWidth() const =0
bool isEditable(const ml::CSO *cso, View2DSliceList *slicelist, int currentSlice) const
Returns whether the given CSO is editable.
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
void drawSeedPoints(CSOVisualParameters &visualParameters, const CSODrawCSOInfos &csoInfos, const CSODrawView2DInfos &view2DInfos, ml::CSOSeedPoint *underCursorSeedPoint, SoView2DExtension *extension, bool useIcons) const
Renders seed points of the given CSO.
SoView2DCSOEditorBase()
Default constructor.
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
View2DIcons * _icons
A pointer to the 2D icons.
SoView2DExtension Base class for all View2DExtensions used for drawing and event handling on the View...
View2DEvent stores all information on an event on a SoView2D.
Defines and implements a class to store multiple images and draw them via OpenGL.
Definition: View2DIcons.h:24
a list that holds all View2DSlice objects (lazily created) of a SoView2D
The CSOBoundingBox defines an axis parallel bounding box with double precision.
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
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 object class StylePalette for providing a collection of colors, line styles and marker types.
Main documentation file for ML users and developers.
Definition: SoSFMLImage.h:51
Structure holding information about the processor/editor state.
Definition: SoCSODefines.h:226
Structure to hold visual parameters for the old editor.
Definition: SoCSODefines.h:200