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 class vtkAlgorithmOutput;
35#endif
36
51class ALBA_EXPORT albaDataPipe:public albaReferenceCounted, public albaTimeStamped, public albaObserver
52{
53public:
55 virtual ~albaDataPipe();
56
58
64 virtual void UpdateBounds() {}
65
67 virtual void Update() {}
68
74 albaOBB *GetBounds() {return &m_Bounds;}
75
76#ifdef ALBA_USE_VTK
79 virtual vtkDataSet *GetVTKData() {return NULL;}
80
82 virtual vtkAlgorithmOutput *GetVTKOutputPort() { return NULL; };
83#endif
84
87 albaTimeStamp GetTimeStamp() {return m_CurrentTime;}
88
90 virtual vtkMTimeType GetMTime();
91
93 virtual bool Accept(albaVME *vme) {return vme!=NULL;}
94
102
106 virtual int DeepCopy(albaDataPipe *pipe);
107
109 int SetVME(albaVME *vme);
110 albaVME *GetVME() {return m_VME;}
111
113 void SetDependOnPose(int flag) {m_DependOnPose=flag;Modified();}
114 int GetDependOnPose() {return m_DependOnPose;}
115
117 void SetDependOnVMETime(int flag) {m_DependOnVMETime=flag;Modified();}
118 int GetDependOnVMETime() {return m_DependOnVMETime;}
119
121 void SetDependOnAbsPose(int flag) {m_DependOnAbsPose=flag;Modified();}
122 int GetDependOnAbsPose() {return m_DependOnAbsPose;}
123
125 virtual void Print(std::ostream& os, const int tabs=0) const;
126
127 virtual void OnEvent(albaEventBase *alba_event);
128
129protected:
131 virtual void PreExecute();
132
134 virtual void Execute();
135
140
144
145private:
146 albaDataPipe(const albaDataPipe&); //Not implemented
147 void operator=(const albaDataPipe&); //Not implemented
148};
149#endif /* __albaDataPipe_h */
double albaTimeStamp
type for time varying data timestamps (not for pipelines timestamps!)
Definition: albaDefines.h:60
abstract class for process objects producing data as output of a VME.
Definition: albaDataPipe.h:52
void SetTimeStamp(albaTimeStamp t)
Set/Get the current time.
virtual void OnEvent(albaEventBase *alba_event)
process the events sent by subjects
int GetDependOnAbsPose()
Definition: albaDataPipe.h:122
int m_DependOnVMETime
Definition: albaDataPipe.h:143
albaTimeStamp m_CurrentTime
time for which data is computed
Definition: albaDataPipe.h:137
albaVME * GetVME()
Definition: albaDataPipe.h:110
albaTimeStamp GetTimeStamp()
Definition: albaDataPipe.h:87
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:114
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:74
albaVME * m_VME
pointer to the VME for which output is computed
Definition: albaDataPipe.h:138
virtual void Update()
update the output of the data pipe
Definition: albaDataPipe.h:67
virtual vtkMTimeType GetMTime()
return modification time
void SetDependOnPose(int flag)
enable/disable the dependence of this data pipe from VME's pose matrix
Definition: albaDataPipe.h:113
virtual void Print(std::ostream &os, const int tabs=0) const
print a dump of this object
int m_DependOnAbsPose
Definition: albaDataPipe.h:142
albaTypeMacro(albaDataPipe, albaReferenceCounted)
void SetDependOnVMETime(int flag)
enable/disable the dependence of this data pipe from VME's pose matrix
Definition: albaDataPipe.h:117
void SetDependOnAbsPose(int flag)
enable/disable the dependence of this data pipe from VME's ABS pose matrix
Definition: albaDataPipe.h:121
albaOBB m_Bounds
bounds of the output data
Definition: albaDataPipe.h:136
virtual ~albaDataPipe()
int GetDependOnVMETime()
Definition: albaDataPipe.h:118
virtual void UpdateBounds()
This function makes the current bounds to be updated.
Definition: albaDataPipe.h:64
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:93
albaMTime m_PreExecuteTime
use to reduce the number of time PreExecute is called
Definition: albaDataPipe.h:139
Implementation of the message object for the Subject/Observer design pattern.
Definition: albaEventBase.h:49
albaMTime - record modification timestamp.
Definition: albaMTime.h:39
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