VTK
vtkExecutive.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkExecutive.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
32 #ifndef vtkExecutive_h
33 #define vtkExecutive_h
34 
35 #include "vtkCommonExecutionModelModule.h" // For export macro
36 #include "vtkObject.h"
37 
38 class vtkAlgorithm;
39 class vtkAlgorithmOutput;
40 class vtkAlgorithmToExecutiveFriendship;
41 class vtkDataObject;
42 class vtkExecutiveInternals;
43 class vtkInformation;
50 
52 {
53 public:
55  void PrintSelf(ostream& os, vtkIndent indent);
56 
59 
61 
63  virtual int ProcessRequest(vtkInformation* request,
64  vtkInformationVector** inInfo,
65  vtkInformationVector* outInfo);
67 
69 
78  virtual int
80  vtkInformationVector** inInfoVec,
81  vtkInformationVector* outInfoVec,
82  int requestFromOutputPort,
83  unsigned long* mtime);
85 
87  virtual int UpdateInformation() {return 1;}
88 
90 
92  virtual int Update();
93  virtual int Update(int port);
95 
97 
102 
105 
108 
111 
113  vtkInformation* GetInputInformation(int port, int connection);
114 
117 
120 
122  vtkExecutive* GetInputExecutive(int port, int connection);
123 
125 
128  virtual void SetOutputData(int port, vtkDataObject*);
130 
132 
133  virtual vtkDataObject* GetInputData(int port, int connection);
134  virtual vtkDataObject* GetInputData(int port, int connection,
135  vtkInformationVector **inInfoVec);
137 
152 
154 
155  virtual void Register(vtkObjectBase* o);
156  virtual void UnRegister(vtkObjectBase* o);
158 
162 
166 
170 
172 
179  //BTX
180  enum { RequestUpstream, RequestDownstream };
181  enum { BeforeForward, AfterForward };
182  //ETX
184 
186 
188  virtual int CallAlgorithm(vtkInformation* request, int direction,
189  vtkInformationVector** inInfo,
190  vtkInformationVector* outInfo);
192 
193 protected:
196 
197  // Helper methods for subclasses.
198  int InputPortIndexInRange(int port, const char* action);
199  int OutputPortIndexInRange(int port, const char* action);
200 
201  // Called by methods to check for a recursive pipeline update. A
202  // request should be fulfilled without making another request. This
203  // is used to help enforce that behavior. Returns 1 if no recursive
204  // request is occurring, and 0 otherwise. An error message is
205  // produced automatically if 0 is returned. The first argument is
206  // the name of the calling method (the one that should not be
207  // invoked recursively during an update). The second argument is
208  // the recursive request information object, if any. It is used to
209  // construct the error message.
210  int CheckAlgorithm(const char* method, vtkInformation* request);
211 
212  virtual int ForwardDownstream(vtkInformation* request);
213  virtual int ForwardUpstream(vtkInformation* request);
214  virtual void CopyDefaultInformation(vtkInformation* request, int direction,
215  vtkInformationVector** inInfo,
216  vtkInformationVector* outInfo);
217 
218  // Reset the pipeline update values in the given output information object.
220 
221  // Bring the existence of output data objects up to date.
222  virtual int UpdateDataObject()=0;
223 
224  // Garbage collection support.
226 
227  virtual void SetAlgorithm(vtkAlgorithm* algorithm);
228 
229  // The algorithm managed by this executive.
231 
232  // Flag set when the algorithm is processing a request.
234 
235  // Pointers to an outside instance of input or output information.
236  // No references are held. These are used to implement internal
237  // pipelines.
240 
241 private:
242  // Store an information object for each output port of the algorithm.
243  vtkInformationVector* OutputInformation;
244 
245  // Internal implementation details.
246  vtkExecutiveInternals* ExecutiveInternal;
247 
248  //BTX
249  friend class vtkAlgorithmToExecutiveFriendship;
250  //ETX
251 private:
252  vtkExecutive(const vtkExecutive&); // Not implemented.
253  void operator=(const vtkExecutive&); // Not implemented.
254 };
255 
256 #endif
vtkExecutive::ReportReferences
virtual void ReportReferences(vtkGarbageCollector *)
vtkExecutive::ALGORITHM_BEFORE_FORWARD
static vtkInformationIntegerKey * ALGORITHM_BEFORE_FORWARD()
VTKCOMMONEXECUTIONMODEL_EXPORT
#define VTKCOMMONEXECUTIONMODEL_EXPORT
Definition: vtkCommonExecutionModelModule.h:15
vtkInformationKeyVectorKey
Key for vector-of-keys values.
Definition: vtkInformationKeyVectorKey.h:31
vtkExecutive::Algorithm
vtkAlgorithm * Algorithm
Definition: vtkExecutive.h:230
vtkExecutive::SetOutputData
virtual void SetOutputData(int port, vtkDataObject *, vtkInformation *info)
vtkExecutive::InputPortIndexInRange
int InputPortIndexInRange(int port, const char *action)
vtkAlgorithm
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:62
vtkX3D::direction
@ direction
Definition: vtkX3D.h:260
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
vtkExecutive::SetAlgorithm
virtual void SetAlgorithm(vtkAlgorithm *algorithm)
vtkExecutive::ProcessRequest
virtual int ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
vtkExecutive::Update
virtual int Update()
vtkExecutive::~vtkExecutive
~vtkExecutive()
vtkExecutive::GetNumberOfInputPorts
int GetNumberOfInputPorts()
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkExecutive::ALGORITHM_AFTER_FORWARD
static vtkInformationIntegerKey * ALGORITHM_AFTER_FORWARD()
vtkExecutive::SharedOutputInformation
vtkInformationVector * SharedOutputInformation
Definition: vtkExecutive.h:239
vtkCommonExecutionModelModule.h
vtkExecutive::UnRegister
virtual void UnRegister(vtkObjectBase *o)
vtkExecutive::ComputePipelineMTime
virtual int ComputePipelineMTime(vtkInformation *request, vtkInformationVector **inInfoVec, vtkInformationVector *outInfoVec, int requestFromOutputPort, unsigned long *mtime)
vtkExecutive::BeforeForward
@ BeforeForward
Definition: vtkExecutive.h:181
vtkExecutive::GetInputData
virtual vtkDataObject * GetInputData(int port, int connection, vtkInformationVector **inInfoVec)
vtkExecutive::GetOutputData
virtual vtkDataObject * GetOutputData(int port)
vtkExecutive::CopyDefaultInformation
virtual void CopyDefaultInformation(vtkInformation *request, int direction, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
vtkExecutive::FROM_OUTPUT_PORT
static vtkInformationIntegerKey * FROM_OUTPUT_PORT()
vtkX3D::port
@ port
Definition: vtkX3D.h:447
vtkExecutive
Superclass for all pipeline executives in VTK.
Definition: vtkExecutive.h:52
vtkExecutive::UpdateInformation
virtual int UpdateInformation()
Definition: vtkExecutive.h:87
vtkExecutive::CONSUMERS
static vtkInformationExecutivePortVectorKey * CONSUMERS()
vtkExecutive::Register
virtual void Register(vtkObjectBase *o)
vtkObjectBase
abstract base class for most VTK objects
Definition: vtkObjectBase.h:60
vtkInformationIntegerKey
Key for integer values in vtkInformation.
Definition: vtkInformationIntegerKey.h:34
vtkExecutive::OutputPortIndexInRange
int OutputPortIndexInRange(int port, const char *action)
vtkInformationExecutivePortVectorKey
Key for vtkExecutive/Port value pair vectors.
Definition: vtkInformationExecutivePortVectorKey.h:34
vtkExecutive::PRODUCER
static vtkInformationExecutivePortKey * PRODUCER()
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkInformationRequestKey
Key for pointer to pointer.
Definition: vtkInformationRequestKey.h:31
vtkExecutive::GetInputInformation
vtkInformationVector * GetInputInformation(int port)
vtkExecutive::GetNumberOfInputConnections
int GetNumberOfInputConnections(int port)
vtkExecutive::SetSharedOutputInformation
void SetSharedOutputInformation(vtkInformationVector *outInfoVec)
vtkExecutive::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkExecutive::SetSharedInputInformation
void SetSharedInputInformation(vtkInformationVector **inInfoVec)
vtkGarbageCollector
Detect and break reference loops.
Definition: vtkGarbageCollector.h:99
vtkObject.h
vtkExecutive::KEYS_TO_COPY
static vtkInformationKeyVectorKey * KEYS_TO_COPY()
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkX3D::info
@ info
Definition: vtkX3D.h:376
vtkExecutive::GetOutputInformation
virtual vtkInformation * GetOutputInformation(int port)
vtkExecutive::Update
virtual int Update(int port)
vtkExecutive::RequestUpstream
@ RequestUpstream
Definition: vtkExecutive.h:180
vtkExecutive::CallAlgorithm
virtual int CallAlgorithm(vtkInformation *request, int direction, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
vtkExecutive::ForwardUpstream
virtual int ForwardUpstream(vtkInformation *request)
vtkAlgorithmOutput
Proxy object to connect input/output ports.
Definition: vtkAlgorithmOutput.h:39
vtkExecutive::ALGORITHM_DIRECTION
static vtkInformationIntegerKey * ALGORITHM_DIRECTION()
vtkExecutive::GetInputData
virtual vtkDataObject * GetInputData(int port, int connection)
vtkExecutive::vtkExecutive
vtkExecutive()
vtkExecutive::GetInputInformation
vtkInformation * GetInputInformation(int port, int connection)
vtkExecutive::GetOutputInformation
vtkInformationVector * GetOutputInformation()
vtkExecutive::GetAlgorithm
vtkAlgorithm * GetAlgorithm()
vtkExecutive::FORWARD_DIRECTION
static vtkInformationIntegerKey * FORWARD_DIRECTION()
vtkExecutive::GetInputInformation
vtkInformationVector ** GetInputInformation()
vtkExecutive::CheckAlgorithm
int CheckAlgorithm(const char *method, vtkInformation *request)
vtkExecutive::SetOutputData
virtual void SetOutputData(int port, vtkDataObject *)
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:65
vtkExecutive::GetNumberOfOutputPorts
int GetNumberOfOutputPorts()
vtkExecutive::InAlgorithm
int InAlgorithm
Definition: vtkExecutive.h:233
vtkExecutive::ResetPipelineInformation
virtual void ResetPipelineInformation(int port, vtkInformation *)=0
vtkExecutive::GetInputExecutive
vtkExecutive * GetInputExecutive(int port, int connection)
vtkExecutive::ForwardDownstream
virtual int ForwardDownstream(vtkInformation *request)
vtkExecutive::UpdateDataObject
virtual int UpdateDataObject()=0
vtkInformationExecutivePortKey
Key for vtkExecutive/Port value pairs.
Definition: vtkInformationExecutivePortKey.h:34
vtkExecutive::SharedInputInformation
vtkInformationVector ** SharedInputInformation
Definition: vtkExecutive.h:238