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
30
32 SoSFFloat min;
34 SoSFFloat max;
36 SoSFFloat sensitivity;
37 // mhi 20051013: allow inversion of currently implemented mouse move direction.
38 SoSFEnum dragMode;
43
46 SoSFBool evalStarted;
47
48
50 static void initClass();
51
54
56 void startDrawing(View2DSliceList *slicelist) override;
57
59 bool evalEvent(SoView2D* view2d, View2DSliceList* slicelist,
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
70 void editingOnChanged(SoField* field) override;
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
102private:
105};
View2DEventPhase
#define SOVIEW2D_API
File to resolve system dependencies in View2D library.
void pointerPosition(SoState *state, const SoPointerPosition &pos) override
Same as below, with additional SoState argument. By default, simply calls the below version.
void pointerLeftWindow(SoState *state) override
Same as below, with additional SoState argument. By defaults, simply calls the below version.
SoPointerPosition manages the current position of the mouse cursor.
SoView2DInteractionExtension(const std::string &actionID, bool positionSensitive=true)
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. By 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. By default, 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
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
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