MeVisLab Toolbox Reference
SoView2DCallback.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 
21 typedef bool SoView2DEvalEventCB(void* usrData, SoView2D *dsl, View2DSliceList* slicelist, View2DEvent* ec, View2DEventPhase phase);
23 typedef void SoView2DDrawCB(void* usrData, View2DSliceList *dsl, View2DSlice* dslice,int slice);
24 
25 // deprecated names
26 #define evalEventCB SoView2DEvalEventCB
27 #define drawCB SoView2DDrawCB
28 
31 
40 {
41  SO_NODE_HEADER(SoView2DCallback);
42 
43 public:
44 
45  static void initClass();
46 
48 
50  void setEvalEventCB(SoView2DEvalEventCB* eval, void* usrData);
52  void setDrawCB(SoView2DDrawCB* draw, void* usrData);
53 
55  void draw(View2DSliceList *dsl, View2DSlice* dslice,int slice) override;
56 
58  bool evalEvent(SoView2D* view2d, View2DSliceList* slicelist,
59  View2DEvent* ec, View2DEventPhase phase) override;
60 
61 private:
63  SoView2DEvalEventCB* _eval;
65  void* _evalData;
66 
68  SoView2DDrawCB* _draw;
70  void* _drawData;
71 };
bool SoView2DEvalEventCB(void *usrData, SoView2D *dsl, View2DSliceList *slicelist, View2DEvent *ec, View2DEventPhase phase)
SoView2DCallback allows to set a callback for evalEvent and draw virtual functions of a SoView2DExten...
void SoView2DDrawCB(void *usrData, View2DSliceList *dsl, View2DSlice *dslice, int slice)
Callback used for draw of SoView2DExtension.
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.
SoView2DCallback allows to set a callback for evalEvent and draw virtual functions of a SoView2DExten...
void setEvalEventCB(SoView2DEvalEventCB *eval, void *usrData)
set a callback for evalEvent, clears previous callback
void draw(View2DSliceList *dsl, View2DSlice *dslice, int slice) override
reimplemented from SoView2DExtension
static void initClass()
void setDrawCB(SoView2DDrawCB *draw, void *usrData)
set a callback for draw, clears previous callback
bool evalEvent(SoView2D *view2d, View2DSliceList *slicelist, View2DEvent *ec, View2DEventPhase phase) override
reimplemented from SoView2DExtension
SoView2DExtension Base class for all View2DExtensions used for drawing and event handling on the View...
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