MeVisLab Toolbox Reference
SoView2DSlicer.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
19#include <Inventor/fields/SoSFInt32.h>
20
21class SoView2DSlicerOffsetAction;
22
25{
26 SO_NODE_HEADER(SoView2DSlicer);
27
28public:
30 SoSFFloat sensitivity;
31
33 static void initClass();
34
37
40
42 void updateValues() override;
43
45 bool evalEvent(SoView2D* view2d, View2DSliceList* slicelist,
46 View2DEvent* ec, View2DEventPhase phase) override;
47
49 bool modifyStartSlice(SoView2D* view2d, int offset);
50 static bool modifyTimePoint(SoView2D* view2d, int offset);
51
53 SoSFInt32 stepSize;
54
55protected:
56 void doSliceByMouse(float diffY, SoView2D* view2d);
57
60 void startPressAt(const SoPointerPosition& pos) override;
61 void dragMoveTo(const SoPointerPosition& pos) override;
62 SoPointingAction* endPress(int clickCount) override;
64
66 void editingOnChanged(SoField* field) override;
67
69 virtual void sensitivityChanged(SoField* field);
70
72 float _oldY;
74 float _sumY;
79
81 SoView2DSlicerOffsetAction* _offsetAction;
82};
View2DEventPhase
#define SOVIEW2D_API
File to resolve system dependencies in View2D library.
SoPointerPosition manages the current position of the mouse cursor.
SoView2DInteractionExtension(const std::string &actionID, bool positionSensitive=true)
bool evalEvent(SoView2D *view2d, View2DSliceList *slicelist, View2DEvent *ec, View2DEventPhase phase) override
reimplemented from SoView2DExtension
static bool modifyTimePoint(SoView2D *view2d, int offset)
void updateValues() override
setup code
SoView2DSlicerOffsetAction * _offsetAction
Additional offset action for changing start slice/time point.
bool modifyStartSlice(SoView2D *view2d, int offset)
Add offset to start slice/time point, returns true if the value was changed:
void editingOnChanged(SoField *field) override
called when editingOn field is touched:
float _sumY
current sum of y movement since last slice change
unsigned _prevWheelCode
previous wheel rotation orientation & sign code
static void initClass()
inventor runtime type system
void doSliceByMouse(float diffY, SoView2D *view2d)
SoSFInt32 stepSize
Increment slice by this many slices on each mouse wheel action.
void dragMoveTo(const SoPointerPosition &pos) override
float _oldY
previous y coordinate of mouse
SoSFBool permitInteractionOutsideImage
Field for toggling the interaction out of the image on/off.
int _sumWheel
current sum of 1/8 degrees of wheel rotation
void startPressAt(const SoPointerPosition &pos) override
virtual void sensitivityChanged(SoField *field)
called when sensitivity field is touched:
SoSFFloat sensitivity
sensitivity used for sliding
SoPointingAction * endPress(int clickCount) override
SoView2DSlicer()
Constructor.
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