VTK  9.0.20210928
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 =========================================================================*/
56 #ifndef vtkExecutive_h
57 #define vtkExecutive_h
58 
59 #include "vtkCommonExecutionModelModule.h" // For export macro
60 #include "vtkObject.h"
61 
62 class vtkAlgorithm;
63 class vtkAlgorithmOutput;
64 class vtkAlgorithmToExecutiveFriendship;
65 class vtkDataObject;
66 class vtkExecutiveInternals;
67 class vtkInformation;
74 
75 class VTKCOMMONEXECUTIONMODEL_EXPORT vtkExecutive : public vtkObject
76 {
77 public:
78  vtkTypeMacro(vtkExecutive, vtkObject);
79  void PrintSelf(ostream& os, vtkIndent indent) override;
80 
85 
91  vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* outInfo);
92 
105  virtual int ComputePipelineMTime(vtkInformation* request, vtkInformationVector** inInfoVec,
106  vtkInformationVector* outInfoVec, int requestFromOutputPort, vtkMTimeType* mtime);
107 
111  virtual int UpdateInformation() { return 1; }
112 
114 
118  virtual vtkTypeBool Update();
119  virtual vtkTypeBool Update(int port);
121 
123 
130 
135 
140 
145 
149  vtkInformation* GetInputInformation(int port, int connection);
150 
155 
160 
164  vtkExecutive* GetInputExecutive(int port, int connection);
165 
167 
172  virtual void SetOutputData(int port, vtkDataObject*);
174 
176 
179  virtual vtkDataObject* GetInputData(int port, int connection);
180  virtual vtkDataObject* GetInputData(int port, int connection, vtkInformationVector** inInfoVec);
182 
190 
202 
204 
207  void Register(vtkObjectBase* o) override;
208  void UnRegister(vtkObjectBase* o) override;
210 
216 
222 
228 
230 
240 
241  enum
242  {
244  RequestDownstream
245  };
246  enum
247  {
249  AfterForward
250  };
251 
256  virtual int CallAlgorithm(vtkInformation* request, int direction, vtkInformationVector** inInfo,
257  vtkInformationVector* outInfo);
258 
259 protected:
261  ~vtkExecutive() override;
262 
263  // Helper methods for subclasses.
264  int InputPortIndexInRange(int port, const char* action);
265  int OutputPortIndexInRange(int port, const char* action);
266 
267  // Called by methods to check for a recursive pipeline update. A
268  // request should be fulfilled without making another request. This
269  // is used to help enforce that behavior. Returns 1 if no recursive
270  // request is occurring, and 0 otherwise. An error message is
271  // produced automatically if 0 is returned. The first argument is
272  // the name of the calling method (the one that should not be
273  // invoked recursively during an update). The second argument is
274  // the recursive request information object, if any. It is used to
275  // construct the error message.
276  int CheckAlgorithm(const char* method, vtkInformation* request);
277 
278  virtual int ForwardDownstream(vtkInformation* request);
279  virtual int ForwardUpstream(vtkInformation* request);
280  virtual void CopyDefaultInformation(vtkInformation* request, int direction,
281  vtkInformationVector** inInfo, vtkInformationVector* outInfo);
282 
283  // Reset the pipeline update values in the given output information object.
285 
286  // Bring the existence of output data objects up to date.
287  virtual int UpdateDataObject() = 0;
288 
289  // Garbage collection support.
291 
292  virtual void SetAlgorithm(vtkAlgorithm* algorithm);
293 
294  // The algorithm managed by this executive.
296 
297  // Flag set when the algorithm is processing a request.
299 
300  // Pointers to an outside instance of input or output information.
301  // No references are held. These are used to implement internal
302  // pipelines.
305 
306 private:
307  // Store an information object for each output port of the algorithm.
308  vtkInformationVector* OutputInformation;
309 
310  // Internal implementation details.
311  vtkExecutiveInternals* ExecutiveInternal;
312 
313  friend class vtkAlgorithmToExecutiveFriendship;
314 
315 private:
316  vtkExecutive(const vtkExecutive&) = delete;
317  void operator=(const vtkExecutive&) = delete;
318 };
319 
320 #endif
vtkExecutive::ALGORITHM_BEFORE_FORWARD
static vtkInformationIntegerKey * ALGORITHM_BEFORE_FORWARD()
Keys to program vtkExecutive::ProcessRequest with the default behavior for unknown requests.
vtkInformationKeyVectorKey
Key for vector-of-keys values.
Definition: vtkInformationKeyVectorKey.h:32
vtkExecutive::Algorithm
vtkAlgorithm * Algorithm
Definition: vtkExecutive.h:295
vtkExecutive::SetOutputData
virtual void SetOutputData(int port, vtkDataObject *, vtkInformation *info)
Get/Set the data object for an output port of the algorithm.
vtkExecutive::ProcessRequest
virtual vtkTypeBool ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
Generalized interface for asking the executive to fulfill pipeline requests.
vtkExecutive::InputPortIndexInRange
int InputPortIndexInRange(int port, const char *action)
vtkAlgorithm
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:123
vtkX3D::direction
@ direction
Definition: vtkX3D.h:266
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:145
vtkExecutive::SetAlgorithm
virtual void SetAlgorithm(vtkAlgorithm *algorithm)
vtkExecutive::GetNumberOfInputPorts
int GetNumberOfInputPorts()
Get the number of input/output ports for the algorithm associated with this executive.
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:82
vtkExecutive::ALGORITHM_AFTER_FORWARD
static vtkInformationIntegerKey * ALGORITHM_AFTER_FORWARD()
Keys to program vtkExecutive::ProcessRequest with the default behavior for unknown requests.
vtkExecutive::SharedOutputInformation
vtkInformationVector * SharedOutputInformation
Definition: vtkExecutive.h:304
vtkExecutive::BeforeForward
@ BeforeForward
Definition: vtkExecutive.h:248
vtkExecutive::~vtkExecutive
~vtkExecutive() override
vtkExecutive::GetInputData
virtual vtkDataObject * GetInputData(int port, int connection, vtkInformationVector **inInfoVec)
Get the data object for an input port of the algorithm.
vtkExecutive::GetOutputData
virtual vtkDataObject * GetOutputData(int port)
Get/Set the data object for an output port of the algorithm.
vtkExecutive::CopyDefaultInformation
virtual void CopyDefaultInformation(vtkInformation *request, int direction, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
vtkExecutive::FROM_OUTPUT_PORT
static vtkInformationIntegerKey * FROM_OUTPUT_PORT()
Information key to store the output port number from which a request is made.
vtkX3D::port
@ port
Definition: vtkX3D.h:453
vtkExecutive
Superclass for all pipeline executives in VTK.
Definition: vtkExecutive.h:76
vtkExecutive::UpdateInformation
virtual int UpdateInformation()
Bring the output information up to date.
Definition: vtkExecutive.h:111
vtkExecutive::CONSUMERS
static vtkInformationExecutivePortVectorKey * CONSUMERS()
Information key to store the executive/port number pairs consuming an information object.
vtkObjectBase
abstract base class for most VTK objects
Definition: vtkObjectBase.h:70
vtkExecutive::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkInformationIntegerKey
Key for integer values in vtkInformation.
Definition: vtkInformationIntegerKey.h:32
vtkExecutive::OutputPortIndexInRange
int OutputPortIndexInRange(int port, const char *action)
vtkExecutive::ReportReferences
void ReportReferences(vtkGarbageCollector *) override
vtkInformationExecutivePortVectorKey
Key for vtkExecutive/Port value pair vectors.
Definition: vtkInformationExecutivePortVectorKey.h:35
vtkExecutive::PRODUCER
static vtkInformationExecutivePortKey * PRODUCER()
Information key to store the executive/port number producing an information object.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkExecutive::UnRegister
void UnRegister(vtkObjectBase *o) override
Participate in garbage collection.
vtkInformationRequestKey
Key for pointer to pointer.
Definition: vtkInformationRequestKey.h:32
vtkExecutive::GetInputInformation
vtkInformationVector * GetInputInformation(int port)
Get the pipeline information vectors for the given input port.
vtkExecutive::GetNumberOfInputConnections
int GetNumberOfInputConnections(int port)
Get the number of input connections on the given port.
vtkExecutive::Update
virtual vtkTypeBool Update(int port)
Bring the algorithm's outputs up-to-date.
vtkExecutive::SetSharedOutputInformation
void SetSharedOutputInformation(vtkInformationVector *outInfoVec)
Get the output port that produces the given data object.
vtkExecutive::Register
void Register(vtkObjectBase *o) override
Participate in garbage collection.
vtkExecutive::SetSharedInputInformation
void SetSharedInputInformation(vtkInformationVector **inInfoVec)
Get the output port that produces the given data object.
vtkGarbageCollector
Detect and break reference loops.
Definition: vtkGarbageCollector.h:95
vtkObject.h
vtkExecutive::KEYS_TO_COPY
static vtkInformationKeyVectorKey * KEYS_TO_COPY()
Keys to program vtkExecutive::ProcessRequest with the default behavior for unknown requests.
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:183
vtkX3D::info
@ info
Definition: vtkX3D.h:382
vtkExecutive::GetOutputInformation
virtual vtkInformation * GetOutputInformation(int port)
Get the pipeline information object for the given output port.
vtkExecutive::RequestUpstream
@ RequestUpstream
Definition: vtkExecutive.h:243
vtkExecutive::CallAlgorithm
virtual int CallAlgorithm(vtkInformation *request, int direction, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
An API to CallAlgorithm that allows you to pass in the info objects to be used.
vtkExecutive::ForwardUpstream
virtual int ForwardUpstream(vtkInformation *request)
vtkAlgorithmOutput
Proxy object to connect input/output ports.
Definition: vtkAlgorithmOutput.h:66
vtkExecutive::ComputePipelineMTime
virtual int ComputePipelineMTime(vtkInformation *request, vtkInformationVector **inInfoVec, vtkInformationVector *outInfoVec, int requestFromOutputPort, vtkMTimeType *mtime)
A special version of ProcessRequest meant specifically for the pipeline modified time request.
vtkExecutive::ALGORITHM_DIRECTION
static vtkInformationIntegerKey * ALGORITHM_DIRECTION()
Keys to program vtkExecutive::ProcessRequest with the default behavior for unknown requests.
vtkExecutive::GetInputData
virtual vtkDataObject * GetInputData(int port, int connection)
Get the data object for an input port of the algorithm.
vtkExecutive::vtkExecutive
vtkExecutive()
vtkExecutive::GetInputInformation
vtkInformation * GetInputInformation(int port, int connection)
Get the pipeline information for the given input connection.
vtkExecutive::GetOutputInformation
vtkInformationVector * GetOutputInformation()
Get the pipeline information object for all output ports.
vtkExecutive::GetAlgorithm
vtkAlgorithm * GetAlgorithm()
Get the algorithm to which this executive has been assigned.
vtkExecutive::FORWARD_DIRECTION
static vtkInformationIntegerKey * FORWARD_DIRECTION()
Keys to program vtkExecutive::ProcessRequest with the default behavior for unknown requests.
vtkExecutive::GetInputInformation
vtkInformationVector ** GetInputInformation()
Get the pipeline information vectors for all inputs.
vtkExecutive::CheckAlgorithm
int CheckAlgorithm(const char *method, vtkInformation *request)
vtkExecutive::SetOutputData
virtual void SetOutputData(int port, vtkDataObject *)
Get/Set the data object for an output port of the algorithm.
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:169
vtkExecutive::GetNumberOfOutputPorts
int GetNumberOfOutputPorts()
Get the number of input/output ports for the algorithm associated with this executive.
vtkExecutive::InAlgorithm
int InAlgorithm
Definition: vtkExecutive.h:298
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkExecutive::Update
virtual vtkTypeBool Update()
Bring the algorithm's outputs up-to-date.
vtkExecutive::ResetPipelineInformation
virtual void ResetPipelineInformation(int port, vtkInformation *)=0
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287
vtkExecutive::GetInputExecutive
vtkExecutive * GetInputExecutive(int port, int connection)
Get the executive managing the given input connection.
vtkExecutive::ForwardDownstream
virtual int ForwardDownstream(vtkInformation *request)
vtkExecutive::UpdateDataObject
virtual int UpdateDataObject()=0
vtkInformationExecutivePortKey
Key for vtkExecutive/Port value pairs.
Definition: vtkInformationExecutivePortKey.h:35
vtkExecutive::SharedInputInformation
vtkInformationVector ** SharedInputInformation
Definition: vtkExecutive.h:303