ALBA
albaDataPipe.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaDataPipe
5 Authors: 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 __albaDataPipe_h
17#define __albaDataPipe_h
18//----------------------------------------------------------------------------
19// includes :
20//----------------------------------------------------------------------------
22#include "albaObserver.h"
23#include "albaTimeStamped.h"
24#include "albaOBB.h"
25
26//----------------------------------------------------------------------------
27// forward declarations
28//----------------------------------------------------------------------------
29class albaVMEItem;
30class albaVME;
31
32#ifdef ALBA_USE_VTK
33 class vtkDataSet;
34#endif
35
50class ALBA_EXPORT albaDataPipe:public albaReferenceCounted, public albaTimeStamped, public albaObserver
51{
52public:
54 virtual ~albaDataPipe();
55
57
63 virtual void UpdateBounds() {}
64
66 virtual void Update() {}
67
73 albaOBB *GetBounds() {return &m_Bounds;}
74
75#ifdef ALBA_USE_VTK
78 virtual vtkDataSet *GetVTKData() {return NULL;}
79#endif
80
83 albaTimeStamp GetTimeStamp() {return m_CurrentTime;}
84
86 virtual unsigned long GetMTime();
87
89 virtual bool Accept(albaVME *vme) {return vme!=NULL;}
90
98
102 virtual int DeepCopy(albaDataPipe *pipe);
103
105 int SetVME(albaVME *vme);
106 albaVME *GetVME() {return m_VME;}
107
109 void SetDependOnPose(int flag) {m_DependOnPose=flag;Modified();}
110 int GetDependOnPose() {return m_DependOnPose;}
111
113 void SetDependOnVMETime(int flag) {m_DependOnVMETime=flag;Modified();}
114 int GetDependOnVMETime() {return m_DependOnVMETime;}
115
117 void SetDependOnAbsPose(int flag) {m_DependOnAbsPose=flag;Modified();}
118 int GetDependOnAbsPose() {return m_DependOnAbsPose;}
119
121 virtual void Print(std::ostream& os, const int tabs=0) const;
122
123 virtual void OnEvent(albaEventBase *alba_event);
124
125protected:
127 virtual void PreExecute();
128
130 virtual void Execute();
131
136
140
141private:
142 albaDataPipe(const albaDataPipe&); //Not implemented
143 void operator=(const albaDataPipe&); //Not implemented
144};
145#endif /* __albaDataPipe_h */
double albaTimeStamp
type for time varying data timestamps (not for pipelines timestamps!)
Definition: albaDefines.h:57
abstract class for process objects producing data as output of a VME.
Definition: albaDataPipe.h:51
void SetTimeStamp(albaTimeStamp t)
Set/Get the current time.
virtual void OnEvent(albaEventBase *alba_event)
process the events sent by subjects
virtual unsigned long GetMTime()
return modification time
int GetDependOnAbsPose()
Definition: albaDataPipe.h:118
int m_DependOnVMETime
Definition: albaDataPipe.h:139
albaTimeStamp m_CurrentTime
time for which data is computed
Definition: albaDataPipe.h:133
albaVME * GetVME()
Definition: albaDataPipe.h:106
albaTimeStamp GetTimeStamp()
Definition: albaDataPipe.h:83
virtual int DeepCopy(albaDataPipe *pipe)
Copy from another pipe, the function return VTK_ERROR if the specified pipe is not compatible.
int GetDependOnPose()
Definition: albaDataPipe.h:110
albaDataPipe * MakeACopy()
Make a copy of this pipe, also copying all parameters.
albaOBB * GetBounds()
Return the current dataset bounds, updated by UpdateBounds() and Update() when CurrentTime is changed...
Definition: albaDataPipe.h:73
albaVME * m_VME
pointer to the VME for which output is computed
Definition: albaDataPipe.h:134
virtual void Update()
update the output of the data pipe
Definition: albaDataPipe.h:66
void SetDependOnPose(int flag)
enable/disable the dependence of this data pipe from VME's pose matrix
Definition: albaDataPipe.h:109
virtual void Print(std::ostream &os, const int tabs=0) const
print a dump of this object
int m_DependOnAbsPose
Definition: albaDataPipe.h:138
albaTypeMacro(albaDataPipe, albaReferenceCounted)
void SetDependOnVMETime(int flag)
enable/disable the dependence of this data pipe from VME's pose matrix
Definition: albaDataPipe.h:113
void SetDependOnAbsPose(int flag)
enable/disable the dependence of this data pipe from VME's ABS pose matrix
Definition: albaDataPipe.h:117
albaOBB m_Bounds
bounds of the output data
Definition: albaDataPipe.h:132
virtual ~albaDataPipe()
int GetDependOnVMETime()
Definition: albaDataPipe.h:114
virtual void UpdateBounds()
This function makes the current bounds to be updated.
Definition: albaDataPipe.h:63
virtual void PreExecute()
function called before of data pipe execution
virtual void Execute()
function called to updated the data pipe output
int SetVME(albaVME *vme)
Set/Get the VME to be used as input for this PIPE.
virtual bool Accept(albaVME *vme)
This function returns true if the VME is accepted by this Pipe.
Definition: albaDataPipe.h:89
albaMTime m_PreExecuteTime
use to reduce the number of time PreExecute is called
Definition: albaDataPipe.h:135
Implementation of the message object for the Subject/Observer design pattern.
Definition: albaEventBase.h:49
albaMTime - record modification timestamp.
Definition: albaMTime.h:38
This class simply stores a Box boundary (i.e.
Definition: albaOBB.h:37
Interface implementing the Observer of the Subject/Observer design pattern.
Definition: albaObserver.h:36
albaReferenceCounted - abstract base class for ALBA objects with reference counting.
class acting as an interface for timestamped objects This object simply defines few methods for manag...
virtual void Modified()
Update this objects modification time.
albaVME -
Definition: albaVME.h:150