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
93 void SetVmeVector(std::vector<albaVME*> vmeVector);
94
96 std::vector<albaVME*> GetVmeVector();
97
98 void GetWidgetData(WidgetDataType &widget_data);
99
100 void SetArg(long arg) { m_Arg = arg;};
101 void SetBool(bool b) { m_Bool = b;};
102 void SetDouble(double f) { m_Double = f;};
104 void SetView(albaView* view) { m_View = view;};
105 void SetVme(albaVME* vme) { m_Vme = vme;};
106 void SetOp(albaOp* op) { m_Op = op;};
107 void SetMatrix(albaMatrix* mat) { m_Matrix = mat;};
108 void SetOldMatrix(albaMatrix* mat2) { m_OldMatrix =mat2;};
109 void SetMafObject(albaObject* obj) { m_MafObject = obj;}
110 void SetWidgetData(WidgetDataType &widget_data);
111
112
114 void * GetPointer() const { return m_Pointer; }
115
117 void SetPointer(void * pointer) { m_Pointer = pointer; }
118
119protected:
120 long m_Arg;
121 bool m_Bool;
122 double m_Double;
124
131 std::vector<albaVME*> m_VmeVector;
134
135 int m_x;
136 int m_y;
139
140// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
141#ifdef ALBA_USE_WX
142public:
143 albaEvent(void *sender, int id, wxWindow *win, long arg=0);
144 albaEvent(void *sender, int id, wxUpdateUIEvent *e, long arg=0);
145 albaEvent(void *sender, int id, wxObject *wxobj, long arg=0);
146
147 wxWindow* GetWin() {return m_Win;};
148 wxUpdateUIEvent* GetUIEvent() {return m_UpdateUIEvent;};
149 wxObject* GetWxObj() {return m_WxObj;};
150
151 void SetWin(wxWindow* win) { m_Win = win;};
152 void SetUIEvent(wxUpdateUIEvent *e) { m_UpdateUIEvent =e;};
153 void SetWxObj(wxObject *wxobj) { m_WxObj = wxobj;};
154
155protected:
156 wxWindow *m_Win;
157 wxUpdateUIEvent *m_UpdateUIEvent;
158 wxObject *m_WxObj;
159#endif
160
161// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
162#ifdef ALBA_USE_VTK
163public:
164 albaEvent(void *sender, int id, vtkProp *prop, albaVME *vme=NULL);
165 albaEvent(void *sender, int id, vtkObject *vtkobj, long arg=0);
166 albaEvent(void *sender, int id, vtkObject *vtkobj, albaString *s);
167
168 vtkProp* GetProp() {return m_VtkProp;};
169 vtkObject* GetVtkObj() {return m_VtkObj;};
170
171 void SetProp(vtkProp* prop) { m_VtkProp = prop;};
172 void SetVtkObj(vtkObject *vtkobj) { m_VtkObj = vtkobj;};
173
174protected:
175 vtkProp *m_VtkProp;
176 vtkObject *m_VtkObj;
177#endif
178
179//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
180
181public:
183 void Log();
184
185protected:
186
187 void Init(void *sender, int id, long arg=0);
188};
189#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:106
void SetVme(albaVME *vme)
Definition: albaEvent.h:105
int m_width
Definition: albaEvent.h:137
albaEvent(void *sender, int id, albaString *s, long arg=0)
albaObject * m_MafObject
Definition: albaEvent.h:130
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 SetVmeVector(std::vector< albaVME * > vmeVector)
set call data, data sent by sender (event's invoker) to all observers.
void SetView(albaView *view)
Definition: albaEvent.h:104
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:100
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:123
void SetBool(bool b)
Definition: albaEvent.h:101
WidgetDataType m_WidgetData
Definition: albaEvent.h:132
long m_Arg
Definition: albaEvent.h:120
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:125
albaEvent(void *sender, int id, double f, long arg=0)
bool m_Bool
Definition: albaEvent.h:121
albaEvent(void *sender, int id, albaVME *vme, bool b=false, long arg=0)
int GetY()
Definition: albaEvent.h:87
std::vector< albaVME * > m_VmeVector
Definition: albaEvent.h:131
albaString * GetString()
int GetHeight()
Definition: albaEvent.h:89
albaEvent * Copy()
std::vector< albaVME * > GetVmeVector()
return call data, data sent by sender (event's invoker) to all observers
albaEvent(void *sender, int id, albaView *view, wxWindow *win=NULL)
void SetPointer(void *pointer)
Sets Pointer.
Definition: albaEvent.h:117
double GetDouble()
Definition: albaEvent.h:77
albaOp * m_Op
Definition: albaEvent.h:127
albaEvent(void *sender, int id, long arg=0)
double m_Double
Definition: albaEvent.h:122
void SetDouble(double f)
Definition: albaEvent.h:102
albaMatrix * m_OldMatrix
Definition: albaEvent.h:129
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:138
albaTypeMacro(albaEvent, albaEventBase)
void SetOldMatrix(albaMatrix *mat2)
Definition: albaEvent.h:108
void * m_Pointer
Definition: albaEvent.h:133
void SetMatrix(albaMatrix *mat)
Definition: albaEvent.h:107
albaEvent(void *sender, int id, albaObject *albaobj, long arg=0)
void GetWidgetData(WidgetDataType &widget_data)
albaMatrix * m_Matrix
Definition: albaEvent.h:128
albaView * m_View
Definition: albaEvent.h:126
albaVME * GetVme()
Definition: albaEvent.h:80
albaMatrix * GetOldMatrix()
Definition: albaEvent.h:83
void * GetPointer() const
Returns Pointer.
Definition: albaEvent.h:114
void SetMafObject(albaObject *obj)
Definition: albaEvent.h:109
albaMatrix - Time stamped 4x4 Matrix.
Definition: albaMatrix.h:44
Abstract superclass for all ALBA classes implementing RTTI APIs.
Definition: albaObject.h:38
Definition: albaOp.h:51
albaString - performs common string operations on c-strings.
Definition: albaString.h:43
albaVME -
Definition: albaVME.h:150
albaView is the base class for Views in alba.
Definition: albaView.h:79