MeVisLab Toolbox Reference
SoOrthoView2DBase.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 "SoView2DSystem.h"
19#include "mlAPI.h"
20
21#include <Inventor/fields/SoSFBool.h>
22#include <Inventor/fields/SoSFInt32.h>
23#include <Inventor/fields/SoSFEnum.h>
24#include <Inventor/fields/SoSFTrigger.h>
25#include <Inventor/fields/SoSFFloat.h>
26#include <Inventor/fields/SoSFVec3f.h>
27#include <Inventor/fields/SoSFVec2f.h>
28#include <Inventor/fields/SoSFColor.h>
29#include <Inventor/fields/SoSFString.h>
30#include <Inventor/fields/SoSFPlane.h>
31#include <Inventor/nodes/SoSeparator.h>
32#include <Inventor/nodes/SoSwitch.h>
33#include <Inventor/nodes/SoSubNode.h>
34#include <Inventor/SbViewportRegion.h>
35#include <Inventor/sensors/SoFieldSensor.h>
36
37#include "SoSFMLConnector.h"
38
39class SoView2D;
40class SoSFMLImage;
41
42//=============================================================
45
49//=============================================================
50class SOVIEW2D_API SoOrthoView2DBase : public SoSeparator
51{
52 SO_NODE_HEADER(SoOrthoView2DBase);
53
54public:
56
59
66
75
82
87
90
93
96
99
103
110
113
116
119
122
125
128
133
142
147
150
153
158
159
162
165
168
171
190
191
198
201
203
223
224
226
229
232
234
236 static void initClass();
237
238protected:
239
242
244
247 virtual mlField* getMLImageField(int /*viewerIndex*/) { return nullptr; }
248
251 virtual bool isViewerVisible(int viewerIndex) const;
252
257
262
272 void sliceZoomChanged(int which);
273
280
294 void viewingCenterChanged(int which);
295
297 void setSliceViewingCenterFor(int which, const SbVec3f& center);
298
299
304
309
314
323
336
349
358
363
365 static int sliceInitCB(const SoView2D *view2D, SoSFMLImage *image, void *user);
367 int sliceInit(const SoView2D *view2D, SoSFMLImage *image);
368
373
376
379
381 SoSwitch* _switch1;
382
384 SoView2D* _view[3];
385
388
390 int _timePoint[3];
391
394
400
405
407
411};
#define SOVIEW2D_API
File to resolve system dependencies in View2D library.
SoOrthoView2DBase uses three SoView2D nodes to create a 3D ortho viewer with three 2D views.
SoSFEnum cacheMode
caching of slices
SoSFTrigger startCine
Cinemode fields, relayed from view2d. However, only timePoint-cine makes sense.
SoSFInt32 numXSlices3
number of slices that are rendered in X for 3rd viewer
SoSFFloat cineSpeed
speed of cine mode (in seconds), minimum cine speed is fixed to one repaint per image
SoSFBool useManagedInteraction
prefer to use managed interaction instead of classical event handling if a SoView2DExtension provides...
SoSFPlane plane3
plane representing the slice in world coordinates of 3rd viewer
SoSFString status
status of extensions (object editing)
void marginChanged()
handle margin change
SoSFVec3f viewingCenter3
world position of the current center of the viewer3
SoSFTrigger stopCine
stop the cine mode
SoSFEnum cineRepeat
flag to indicated if loop or ping-pong is used
SoSFEnum zoomMode
zoom mode that defines mapping to the viewer area
SoSFInt32 numSlices2
number of slices that are rendered for 2nd viewer
SoSFInt32 timePoint
timepoint that is rendered
SoSFVec2f extraViewSize
normalized 2d size of the requested extra space. (Only used in LAYOUT_CUBE_CUSTOMIZED mode)
SoSFVec2f sliceOrigin3
the internal origin of the slice in voxels (for shifting inside of the 3rd view)
void setSliceViewingCenterFor(int which, const SbVec3f &center)
set viewing center for viewer which to center
void updateTimePoints()
update time points from SoView2Ds to SoOrthoView
SoSFFloat minSliceZoomKeyboard
minimum slice zoom for keyboard modifications
void sliceOriginChanged1CB(SoField *)
callback which updates external field
SoFieldSensor * _viewingCenterSensor
SoSFVec3f worldPosition
current world position
SoSFInt32 numXSlices2
number of slices that are rendered in X for 2nd viewer
SoSFBool cineFullRangeT
flag if the full time range or the time interval is used
SoFieldSensor * _sliceSensor1
void filterMode1Changed()
handle filterMode1 change
void sliceChanged(SoField *field)
handle changed slice in one of the SoView2Ds
SoSFTrigger edit
trigger the edit mode in a SoView2DExtension
SoSFPlane plane1
plane representing the slice in world coordinates of 1st viewer
void startCineModeCB(SoField *)
callback that calls startCineMode();
SoSFString seriesInstanceUID
the DICOM seriesInstanceUID of the image currently displayed
SoSFVec2f sliceOrigin1
the internal origin of the slice in voxels (for shifting inside of the 1st view)
SoSFPlane plane2
plane representing the slice in world coordinates of 2nd viewer
void filterMode2ChangedCB(SoField *)
callback which forwards to filterMode2Changed()
void viewingCenterChanged2CB(SoField *)
callback which forwards to viewingCenterChanged()
SoSFString viewerId1
id string for 1st viewer, should be unique in a network
SoFieldSensor * _zoomSensor1
void stopCineModeCB(SoField *)
callback that calls stopCineMode();
SoSFInt32 numSlices1
number of slices that are rendered for 1st viewer
void synchronizePanningChangedCB(SoField *)
callback which reacts on synchronizePanning state change
void timeChanged()
handle timepoint change of one of the SoView2Ds
SoSFEnum layoutMode
layout of the 3 views
SoSFBool cineAlwaysReset
Always reset to start time point and forward direction on start press (start with current time point ...
SoSFVec3f viewingCenter1
world position of the current center of the viewer1
SoOrthoView2DBase()
constructor, protected since this class is abstract.
SoSFVec3f viewingCenter
Common center position (in world CO) of the viewers.
SoFieldSensor * _zoomSensor3
SoSFBool invertKeyPanningDirections
invert panning by keyboard
void plane1Changed()
handle plane1 change
void sliceZoomChanged1CB(SoField *)
callback which forwards to sliceZoomChanged()
void sliceZoomChanged3CB(SoField *)
callback which forwards to sliceZoomChanged()
SoSFEnum blendMode
blend mode used for slice rendering
void viewingCenterChanged1CB(SoField *)
callback which forwards to viewingCenterChanged()
SoSFTrigger deleteSelected
trigger the deletion of the selected object in a SoView2DExtension
virtual mlField * getMLImageField(int)
return ML image field for viewer with given viewerIndex (0,1, or 2).
void filterMode3Changed()
handle filterMode3 change
void filterMode2Changed()
handle filterMode2 change
SoSFTrigger unzoom
unzoom
SoSFVec2f sliceOrigin2
the internal origin of the slice in voxels (for shifting inside of the 2nd view)
void plane3ChangedCB(SoField *)
callback which forwards to plane3Changed()
SoFieldSensor * _zoomSensor
SoSFBool worldPosSticky
set if world position should no change when input image changes
void maxTimePointChanged()
find max time point in all view2ds and assign to maxTimePoint
void sliceChangedCB(SoField *)
callback which forwards to sliceChanged()
void updateLayout()
update layout depending on the layoutMode
SoSFInt32 cineCenterT
center of timepoint cine
SoSFBool synchronizeZoom
set if the zooms of the views are synchronized
void viewingCenterChangedCB(SoField *)
callback which forwards to viewingCenterChanged()
void marginChangedCB(SoField *)
callback which forwards to marginChanged()
SoSFInt32 sliceStep1
step to next rendered slice for 1st viewer
SoSFVec3f viewingCenter2
world position of the current center of the viewer2
void sliceZoomChangedCB(SoField *)
callback which forwards to sliceZoomChanged()
SoSFEnum filterMode
filter mode used for slice rendering
SoSFString viewerId2
id string for 2nd viewer, should be unique in a network
void maxTimePointChangedCB(SoField *)
callback which forwards to maxTimePointChanged()
SoSFInt32 numSlices3
number of slices that are rendered for 3rd viewer
SoSFInt32 slab
slab of slices that are rendered
void connectFieldsTo(SoView2D *view)
update internal connections on layout change
SoSFBool keepSlicesInView
if this is set, the slices are prevented from leaving the visible area.
void zoomModeChanged()
handle zoomMode change
SoFieldSensor * _zoomSensor2
SoSFInt32 numXSlices1
number of slices that are rendered in X for 1st viewer
SoSFColor baseColor
base color for drawing
SoSFInt32 sliceStep2
step to next rendered slice for 2nd viewer
~SoOrthoView2DBase() override
void positionChanged()
handle changed worldPosition field
void startCineMode()
Find a valid master viewer and enable time cine mode.
SoSFFloat zoomModeParameter
zoom mode parameter, depends on zoomMode what its value means
void plane2ChangedCB(SoField *)
callback which forwards to plane2Changed()
void positionChangedCB(SoField *)
callback which forwards to postionChanged()
SoSFVec2f extraViewUpperRight
normalized 2d coordinates of the space, with 0,0 being lower/left
int sliceInit(const SoView2D *view2D, SoSFMLImage *image)
initialize the slices and worldPosition on image change (called from SoView2D)
SoView2D * _lastConnectedView
remember last view for connectFieldsTo()
SoSFVec2f margin
margin to the border of the internal viewers
SoFieldSensor * _sliceSensor3
static void initClass()
inventor runtime type system
void sliceOriginChanged3CB(SoField *)
callback which updates external field
void stopCineMode()
stop the cine mode
void plane3Changed()
handle plane3 change
void filterMode3ChangedCB(SoField *)
callback which forwards to filterMode3Changed()
void viewingCenterChanged(int which)
handle a changed slice origin of one of the SoView2Ds, or the common field (which = -1)
virtual bool isViewerVisible(int viewerIndex) const
returns true if the viewer with index viewerIndex (in 0..2) is visible in the current layout
SoFieldSensor * _posSensor
Field sensors.
void timeChangedCB(SoField *)
callback which forwards to timeChanged()
SoSFBool drawImageData
Fields.
SoSFFloat alphaFactor
alpha factor for drawing
void sliceZoomChanged2CB(SoField *)
callback which forwards to sliceZoomChanged()
void resetPanning()
resets panning
bool _inhibitViewingCenterSync
to temporarily inhibit syncing of viewing centers:
SoSFFloat sliceZoom
the internal slice zoom
SoFieldSensor * _sliceSensor2
int _cineMaster
master view2d index for cine mode. -1 if not running.
void seriesInstanceUIDChanged()
stop the cine mode
SoSFBool extraViewSpace
flag if extra space is available (depends on layout)
static int sliceInitCB(const SoView2D *view2D, SoSFMLImage *image, void *user)
callback which forwards to sliceInit()
SoSFInt32 maxTimePoint
maximum available timepoint
void updateLayoutCB(SoField *)
callback which forwards to updateLayout()
SoSFInt32 sliceStep3
step to next rendered slice for 3rd viewer
SoSFBool synchronizeFilterMode
Enable/Disable synchronizing of filterMode (used for slice rendering) between all viewers.
void zoomModeChangedCB(SoField *)
callback which forwards to zoomModeChanged()
void plane1ChangedCB(SoField *)
callback which forwards to plane1Changed()
SoSFEnum cineDirection
direction of Cinemode
SoSFVec2f extraViewLowerLeft
normalized 2d coordinates of the space, with 0,0 being lower/left
SoSFString viewerId3
id string for 3rd viewer, should be unique in a network
void filterMode1ChangedCB(SoField *)
callback which forwards to filterMode1Changed()
SoSwitch * _switch1
switch which contain the rendered scene
void zoomModeParameterChangedCB(SoField *)
callback which forwards to zoomModeParameterChanged()
void sliceOriginChanged2CB(SoField *)
callback which updates external field
void zoomModeParameterChanged()
handle zoomModeParameter change
SoSFBool snapToCenter
snap to center of image when image changes
SoSFBool synchronizePanning
Synchronizes panning so that all viewers are consistent with viewingCenter.
void plane2Changed()
handle plane2 change
SoSFBool alternCubeLayout
flag if the upper left quarter should be used by a viewer in the cube modi
void sliceZoomChanged(int which)
handle a changed slice zoom of one of the SoView2Ds
void viewingCenterChanged3CB(SoField *)
callback which forwards to viewingCenterChanged()
SoSFInt32 cineIntervalT
interval of timepoint cine
void seriesInstanceUIDChangedCB(SoField *)
callback that calls seriesInstanceUIDChanged();
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
#define mlField
A macro name for a void pointer to a field in the ML to make pointer more readable.
Definition mlAPI.h:54
Target mlrange_cast(Source arg)
Generic version of checked ML casts.