MeVisLab Toolbox Reference
SoView2DOverlay.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"
23 
24 ML_START_NAMESPACE
25 
26  class LUTFunction;
27  template <typename T> class LUTData;
28 
29 ML_END_NAMESPACE
30 
31 class SoView2D;
32 
33 
35 
40 {
41  SO_NODE_HEADER(SoView2DOverlay);
42 
43 public:
45 
49  SoSFBool cacheTextures;
51  SoSFEnum blendMode;
55  SoSFEnum filterMode;
57  SoSFFloat alphaFactor;
59  SoSFColor baseColor;
63  SoSFInt32 timePoint;
65  SoSFInt32 maxTimePoint;
67  SoSFEnum lutPrecision;
68 
71  SoSFBool useWorldCoords;
72 
74  SoSFBool applyLut;
75 
77  SoSFBool isCheckerTiling;
78 
80  SoSFInt32 checkerTileSize;
81 
84 
86  SoSFString overlayName;
87 
89 
91  static void initClass();
92 
95 
97  void startDrawing(View2DSliceList *slicelist) override;
99  void endDrawing(View2DSliceList *slicelist) override;
100 
102  void draw(View2DSliceList *dsl, View2DSlice* dslice, int slice) override;
103 
105  bool evalEvent(SoView2D* view2d, View2DSliceList* slicelist,
106  View2DEvent* ec, View2DEventPhase phase) override;
107 
109  void GLRender(SoGLRenderAction *action) override;
110 
111 protected:
112 
115 
118 
122  int _id;
128  unsigned int _imageSerial;
129 
132 
134  ~SoView2DOverlay() override;
139  virtual int getTimePoint(View2DSliceList *slicelist, int slice);
140 };
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
SoView2DCallback allows to set a callback for evalEvent and draw virtual functions of a SoView2DExten...
Draws an overlay image on the SoView2D.
View2DLut * _lutData
the lut data that is rendered
SoSFBool applyLut
if this flag is enabled, the overlay uses the lut that is present in the scene graph,...
SoSFInt32 checkerTileSize
The size of the checkerboard tiles.
SoView2DOverlay()
Constructor.
virtual int getTimePoint(View2DSliceList *slicelist, int slice)
Returns the current timepoint which is either the actual shown timepoint or the timepoint overwritten...
~SoView2DOverlay() override
Destructor.
SoSFBool overwriteCurrentTimePoint
Should the current time point be overwritten?
SoView2DShaderOverlayInfo _overlayInfo
for usage by shaders
SoSFEnum filterMode
filter mode for rendering
SoSFBool useWorldCoords
if this flag is on, the overlay can also render correct subimage overlays if the image is parallel to...
unsigned int _imageSerial
serial number of last input image
int _id
id for texture caching
SoSFMLImage image
Fields.
void draw(View2DSliceList *dsl, View2DSlice *dslice, int slice) override
reimplemented from SoView2DExtension
void startDrawing(View2DSliceList *slicelist) override
reimplemented from SoView2DExtension
SoSFEnum lutPrecision
defines the precision of the LUT
SoSFEnum blendMode
select the blend mode of the overlay
bool _reloadData
flag if data needs to be reloaded
SoSFColor baseColor
set the base color which is multiplied with the overlay
ml::LUTFunction * _lutFunction
the lut from the scene, stored by GLRender
void GLRender(SoGLRenderAction *action) override
reimplemented from SoNode, stores the LUT for later rendering
SoSFFloat alphaFactor
set the alpha factor for drawing
SoSFBool isCheckerTiling
If enabled, draws a checkerboard tile each.
SoSFInt32 maxTimePoint
maximum timepoint value available (maximum of timePoint field)
static void initClass()
inventor runtime type system
SoSFBool areCheckerTilesInverted
Invert the checkerboard with this flag.
bool _oldUseWorldCoords
previous world coord flag
SoSFBool inheritFilterMode
inherit filter mode
SoSFString overlayName
Sets the name of the overlay for usage in a SoView2DShaderOverlay.
SoSFBool cacheTextures
flag if textures should be cached
bool evalEvent(SoView2D *view2d, View2DSliceList *slicelist, View2DEvent *ec, View2DEventPhase phase) override
reimplemented from SoView2DExtension
int _oldTimePoint
previous timepoint
SoSFInt32 timePoint
select the timepoint of the input image to render
void endDrawing(View2DSliceList *slicelist) override
reimplemented from SoView2DExtension
Stores information for each overlay to render.
SoView2D is a 2D viewer for image data.
Definition: SoView2D.h:62
View2DEvent stores all information on an event on a SoView2D.
A small wrapper class for the LUT data.
Definition: View2DLut.h:23
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
Common base class for lookup tables.
Definition: mlLUTFunction.h:55