MeVisLab Toolbox Reference
SoView2DOverlayDecoration.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 <Inventor/fields/SoFields.h>
19 
20 #include "SoView2DCallback.h"
21 #include "SoSFMLImage.h"
22 
23 class SoView2D;
24 
25 
27 
32 {
33  SO_NODE_HEADER(SoView2DOverlayDecoration);
34 
35 public:
37 
40 
42  SoSFFloat magnifyFactor;
43 
44  SoSFBool border;
46  SoSFColor borderColor;
47  SoSFFloat borderBlend;
48  SoSFBool leftRuler;
49  SoSFBool rightRuler;
50  SoSFBool topRuler;
51  SoSFBool bottomRuler;
52  SoSFColor rulerColor;
53  SoSFBool rulerShadow;
54  SoSFColor rulerShadowColor;
55  SoSFFloat rulerBlend;
56  SoSFFloat rulerMarkLength;
58 
60 
61  enum Position {
62  TOP, BOTTOM, LEFT, RIGHT
63  };
64 
66  static void initClass();
67 
70 
72  void draw(View2DSliceList *dsl, View2DSlice* dslice, int slice) override;
73 
74 protected:
75 
78 
80  void drawRuler(float mmToPixel,float x1, float y1, float x2, float y2, SoView2DOverlayDecoration::Position pos);
81 
84 };
#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
SoView2DCallback allows to set a callback for evalEvent and draw virtual functions of a SoView2DExten...
Draws an overlay image on the SoView2D.
void draw(View2DSliceList *dsl, View2DSlice *dslice, int slice) override
reimplemented from SoView2DExtension
~SoView2DOverlayDecoration() override
Destructor.
bool isImageParallel(View2DSliceList *dsl)
Return true if overlay is parallel to image up to slice thickness.
static void initClass()
inventor runtime type system
SoView2DOverlayDecoration()
Constructor.
SoSFFloat magnifyFactor
set the magnifyFactor that is used for the ruler
void drawRuler(float mmToPixel, float x1, float y1, float x2, float y2, SoView2DOverlayDecoration::Position pos)
draw a ruler at the given position
SoView2D is a 2D viewer for image data.
Definition: SoView2D.h:62
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