MeVisLab Toolbox Reference
SoView2DSliceZoom.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#pragma once
14
16
17//------------------------------------------------------------------
19
21{
22 SO_NODE_HEADER(SoView2DSliceZoom);
23
24public:
25
26 enum DragMode {
28 DRAG_APPROACH_AND_DEPART
29 };
30
37 // mhi 20051013: allow inversion of currently implemented mouse move direction.
43
47
48
50 static void initClass();
51
54
56 void startDrawing(View2DSliceList *slicelist) override;
57
60 View2DEvent* ec, View2DEventPhase phase) override;
61
63
64protected:
65 void doZoom(float diffY, SoView2D* view2d);
66
67 void updateZoomCenter(int deviceX, int deviceY, SoView2D* view2d, View2DSliceList* slicelist) const;
68
71
74 void startPressAt(const SoPointerPosition& pos) override;
75 void dragMoveTo(const SoPointerPosition& pos) override;
76 SoPointingAction* endPress(int clickCount) override;
77
78 void pointerPosition(SoState* state, const SoPointerPosition& pos) override;
79 void pointerLeftWindow(SoState* state) override;
81
83
85 float _oldY;
87 float _currentx;
89 float _currenty;
95 bool _gotoOn;
98
101};
View2DEventPhase
event phase for simple extensions that grab the focus, do something (motion) and are released afterwa...
#define SOVIEW2D_API
File to resolve system dependencies in View2D library.
SoCommandAction is the base class for instantaneous actions.
SoPointerPosition manages the current position of the mouse cursor.
SoPointingAction is the base class for any mouse based interaction.
SoView2DInteractionExtension is base class for all SoView2DExtensions that want to support the Manage...
allows to change the slice zoom by y mouse movement
void doZoom(float diffY, SoView2D *view2d)
SoPointingAction * endPress(int clickCount) override
float _currenty
current y slice shift
float _oldY
previous y position
bool _started
set to true if EVENT_START was called
void dragMoveTo(const SoPointerPosition &pos) override
SoSFFloat sensitivity
sensitivity of zooming
void pointerLeftWindow(SoState *state) override
Same as below, with additional SoState argument. Be defaults simply calls the below version.
SoView2DSliceZoom()
constructor
bool evalEvent(SoView2D *view2d, View2DSliceList *slicelist, View2DEvent *ec, View2DEventPhase phase) override
reimplemented from SoView2DExtension
static void initClass()
inventor runtime type system
bool _gotoOn
flag to trigger zoom on repaint
float _currentx
current x slice shift
void editingOnChanged(SoField *field) override
called when editingOn field is touched:
SoSFBool useAlternativeZoomFormula
Uses an alternative formula to compute the zoom factor.
float _newcenterx
new x center
void startDrawing(View2DSliceList *slicelist) override
reimplemented from SoView2DExtension
float _newcentery
new y center
void pointerPosition(SoState *state, const SoPointerPosition &pos) override
Same as below, with additional SoState argument. Be defaults simply calls the below version.
void toggleZoomToCursor()
SoSFBool zoomAroundClickPosition
if true then the click position is fixed while zooming
SoCommandAction * _zoomToCursorAction
void updateZoomCenter(int deviceX, int deviceY, SoView2D *view2d, View2DSliceList *slicelist) const
SoSFBool evalStarted
if true _started is evaluated during event handling.
SoSFFloat min
minimum zoom value
bool _currentPosValid
flag if _currentx and _currenty are valid
SoSFFloat max
maximum zoom value
void startPressAt(const SoPointerPosition &pos) override
interface forwarded from SoPointingAction:
SoView2D is a 2D viewer for image data.
Definition SoView2D.h:62
View2DEvent stores all information on an event on a SoView2D.
a list that holds all View2DSlice objects (lazily created) of a SoView2D
Target mlrange_cast(Source arg)
Generic version of checked ML casts.