ALBA
albaEvent.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaEvent
5 Authors: Silvano Imboden, Marco Petrone
6
7 Copyright (c) BIC
8 All rights reserved. See Copyright.txt or
9
10
11 This software is distributed WITHOUT ANY WARRANTY; without even
12 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13 PURPOSE. See the above copyright notice for more information.
14
15=========================================================================*/
16#ifndef __albaEvent_h
17#define __albaEvent_h
18//----------------------------------------------------------------------------
19// includes:
20//----------------------------------------------------------------------------
21#include "albaDefines.h" // albaDefines should alway be included as first
22#include "albaDecl.h"
23#include "albaEventBase.h" // base class for albaEvent
24#include "albaObserver.h"
25
26//----------------------------------------------------------------------------
27// Forward References:
28//----------------------------------------------------------------------------
29class albaView;
30class albaOp;
31class albaVME;
32class albaMatrix;
33class albaString;
34
35#ifdef ALBA_USE_VTK
36 class vtkObject;
37 class vtkProp;
38#endif
39
40 class wxUpdateUIEvent;
41
42#ifdef ALBA_EXPORTS
43#include "albaDllMacros.h"
44 EXPORT_STL_VECTOR(ALBA_EXPORT,albaVME *);
45#endif
46//----------------------------------------------------------------------------
47// albaEvent :
48//----------------------------------------------------------------------------
54class ALBA_EXPORT albaEvent : public albaEventBase
55{
56public:
58
60 albaEvent(void *sender, int id, long arg=0);
61 albaEvent(void *sender, int id, bool b, long arg=0);
62 albaEvent(void *sender, int id, double f, long arg=0);
63 albaEvent(void *sender, int id, albaString *s, long arg=0);
64 albaEvent(void *sender, int id, albaString *s, int x, int y, int width, int height, long arg=0);
65 albaEvent(void *sender, int id, albaVME *vme, bool b=false, long arg=0);
66 albaEvent(void *sender, int id, albaView *view, wxWindow *win=NULL);
67 albaEvent(void *sender, int id, albaOp *op, long arg=0);
68 albaEvent(void *sender, int id, albaObject *albaobj, long arg=0);
69 albaEvent(void *sender, int id, albaObject *albaobj, albaString *s, long arg=0);
70 albaEvent(void *sender, int id, WidgetDataType &widget_data, long arg=0);
71 albaEvent(void *sender, int id, albaMatrix *m1,albaMatrix *m2=NULL);
72
73 virtual void DeepCopy(const albaEventBase *alba_event);
74
75 long GetArg() {return m_Arg;};
76 bool GetBool() {return m_Bool;};
77 double GetDouble() {return m_Double;};
79 albaView* GetView() {return m_View;};
80 albaVME* GetVme() {return m_Vme;};
81 albaOp* GetOp() {return m_Op;};
82 albaMatrix* GetMatrix() {return m_Matrix;};
83 albaMatrix* GetOldMatrix() {return m_OldMatrix;};
84 albaObject* GetMafObject() {return m_MafObject;}
85
86 int GetX() {return m_x;};
87 int GetY() {return m_y;};
88 int GetWidth() {return m_width;};
89 int GetHeight() {return m_height;};
90
91 void GetWidgetData(WidgetDataType &widget_data);
92
93 void SetArg(long arg) { m_Arg = arg;};
94 void SetBool(bool b) { m_Bool = b;};
95 void SetDouble(double f) { m_Double = f;};
97 void SetView(albaView* view) { m_View = view;};
98 void SetVme(albaVME* vme) { m_Vme = vme;};
99 void SetOp(albaOp* op) { m_Op = op;};
100 void SetMatrix(albaMatrix* mat) { m_Matrix = mat;};
101 void SetOldMatrix(albaMatrix* mat2) { m_OldMatrix =mat2;};
102 void SetMafObject(albaObject* obj) { m_MafObject = obj;}
103 void SetWidgetData(WidgetDataType &widget_data);
104
105
107 void * GetPointer() const { return m_Pointer; }
108
110 void SetPointer(void * pointer) { m_Pointer = pointer; }
111
112protected:
113 long m_Arg;
114 bool m_Bool;
115 double m_Double;
117
126
127 int m_x;
128 int m_y;
131
132// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
133#ifdef ALBA_USE_WX
134public:
135 albaEvent(void *sender, int id, wxWindow *win, long arg=0);
136 albaEvent(void *sender, int id, wxUpdateUIEvent *e, long arg=0);
137 albaEvent(void *sender, int id, wxObject *wxobj, long arg=0);
138
139 wxWindow* GetWin() {return m_Win;};
140 wxUpdateUIEvent* GetUIEvent() {return m_UpdateUIEvent;};
141 wxObject* GetWxObj() {return m_WxObj;};
142
143 void SetWin(wxWindow* win) { m_Win = win;};
144 void SetUIEvent(wxUpdateUIEvent *e) { m_UpdateUIEvent =e;};
145 void SetWxObj(wxObject *wxobj) { m_WxObj = wxobj;};
146
147protected:
148 wxWindow *m_Win;
149 wxUpdateUIEvent *m_UpdateUIEvent;
150 wxObject *m_WxObj;
151#endif
152
153// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
154#ifdef ALBA_USE_VTK
155public:
156 albaEvent(void *sender, int id, vtkProp *prop, albaVME *vme=NULL);
157 albaEvent(void *sender, int id, vtkObject *vtkobj, long arg=0);
158 albaEvent(void *sender, int id, vtkObject *vtkobj, albaString *s);
159
160 vtkProp* GetProp() {return m_VtkProp;};
161 vtkObject* GetVtkObj() {return m_VtkObj;};
162
163 void SetProp(vtkProp* prop) { m_VtkProp = prop;};
164 void SetVtkObj(vtkObject *vtkobj) { m_VtkObj = vtkobj;};
165
166protected:
167 vtkProp *m_VtkProp;
168 vtkObject *m_VtkObj;
169#endif
170
171//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
172
173public:
175 void Log();
176
177protected:
178
179 void Init(void *sender, int id, long arg=0);
180};
181#endif /* __albaEvent_h */
#define EXPORT_STL_VECTOR(declspec_, T_)
Definition: albaDllMacros.h:84
Implementation of the message object for the Subject/Observer design pattern.
Definition: albaEventBase.h:49
albaEvent - Class implementing ALBA application events.
Definition: albaEvent.h:55
albaOp * GetOp()
Definition: albaEvent.h:81
int GetX()
Definition: albaEvent.h:86
void SetOp(albaOp *op)
Definition: albaEvent.h:99
void SetVme(albaVME *vme)
Definition: albaEvent.h:98
int m_width
Definition: albaEvent.h:129
albaEvent(void *sender, int id, albaString *s, long arg=0)
albaObject * m_MafObject
Definition: albaEvent.h:123
albaEvent(void *sender, int id, albaMatrix *m1, albaMatrix *m2=NULL)
albaMatrix * GetMatrix()
Definition: albaEvent.h:82
albaEvent(void *sender, int id, albaString *s, int x, int y, int width, int height, long arg=0)
void SetView(albaView *view)
Definition: albaEvent.h:97
albaEvent(void *sender, int id, albaObject *albaobj, albaString *s, long arg=0)
albaObject * GetMafObject()
Definition: albaEvent.h:84
void SetArg(long arg)
Definition: albaEvent.h:93
void SetWidgetData(WidgetDataType &widget_data)
void Log()
albaEvent(void *sender, int id, albaOp *op, long arg=0)
long GetArg()
Definition: albaEvent.h:75
albaString * m_ALBAString
Definition: albaEvent.h:116
void SetBool(bool b)
Definition: albaEvent.h:94
WidgetDataType m_WidgetData
Definition: albaEvent.h:124
long m_Arg
Definition: albaEvent.h:113
void SetString(albaString *s)
albaEvent(void *sender, int id, WidgetDataType &widget_data, long arg=0)
bool GetBool()
Definition: albaEvent.h:76
albaEvent(void *sender, int id, bool b, long arg=0)
virtual void DeepCopy(const albaEventBase *alba_event)
albaVME * m_Vme
Definition: albaEvent.h:118
albaEvent(void *sender, int id, double f, long arg=0)
bool m_Bool
Definition: albaEvent.h:114
albaEvent(void *sender, int id, albaVME *vme, bool b=false, long arg=0)
int GetY()
Definition: albaEvent.h:87
albaString * GetString()
int GetHeight()
Definition: albaEvent.h:89
albaEvent * Copy()
albaEvent(void *sender, int id, albaView *view, wxWindow *win=NULL)
void SetPointer(void *pointer)
Sets Pointer.
Definition: albaEvent.h:110
double GetDouble()
Definition: albaEvent.h:77
albaOp * m_Op
Definition: albaEvent.h:120
albaEvent(void *sender, int id, long arg=0)
double m_Double
Definition: albaEvent.h:115
void SetDouble(double f)
Definition: albaEvent.h:95
albaMatrix * m_OldMatrix
Definition: albaEvent.h:122
int GetWidth()
Definition: albaEvent.h:88
void Init(void *sender, int id, long arg=0)
albaView * GetView()
Definition: albaEvent.h:79
int m_height
Definition: albaEvent.h:130
albaTypeMacro(albaEvent, albaEventBase)
void SetOldMatrix(albaMatrix *mat2)
Definition: albaEvent.h:101
void * m_Pointer
Definition: albaEvent.h:125
void SetMatrix(albaMatrix *mat)
Definition: albaEvent.h:100
albaEvent(void *sender, int id, albaObject *albaobj, long arg=0)
void GetWidgetData(WidgetDataType &widget_data)
albaMatrix * m_Matrix
Definition: albaEvent.h:121
albaView * m_View
Definition: albaEvent.h:119
albaVME * GetVme()
Definition: albaEvent.h:80
albaMatrix * GetOldMatrix()
Definition: albaEvent.h:83
void * GetPointer() const
Returns Pointer.
Definition: albaEvent.h:107
void SetMafObject(albaObject *obj)
Definition: albaEvent.h:102
albaMatrix - Time stamped 4x4 Matrix.
Definition: albaMatrix.h:45
Abstract superclass for all ALBA classes implementing RTTI APIs.
Definition: albaObject.h:38
Definition: albaOp.h:56
albaString - performs common string operations on c-strings.
Definition: albaString.h:43
albaVME -
Definition: albaVME.h:151
albaView is the base class for Views in alba.
Definition: albaView.h:76