MeVisLab Toolbox Reference
SoView2D.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 
15 
16 #pragma once
17 
18 #include "SoSFMLImage.h"
19 #include "SoView2DSystem.h"
20 #include "SoView2DExtension.h"
21 
22 #include <Inventor/fields/SoFields.h>
23 #include <Inventor/nodes/SoSubNode.h>
24 #include <Inventor/nodes/SoShape.h>
25 #include <Inventor/sensors/SoTimerSensor.h>
26 #include <Inventor/sensors/SoAlarmSensor.h>
27 #include <Inventor/sensors/SoFieldSensor.h>
28 #include <Inventor/sensors/SoNodeSensor.h>
29 #include <Inventor/nodes/SoSubNode.h>
30 #include <Inventor/elements/SoCacheElement.h>
31 
32 #include <SoInteractionProvider.h>
33 
34 class View2DSliceList;
35 class View2DCine;
36 class View2DFont;
37 class View2DLut;
38 
40 
41 ML_START_NAMESPACE
42 
43  class LUTFunction;
44  template <typename T> class LUTData;
45 
46 ML_END_NAMESPACE
47 
49 typedef int (*SliceInitFunc) (const SoView2D *view2D, SoSFMLImage *image, void *user);
50 
51 
52 //=============================================================
54 
60 //=============================================================
61 class SOVIEW2D_API SoView2D : public SoShape, public SoInteractionOwner
62 {
63 
64  SO_NODE_HEADER(SoView2D);
65 
66 public:
68 
70  SoSFString instanceName;
71 
74 
77 
79  SoSFBool drawImageData;
80 
82  SoSFString viewerId;
83 
85  SoSFEnum blendMode;
87  SoSFEnum filterMode;
89  SoSFEnum cacheMode;
91  SoSFFloat alphaFactor;
93  SoSFColor baseColor;
96  SoSFBool useShaders;
98  SoSFBool applyLut;
100  SoSFEnum lutPrecision;
101 
103  SoSFInt32 startSlice;
105  SoSFInt32 sliceStep;
107  SoSFInt32 numSlices;
109  SoSFInt32 numXSlices;
111  SoSFInt32 maxSlice;
116  SoSFInt32 timePoint;
118  SoSFInt32 maxTimePoint;
120  SoSFInt32 userIndex;
122  SoSFInt32 maxUserIndex;
124  SoSFInt32 slab;
127 
129  SoSFTrigger forceImageUpdate;
130 
132  SoSFVec2f margin;
134  SoSFVec2f spacing;
135 
137  SoSFPlane plane;
138 
140  SoSFVec2f lowerLeft;
142  SoSFVec2f upperRight;
143 
145  SoSFBool snapToCenter;
146 
148  SoSFBool standardKeys;
153 
158 
161 
163  SoSFVec2f sliceOrigin;
165  SoSFFloat sliceZoom;
169  SoSFVec2f zoomCenter;
170 
172  SoSFVec3f viewingCenter;
173 
176 
179 
181  SoSFTrigger unzoom;
182 
184  SoSFEnum sliceAlignX;
186  SoSFEnum sliceAlignY;
187 
188 
190  SoSFEnum zoomMode;
192  SoSFFloat zoomModeParameter;
193 
200 
205 
207  SoSFColor backgroundColor;
210 
213 
215  SoSFBool handle2DEvents;
216 
218  SoSFBool handle3DEvents;
219 
222 
224  SoSFBool enableZBuffer;
225 
227  SoSFBool enableZWrite;
228 
230  SoSFFloat devicePixelSize;
231 
233 
235 
237  SoSFTrigger startCine;
239  SoSFTrigger stopCine;
241  SoSFInt32 cineCenterT;
243  SoSFInt32 cineIntervalT;
245  SoSFInt32 cineCenterZ;
247  SoSFInt32 cineIntervalZ;
249  SoSFEnum cineMode;
251  SoSFEnum cineDirection;
253  SoSFEnum cineRepeat;
255  SoSFFloat cineSpeed;
256 
258  SoSFBool cineFullRangeZ;
260  SoSFBool cineFullRangeT;
261 
264  SoSFBool cineAlwaysReset;
265 
267  SoSFBool cineModeActive;
268 
270 
271 
273 
275  SoSFTrigger deleteSelected;
277  SoSFTrigger edit;
278 
280  SoSFString status;
281 
283  SoSFString seriesInstanceUID;
286 
288  SoSFBool deletingEnabled;
289 
291 
293  SoSFTrigger renderingDone;
294 
296  static void initClass();
297 
300 
302  SbString getViewerId() const { return viewerId.getValue(); }
305 
307  SbVec2f getSliceSize();
308 
311  SoAction *getAction() { return _action; }
312 
314  void GLRender(SoGLRenderAction *action) override;
315 
318 
320  void updateLayout(int viewportX, int viewportY, int viewportWidth, int viewportHeight, bool is3D = false);
321 
323  void handleEvent(SoHandleEventAction *action) override;
325  bool handleKeyboardEvent(int nKey, bool shift, bool alt, bool ctrl);
326 
328  void computeBBox(SoAction * action, SbBox3f &box, SbVec3f &center) override;
330  void generatePrimitives(SoAction *action) override;
332  void rayPick(SoRayPickAction * action) override;
333 
341  bool getEventLocation(SoHandleEventAction* action,
342  bool& hit, float& dx, float& dy, SbVec3f& voxelHit,
343  int& sliceID);
344 
345 
349 
351  static View2DFont* globalFont(int /*cacheContext*/) { return globalFont(); }
352 
356 
364  void setSliceInitFunc (SliceInitFunc fn, void *user)
365  { _sliceInitFunc = fn; _sliceInitUser = user; }
366 
368  SliceInitFunc getSliceInitFunc (void) { return _sliceInitFunc; }
369 
372 
375  void adjustSliceOriginToCenter(float newSliceZoom);
376 
378  void translateInnerSlice(float x, float y);
379 
381  void getStatusString(SbString& string);
382 
384  ml::LUTFunction* getDefaultLut() { return _localLut; }
385 
387  ml::LUTFunction* getLutFromScene(SoAction* action);
388 
394 
397 
399  void stopCineMode();
400 
403  SbVec2f getSingleSliceSize (int windowX, int windowY);
404 
407 
410  static std::string getDICOMTagValue(SoSFMLImage* image, const std::string& dicomTagName);
411 
414 
415 protected:
417  ~SoView2D() override;
418 
420 
422  void objRef() override { ref(); }
423  void objUnref() override { unref(); }
424 
426  std::string getID() const override;
428 
432 
433  void forceImageUpdateChangedCB(SoField* field = nullptr);
434 
438  SbBool isMouseButtonPressed(int i);
439 
442  bool isDeviceCoordInViewerArea (float dx, float dy, const SbVec2s& viewportSize) const;
443 
445  void imageChangedCB(SoField*);
447  void imageChanged();
449  void maxSizeChangedCB(SoField*);
450 
452  void sliceUnzoomCB(SoField*);
454  void sliceUnzoomAction (void);
455 
460 
464 
466  void viewingCenterChangedCB(SoField*);
470 
471  void updateSliceRepresentingPlane(const SbVec3f& worldCenter);
472 
474  void sliceZoomChangedCB(SoField*);
477 
482 
484  void keepSlicesInViewCB (SoField*);
485 
489  int setStartSlice (int slice, bool keepInView = false, bool noCB = false);
490 
492  void minSliceZoomKeyboardCB(SoField*);
493 
495  void startCineModeCB(SoField*);
497  void stopCineModeCB(SoField*);
498 
500  void cineParametersChangedCB(SoField*);
503 
505  void deleteSelectedObjectCB(SoField*);
509  void editObjectsCB(SoField*);
512 
514  void handleScheduledActions(const SoNodeList* primitives);
515 
517  void getLutFromScene(SoAction* action, View2DLut* data);
518 
520  void layoutSlices(int wx, int wy);
521 
523  void updateLayoutAndDraw(int originX, int originY, int width, int height, bool updateLayoutOnly,
524  SoNodeList* primitives=nullptr,int sharedCacheContext=-1, bool is3D = false, bool reverse = false);
525 
527  bool checkValid();
528 
530  SoAction *_action;
531 
538 
545 
547 
549  SbBool _mouseButton[3];
550 
552  SoFieldSensor *_viewingCenterSensor;
553 
555  SoFieldSensor *_startSliceSensor;
556 
558 
560  SoFieldSensor *_sliceOriginSensor;
561 
566 
568  bool _dragging;
571 
576 
578  unsigned int _imageSerialNumber;
579 
583 
589 
594 
597 };
View2DLutPrecision
allows to set the precision of the LUT
#define SOVIEW2D_API
File to resolve system dependencies in View2D library.
int(* SliceInitFunc)(const SoView2D *view2D, SoSFMLImage *image, void *user)
Callback function type for external specification of initial slice position.
Definition: SoView2D.h:49
SoInteractionHandler is a mix-in class for instances of SoNode to handle the interactions it provides...
SoInteractionOwner is a mix-in class for instances of SoNode that should have interaction objects.
SoInteractionProvider is an abstract interface class that provides interactions to the SoInteractionC...
The SoSFMLImage field is the interface used by Inventor Nodes to access image data (in the current im...
Definition: SoSFMLImage.h:70
SoView2D is a 2D viewer for image data.
Definition: SoView2D.h:62
View2DLut * _lutData
the currently allocated lut data
Definition: SoView2D.h:537
SoSFTrigger renderingDone
output field is triggered from the inside when all rendering is done.
Definition: SoView2D.h:293
void updateViewingCenterAndPlane()
update viewing center from sliceOrigin and sliceNumber
SoSFVec2f sliceOrigin
the internal origin of the slice in voxels (for shifting inside of the view)
Definition: SoView2D.h:163
SbBool isMouseButtonPressed(int i)
returns if given mousebutton (0-2) is currently pressed this is handles by the View2D,...
SoAction * _action
pointer to current action
Definition: SoView2D.h:530
SliceInitFunc getSliceInitFunc(void)
Get slice position initialization callback.
Definition: SoView2D.h:368
SoSFEnum blendMode
blend mode for rendering
Definition: SoView2D.h:85
void stopCineMode()
stop the cine mode
SoSFBool clipBackgroundToImage
clip background to image rect
Definition: SoView2D.h:212
SoSFBool deletingEnabled
enable/disable delete-events for SoView2D-Extensions
Definition: SoView2D.h:288
SoSFFloat minSliceZoomKeyboard
minimum slice zoom for keyboard modifications (always clamped by MIN_MIN_SLICE_ZOOM and 1....
Definition: SoView2D.h:178
SoSFVec2f upperRight
restrict the rendering to a subpart of the viewer, in normalized coordinated
Definition: SoView2D.h:142
void minSliceZoomKeyboardCB(SoField *)
callback for minimum slice zoom modification that performs clamping to value range
SoSFBool passHandledFlagToInventor
Set this true if following inventor nodes should not react to events that have been handled by a SoVi...
Definition: SoView2D.h:157
SoFieldSensor * _viewingCenterSensor
sensor for start slice
Definition: SoView2D.h:552
SoSFFloat cineSpeed
speed of cine mode (in seconds), minimum cine speed is fixed to one repaint per image
Definition: SoView2D.h:255
SbVec2f getSliceSize()
get slice size x/y in millimeters (used by SoOrthoView2D)
SoSFBool handle3DEvents
handle events when rendering in 3D
Definition: SoView2D.h:218
SoSFEnum lutPrecision
defines the precision of the LUT
Definition: SoView2D.h:100
SoSFEnum cineMode
mode of the Cinemode (Z,T,ZT)
Definition: SoView2D.h:249
SoSFString viewerId
id string, needs to be unique in a network if used
Definition: SoView2D.h:82
SoSFBool cineModeActive
read-only flag indicating whether cine mode is active or not
Definition: SoView2D.h:267
SoSFInt32 numSlices
number of slices that are rendered
Definition: SoView2D.h:107
SoSFInt32 cineCenterT
center of timepoint cine
Definition: SoView2D.h:241
SoSFInt32 sliceStep
step to next rendered slice
Definition: SoView2D.h:105
bool _mouseOverViewer
remember if the mouse cursor is over the viewer area
Definition: SoView2D.h:570
SoSFTrigger startCine
Cinemode fields.
Definition: SoView2D.h:237
void updateLayoutAndDraw(int originX, int originY, int width, int height, bool updateLayoutOnly, SoNodeList *primitives=nullptr, int sharedCacheContext=-1, bool is3D=false, bool reverse=false)
update layout and draw in 2D or 3D
SoSFInt32 userIndex
the user index the viewers is currently showing
Definition: SoView2D.h:120
void viewingCenterChanged()
sets slice origins of all viewers according to current viewing center if synchronizePanning is on
void editObjectsAction()
switch extensions to edit mode
void generatePrimitives(SoAction *action) override
used for 3D picking
SoSFBool handle2DEvents
handle events when rendering in 2D
Definition: SoView2D.h:215
bool checkValid()
checks if image, start slice, timepoint, and user index are valid
int getMaxStartSlice()
returns the highest sensible value for startSlice
SoSFInt32 cineCenterZ
center of z cine
Definition: SoView2D.h:245
SoSFInt32 timePoint
the timepoint the viewers is currently showing
Definition: SoView2D.h:116
SoSFPlane plane
plane representing the slice in world coordinates
Definition: SoView2D.h:137
SoSFFloat sliceZoom
the internal zoom of the slice (for zooming inside if the view)
Definition: SoView2D.h:165
void updateViewingCenterAndPlaneCB(SoField *)
callback which forwards to updateViewingCenterAndPlane()
SoSFString frameOfReferenceUID
the DICOM frameOfReferenceUID of the image currently displayed.
Definition: SoView2D.h:285
void handleEvent(SoHandleEventAction *action) override
handle the mouse and keyboard events and send them to extensions
int getCurrentCenterSlice()
returns the central of all currently visible slices (e.g. startSlice, if numSlices is 1)
SoSFFloat zoomModeParameter
zoom mode parameter, depends on zoomMode what its value means
Definition: SoView2D.h:192
void sliceUnzoomAction(void)
Reset slice zoom and translation.
bool _dragging
remember if we are during a drag operation
Definition: SoView2D.h:568
SoSFBool enableZBuffer
use Z buffer in 3D rendering
Definition: SoView2D.h:224
View2DSliceList * getSliceList()
returns the slicelist that is used to manage the slices
SoSFVec2f lowerLeft
restrict the rendering to a subpart of the viewer, in normalized coordinated
Definition: SoView2D.h:140
SoSFBool applyLut
select if the View2d should apply the scene LUT to the slice data (default is true)
Definition: SoView2D.h:98
void updateSliceListOnImageChange()
update the slice list if the image has changed
void updateKeyboardActionEnabledStateCB(SoField *)
update enabled state of the keyboard actions
SoSFBool standardKeysNumbers
enable number keys 0-9, depends on standardKeys being enabled
Definition: SoView2D.h:150
SoSFVec2f spacing
spacing between slices
Definition: SoView2D.h:134
SoSFEnum cineRepeat
flag to indicated if loop or ping-pong is used
Definition: SoView2D.h:253
void handleScheduledActions(const SoNodeList *primitives)
handle the actions given by deleteSelectedObject and editObjects
SoSFBool enableZWrite
write Z buffer in 3D rendering
Definition: SoView2D.h:227
SoFieldSensor * _startSliceSensor
sensor for start slice
Definition: SoView2D.h:555
SoSFBool enableViewingCenter
If enabled, the viewing center is activated for reading and writing.
Definition: SoView2D.h:175
SoSFInt32 cineIntervalT
interval of timepoint cine
Definition: SoView2D.h:243
void startCineModeCB(SoField *)
callback that calls startCineMode();
void adjustSliceOriginToCenter(float newSliceZoom)
sets the new sliceZoom value and adjusts the sliceOrigin to zoom to the center of the ROI
bool _editObjectsScheduled
flag if edit mode on extensions should be activated
Definition: SoView2D.h:563
void objRef() override
Overriding SoInteractionProvider methods:
Definition: SoView2D.h:422
void * _sliceInitUser
user data for _sliceInitFunc
Definition: SoView2D.h:575
double _currentLUTImageMax
Definition: SoView2D.h:542
SoSFInt32 maxUserIndex
the maximum user index, read from the image, used to restrict userIndex
Definition: SoView2D.h:122
bool _useHighColorDepth
Definition: SoView2D.h:595
void imageChangedCB(SoField *)
callback that calls imageChanged();
void getLutFromScene(SoAction *action, View2DLut *data)
render the lut into the given lut data object
void updateSliceRepresentingPlane(const SbVec3f &worldCenter)
SoSFInt32 slab
the slab that is rendered (1=only one slice)
Definition: SoView2D.h:124
static std::string getDICOMTagValue(SoSFMLImage *image, const std::string &dicomTagName)
Returns the value of a DICOM tag with the given name as a string, or an empty string if the tag was n...
std::string getID() const override
Returns the id string for identifying the provider (and its actions)
SoFieldSensor * _sliceOriginSensor
sensor for slice origin
Definition: SoView2D.h:560
void stopCineModeCB(SoField *)
callback that calls stopCineMode();
View2DSliceList * _sliceList
the internal slice list which stores and handles rendered slices
Definition: SoView2D.h:533
SoSFFloat devicePixelSize
size of a pixel in mm when rendering in 3D
Definition: SoView2D.h:230
SoInteractionHandler * _interactionHandler
Delegate that handles events for the new interaction scheme.
Definition: SoView2D.h:585
void deleteSelectedObjectCB(SoField *)
callback that calls deleteSelectedObjectAction();
SoSFEnum sliceAlignY
align the image inside of the slice if there is space left, default is VIEW2D_ALIGN_CENTER
Definition: SoView2D.h:186
void deleteSelectedObjectAction()
delete the selected object
bool _deleteSelectedObjectScheduled
flag if delete of object on extension should be activated
Definition: SoView2D.h:565
void translateInnerSlice(float x, float y)
translates the inner slice x/y pixel on the screen
SoSFInt32 maxSlice
the maximum slice number, read from the image, used to restrict startSlice
Definition: SoView2D.h:111
SoSFString instanceName
Fields.
Definition: SoView2D.h:70
void editObjectsCB(SoField *)
callback that calls deleteSelectedObjectAction();
bool isDeviceCoordInViewerArea(float dx, float dy, const SbVec2s &viewportSize) const
Returns if the event of the given action is located over the viewer area for a given viewportSize The...
SoSFInt32 numXSlices
number of slices that are rendered in X
Definition: SoView2D.h:109
SoSFBool reverseExtensionDrawingOrder
Reverse drawing order of extensions.
Definition: SoView2D.h:160
SoSFString seriesInstanceUID
the DICOM seriesInstanceUID of the image currently displayed
Definition: SoView2D.h:283
SoSFBool cineFullRangeZ
flag if the full z range or the z interval is used
Definition: SoView2D.h:258
void sliceUnzoomCB(SoField *)
callback that calls sliceUnzoomAction();
SoSFString interactionProviderID
This field overrides the instanceName as providerID if specified.
Definition: SoView2D.h:73
SoSFBool invertKeyPanningDirections
invert panning by keyboard
Definition: SoView2D.h:195
unsigned int _imageSerialNumber
last serial number of image
Definition: SoView2D.h:578
int setStartSlice(int slice, bool keepInView=false, bool noCB=false)
set start slice, but obey possible restrictions (returns effective value) if keepInView is set,...
void updateKeyboardActionEnabledState()
void sliceZoomChangedCB(SoField *)
callback which forwards to sliceToomChanged
SoSFBool drawImageData
if set to false, only the extensions of the SoView2D are drawn, not the images
Definition: SoView2D.h:79
MLDataType _currentLUTImageDataType
current LUT settings
Definition: SoView2D.h:540
SoSFVec3f viewingCenter
world position of the current center of the viewer
Definition: SoView2D.h:172
SliceInitFunc _sliceInitFunc
external slice initialization callback
Definition: SoView2D.h:573
ml::LUTFunction * getDefaultLut()
get the default lut object (just a relative ramp from 0 to 1)
Definition: SoView2D.h:384
void keepSlicesInViewCB(SoField *)
if keepSlicesInView is activated, set startSlice to a permitted value
SoSFBool useManagedInteraction
prefer to use managed interaction instead of classical event handling if a SoView2DExtension provides...
Definition: SoView2D.h:221
void maxSizeChangedCB(SoField *)
callback that prevents maxSizes go out of image size
SoSFFloat overrideAspectRatioValue
user defined aspect ratio, is only used if overrideAspectRatio is set to true
Definition: SoView2D.h:204
static View2DFont & globalFontRef()
Always return an existing font singleton as from globalFont(); used for annotations etc.
void enableViewingCenterChangedCB(SoField *)
enable / disable viewing center usage.
SoSFBool cineFullRangeT
flag if the full time range or the time interval is used
Definition: SoView2D.h:260
ml::LUTFunction * getLutFromScene(SoAction *action)
get the lut from the scene (default ramp if no lut is set)
SoSFBool overrideAspectRatio
set if the aspect ratio should be overwritten by user aspect ratio
Definition: SoView2D.h:202
SoSFVec2f margin
margin to the border of the viewer
Definition: SoView2D.h:132
SoSFColor baseColor
base color in which the slices are drawn
Definition: SoView2D.h:93
SoSFMLImage image
input ML image
Definition: SoView2D.h:76
SoSFTrigger edit
set the extensions into edit mode
Definition: SoView2D.h:277
SoFieldSensor * _sliceZoomSynchronizedSensor
Definition: SoView2D.h:557
void forceImageUpdateChangedCB(SoField *field=nullptr)
void computeBBox(SoAction *action, SbBox3f &box, SbVec3f &center) override
when rendering in 3D, calculate the bounding box of the drawn slice(s)
static View2DFont * globalFont()
get the global font used for annotations etc.
SoSFEnum zoomMode
zoom mode that defines mapping to the viewer area
Definition: SoView2D.h:190
void getStatusString(SbString &string)
access status string
SoSFInt32 cineIntervalZ
interval of z cine
Definition: SoView2D.h:247
SoSFFloat backgroundAlphaFactor
background alpha factor (0=background invisible)
Definition: SoView2D.h:209
SoSFEnum cineDirection
direction of Cinemode
Definition: SoView2D.h:251
void viewingCenterChangedCB(SoField *)
callback which forwards to viewingCenterChanged()
void setSliceInitFunc(SliceInitFunc fn, void *user)
Set slice position initialization callback The callback function set by this method is called when th...
Definition: SoView2D.h:364
SoSFBool standardKeys
enable the keypad and 0-9 keys
Definition: SoView2D.h:148
bool handleKeyboardEvent(int nKey, bool shift, bool alt, bool ctrl)
handle standard key, returns true if handles
void sliceZoomSynchronizedChanged()
updates the sliceZoom and corrects the slice origin, so that the viewing center of the slice remains ...
SoSFString status
status of current extension
Definition: SoView2D.h:280
SoSFBool wrapAroundTimePointScrolling
wrap-around timepoint scrolling
Definition: SoView2D.h:199
SoSFBool keepSlicesInView
if this is set, the slices are prevented from leaving the visible area.
Definition: SoView2D.h:114
bool updateLutData(ml::LUTFunction *lut, View2DLut *data, SoSFMLImage *img, View2DLutPrecision precision)
renders the lut data from the lut function according to the image data (lut may be NULL,...
SoAction * getAction()
get pointer to current action.
Definition: SoView2D.h:311
void cineParametersChangedCB(SoField *)
callback that calls updateCineParameters()
SoInteractionProvider * _interactionProvider
Delegate that provides the interaction objects from the SoView2DExtensions.
Definition: SoView2D.h:587
SoSFEnum filterMode
filter mode for rendering
Definition: SoView2D.h:87
SbVec2f getSingleSliceSize(int windowX, int windowY)
get the size of a single slice in the window area (this can be used to align annotation font size acr...
static SoInteractionProvider * getInteractionProvider(SoNode *node)
static method to register with SoInteractionProvider for this class
SoSFBool cineAlwaysReset
Always reset to start slice/time point and forward direction on start press (start with current posit...
Definition: SoView2D.h:264
SoSFFloat alphaFactor
alpha factor for rendering
Definition: SoView2D.h:91
SoSFInt32 maxTimePoint
the maximum timepoint, read from the image, used to restrict timePoint
Definition: SoView2D.h:118
void updateHighColorDepthFlag()
Checks if the current GL context has a bigger bit depth than 8 per channel and if so upgrades the fla...
void imageChanged()
React on image changed.
static void initClass()
inventor runtime type system
SoSFFloat sliceZoomSynchronized
same as sliceZoom, except that changes to this member update the slice origin so that the viewing cen...
Definition: SoView2D.h:167
void rayPick(SoRayPickAction *action) override
implements 3D picking
double _currentLUTImageMin
Definition: SoView2D.h:541
void updateLayout(int viewportX, int viewportY, int viewportWidth, int viewportHeight, bool is3D=false)
Update layout for given viewport size.
SoSFTrigger deleteSelected
Interaction fields for extensions.
Definition: SoView2D.h:275
int _currentLUTImageNumChannels
Definition: SoView2D.h:543
bool _allowHighColorDepthUpgrade
Definition: SoView2D.h:596
SoSFTrigger unzoom
sets sliceOrigin to (0,0) and sliceZoom to 1.0
Definition: SoView2D.h:181
void layoutSlices(int wx, int wy)
layout slices inside of the window area
SoSFEnum sliceAlignX
align the image inside of the slice if there is space left, default is VIEW2D_ALIGN_CENTER
Definition: SoView2D.h:184
SoSFBool useShaders
if enabled, the SoView2D tries to emulate a hardware lut by using hardware shaders,...
Definition: SoView2D.h:96
SoSFBool snapToCenter
if set, the viewer snaps to center of image on each input image change
Definition: SoView2D.h:145
bool getEventLocation(SoHandleEventAction *action, bool &hit, float &dx, float &dy, SbVec3f &voxelHit, int &sliceID)
get event location of the event contained in action, returns if the image is hit, the device location...
SoSFBool standardKeysNeedValidPosition
set if the keys work anywhere or only if pressed with mouse inside of a slice (needed for SoOrthoView...
Definition: SoView2D.h:152
SoSFBool invertKeySlicingDirection
invert slicing by keyboard
Definition: SoView2D.h:197
SoSFTrigger stopCine
stop the cine mode
Definition: SoView2D.h:239
SoSFTrigger forceImageUpdate
Forces an immediate update of all fields that depend on the input image.
Definition: SoView2D.h:129
void objUnref() override
Definition: SoView2D.h:423
SoView2D()
constructor
void GLRender(SoGLRenderAction *action) override
reimplemented Inventor method which renders the slices
void startCineMode()
start the cine mode
~SoView2D() override
destructor
SoSFColor backgroundColor
fill slice background with given color
Definition: SoView2D.h:207
SoSFBool unzoomOnImageChange
If enabled, the module unzooms automatically on an input image change.
Definition: SoView2D.h:126
void sliceZoomSynchronizedChangedCB(SoField *)
callback which forwards to sliceZoomSynchronizedChanged
void sliceZoomChanged()
updates the member sliceZoomSynchronized
SoSFVec2f zoomCenter
center of zoom/scale operation in normalized coordinates
Definition: SoView2D.h:169
View2DCine * _cine
Definition: SoView2D.h:546
void updateCineParameters()
updates the cine parameters to the current field values
static View2DFont * globalFont(int)
DEPRECATED: cache context id is no longer needed.
Definition: SoView2D.h:351
SoSFEnum cacheMode
caching of slices
Definition: SoView2D.h:89
static ml::LUTFunction * _localLut
an internal lut which is used if there is no lut in the scene
Definition: SoView2D.h:535
SbString getViewerId() const
returns the viewer id of this viewer
Definition: SoView2D.h:302
SoSFInt32 startSlice
current start slice
Definition: SoView2D.h:103
Abstract GL font drawing using FTGL.
Definition: View2DFont.h:30
View2DInteractionHandler is derived from SoInteractionHandler mainly to provide additional SoView2D i...
The View2DInteractionProvider extracts the interactions from the SoView2DExtensions.
A small wrapper class for the LUT data.
Definition: View2DLut.h:23
a list that holds all View2DSlice objects (lazily created) of a SoView2D
Common base class for lookup tables.
Definition: mlLUTFunction.h:55
MLint32 MLDataType
MLDataType.
Definition: mlTypeDefs.h:596