MeVisLab Toolbox Reference
SoView2DMagnifyController.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 <SoView2DExtension.h>
19 #include <View2DSlice.h>
20 #include <View2DSliceList.h>
21 
22 #include <Inventor/fields/SoSFFloat.h>
23 #include <Inventor/fields/SoSFVec2f.h>
24 #include <Inventor/fields/SoSFInt32.h>
25 #include <Inventor/fields/SoSFVec3f.h>
26 #include <Inventor/fields/SoSFTrigger.h>
27 #include <Inventor/sensors/SoFieldSensor.h>
28 #include <SoSFMLImage.h>
29 
32 {
34  SO_NODE_HEADER(SoView2DMagnifyController);
35 
36 public:
39 
41  static void initClass();
42 
44 
46 
48 
50 
51  SoSFVec2f translationScale;
52 
53  SoSFFloat magnify;
54 
56 
57  SoSFBool inplace;
58 
59  SoSFVec2f inplaceWindowSize;
60 
61  // out
62 
63  SoSFInt32 startSlice;
64 
65  SoSFVec2f sliceOrigin;
66 
67  SoSFFloat pixelPerMm;
68 
69  SoSFVec3f worldStartPosition;
70 
71  SoSFTrigger showWindow;
72 
73  SoSFTrigger closeWindow;
74 
75  SoSFVec2f lowerLeft;
76 
77  SoSFVec2f upperRight;
78 
80 
81 
83  bool evalEvent(SoView2D *view2d, View2DSliceList *list,
84  View2DEvent* event, View2DEventPhase phase) override;
85 
87  void draw(View2DSliceList *list, View2DSlice *slice, int z) override;
88 
89 protected:
92 
94  void windowCurrentPositionChanged(SoField* field = nullptr);
95 
97  View2DEvent* ec);
98 
99 private:
102  SbVec3f _lastSelectedPos;
103 };
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.
The SoSFMLImage field is the interface used by Inventor Nodes to access image data (in the current im...
Definition: SoSFMLImage.h:70
SoView2DExtension Base class for all View2DExtensions used for drawing and event handling on the View...
The Inventor module class SoView2DMagnifyController derived from SoView2DExtension.
bool evalEvent(SoView2D *view2d, View2DSliceList *list, View2DEvent *event, View2DEventPhase phase) override
Handling of events occurring in the viewer.
void updateInplace(View2DSliceList *list, View2DEvent *ec)
SoView2DMagnifyController()
Constructor.
void windowCurrentPositionChanged(SoField *field=nullptr)
Called when field windowCurrentPosition changed.
~SoView2DMagnifyController() override
Protected destructor.
void draw(View2DSliceList *list, View2DSlice *slice, int z) override
Virtual method called by the SoView2D node when an image is rendered.
static void initClass()
Initializes this class (called on dll initialization).
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
a single slice that is stored in a View2DSliceList, typically created by a View2DSliceList
Definition: View2DSlice.h:48