Go to the documentation of this file.
38 #ifndef vtkAlgorithm_h
39 #define vtkAlgorithm_h
41 #include "vtkCommonExecutionModelModule.h"
45 class vtkAlgorithmInternals;
150 int requestFromOutputPort,
218 vtkSetClampMacro(Progress,
double,0.0,1.0);
219 vtkGetMacro(Progress,
double);
238 vtkGetStringMacro(ProgressText);
246 vtkGetMacro( ErrorCode,
unsigned long );
316 virtual void SetInputArrayToProcess(
int idx,
int port,
int connection,
317 int fieldAssociation,
319 virtual void SetInputArrayToProcess(
int idx,
int port,
int connection,
320 int fieldAssociation,
321 int fieldAttributeType);
348 virtual void SetInputArrayToProcess(
int idx,
int port,
int connection,
349 const char* fieldAssociation,
350 const char* attributeTypeorName);
442 { this->SetInputDataObject(0,
data); }
451 { this->AddInputDataObject(0,
data); }
461 return this->GetOutputPort(0); }
494 return this->GetInputAlgorithm(0, 0);
508 return this->GetInputExecutive(0, 0);
526 return this->GetInputInformation(0, 0);
584 int piece,
int numPieces,
int ghostLevels,
const int extents[6]=
nullptr);
600 int piece=-1,
int numPieces=1,
int ghostLevels=0,
const int extents[6]=
nullptr);
671 return this->GetUpdateExtent(0);
677 this->GetUpdateExtent(0, x0, x1, y0, y1, z0, z1);
680 int& x0,
int& x1,
int& y0,
int& y1,
684 this->GetUpdateExtent(0,
extent);
697 return this->GetUpdatePiece(0);
702 return this->GetUpdateNumberOfPieces(0);
707 return this->GetUpdateGhostLevel(0);
880 vtkSetMacro( ErrorCode,
unsigned long );
919 { this->SetInputDataObject(
port, input); }
921 { this->AddInputDataObject(
port, input); }
929 vtkAlgorithmInternals* AlgorithmInternal;
930 static void ConnectionAdd(
vtkAlgorithm* producer,
int producerPort,
932 static void ConnectionRemove(
vtkAlgorithm* producer,
int producerPort,
vtkAbstractArray * GetInputAbstractArrayToProcess(int idx, int connection, vtkInformationVector **inputVector)
Filters that have multiple connections on one port can use this signature.
int InputPortIndexInRange(int index, const char *action)
virtual vtkExecutive * CreateDefaultExecutive()
Create a default executive.
virtual void SetReleaseDataFlag(int)
Turn release data flag on or off for all output ports.
void SetProgressText(const char *ptext)
Set the current text message associated with the progress state.
virtual void AddInputDataObject(int port, vtkDataObject *data)
Add the data-object as an input to this given port.
int GetTotalNumberOfInputConnections()
Get the total number of inputs for this algorithm.
virtual void SetNumberOfInputConnections(int port, int n)
Set the number of input connections on the given input port.
int GetInputArrayAssociation(int idx, vtkDataObject *input)
vtkInformation * Information
virtual void Update(int port)
Bring this algorithm's outputs up-to-date.
void GetUpdateExtent(int extent[6])
virtual int UpdateTimeStep(double time, int piece=-1, int numPieces=1, int ghostLevels=0, const int extents[6]=nullptr)
Convenience method to update an algorithm after passing requests to its first output port.
static vtkInformationIntegerKey * PORT_REQUIREMENTS_FILLED()
virtual void RemoveInputConnection(int port, int idx)
Remove a connection given by index idx.
void UnRegister(vtkObjectBase *o) override
Decrease the reference count (release by another object).
virtual void RemoveInputConnection(int port, vtkAlgorithmOutput *input)
Remove a connection from the given input port index.
int GetNumberOfInputPorts()
Get the number of input ports used by the algorithm.
int OutputPortIndexInRange(int index, const char *action)
vtkAlgorithmOutput * GetOutputPort()
void UpdateProgress(double amount)
Update the progress of the process object.
virtual void AddInputDataObject(vtkDataObject *data)
Superclass for all sources, filters, and sinks in VTK.
virtual void SetInputDataObject(vtkDataObject *data)
virtual int FillInputPortInformation(int port, vtkInformation *info)
Fill the input port information objects for this algorithm.
vtkAbstractArray * GetInputAbstractArrayToProcess(int idx, vtkDataObject *input, int &association)
int HasExecutive()
Check whether this algorithm has an assigned executive.
virtual int Update(int port, vtkInformationVector *requests)
This method enables the passing of data requests to the algorithm to be used during execution (in add...
vtkAbstractArray * GetInputAbstractArrayToProcess(int idx, int connection, vtkInformationVector **inputVector, int &association)
vtkInformation * GetInputPortInformation(int port)
Get the information object associated with an input port.
virtual int ModifyRequest(vtkInformation *request, int when)
This method gives the algorithm a chance to modify the contents of a request before or after (specifi...
void SetProgressObserver(vtkProgressObserver *)
If an ProgressObserver is set, the algorithm will report progress through it rather than directly.
int GetInputArrayAssociation(int idx, vtkInformationVector **inputVector)
Get the assocition of the actual data array for the input array specified by idx, this is only reason...
int GetUpdateGhostLevel()
int GetNumberOfOutputPorts()
Get the number of output ports provided by the algorithm.
vtkDataArray * GetInputArrayToProcess(int idx, vtkInformationVector **inputVector)
Get the actual data array for the input array specified by idx, this is only reasonable during the RE...
virtual void PropagateUpdateExtent()
Propagate meta-data upstream.
abstract base class for most VTK objects
int GetUpdatePiece()
These functions return the update extent for output ports that use piece extents.
virtual void SetExecutive(vtkExecutive *executive)
Set this algorithm's executive.
void SetInputDataInternal(int port, vtkDataObject *input)
These methods are used by subclasses to implement methods to set data objects directly as input.
vtkInformation * GetInputArrayFieldInformation(int idx, vtkInformationVector **inputVector)
This method takes in an index (as specified in SetInputArrayToProcess) and a pipeline information vec...
abstract superclass for arrays of numeric data
vtkDataArray * GetInputArrayToProcess(int idx, int connection, vtkInformationVector **inputVector)
Filters that have multiple connections on one port can use this signature.
virtual void SetNumberOfInputPorts(int n)
Set the number of input ports used by the algorithm.
vtkExecutive * GetInputExecutive(int port, int index)
Returns the executive associated with a particular input connection.
vtkAbstractArray * GetInputAbstractArrayToProcess(int idx, vtkInformationVector **inputVector)
Get the actual data array for the input array specified by idx, this is only reasonable during the RE...
int GetUpdatePiece(int port)
void RemoveAllInputs()
Remove all the input data.
vtkExecutive * GetExecutive()
Get this algorithm's executive.
int UpdateExtentIsEmpty(vtkInformation *pinfo, int extentType)
void ReleaseDataFlagOff()
void GetUpdateExtent(int &x0, int &x1, int &y0, int &y1, int &z0, int &z1)
vtkDataObject * GetOutputDataObject(int port)
Get the data object that will contain the algorithm output for the given port.
vtkProgressObserver * ProgressObserver
void Register(vtkObjectBase *o) override
Participate in garbage collection.
vtkInformation * GetInputInformation(int port, int index)
Return the information object that is associated with a particular input connection.
vtkDataArray * GetInputArrayToProcess(int idx, int connection, vtkInformationVector **inputVector, int &association)
int UpdateExtentIsEmpty(vtkInformation *pinfo, vtkDataObject *output)
This detects when the UpdateExtent will generate no data This condition is satisfied when the UpdateE...
virtual void AddInputConnection(int port, vtkAlgorithmOutput *input)
Add a connection to the given input port index.
Superclass for all pipeline executives in VTK.
create and manipulate ordered lists of objects
virtual int GetReleaseDataFlag()
virtual void RemoveAllInputConnections(int port)
Removes all input connections.
void ConvertTotalInputToPortConnection(int ind, int &port, int &conn)
Convenience routine to convert from a linear ordering of input connections to a port/connection pair.
#define VTK_SIZEHINT(...)
vtkAlgorithmOutput * GetInputConnection(int port, int index)
Get the algorithm output port connected to an input port.
int GetUpdateNumberOfPieces()
virtual int Update(vtkInformation *requests)
Convenience method to update an algorithm after passing requests to its first output port.
abstract base class for most VTK objects
void GetUpdateExtent(int port, int extent[6])
vtkAlgorithm * GetInputAlgorithm(int port, int index, int &algPort)
Returns the algorithm and the output port index of that algorithm connected to a port-index pair.
vtkDataObject * GetInputDataObject(int port, int connection)
Get the data object that will contain the algorithm input for the given port and given connection.
vtkAlgorithmOutput * GetOutputPort(int index)
Get a proxy object corresponding to the given output port of this algorithm.
a simple class to control print indentation
virtual int UpdateExtent(const int extents[6])
Convenience method to update an algorithm after passing requests to its first output port.
vtkDataArray * GetInputArrayToProcess(int idx, vtkInformationVector **inputVector, int &association)
int * GetUpdateExtent()
These functions return the update extent for output ports that use 3D extents.
vtkInformation * GetOutputPortInformation(int port)
Get the information object associated with an output port.
virtual void AddInputConnection(vtkAlgorithmOutput *input)
Detect and break reference loops.
Abstract superclass for all arrays.
vtkDataArray * GetInputArrayToProcess(int idx, vtkDataObject *input, int &association)
virtual void SetInputConnection(int port, vtkAlgorithmOutput *input)
Set the connection for the given input port index.
static vtkAlgorithm * New()
void ReportReferences(vtkGarbageCollector *) override
virtual int ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
Upstream/Downstream requests form the generalized interface through which executives invoke a algorit...
vtkInformation * GetInputInformation()
Equivalent to GetInputInformation(0, 0)
vtkDataArray * GetInputArrayToProcess(int idx, vtkDataObject *input)
vtkAlgorithm * GetInputAlgorithm()
Equivalent to GetInputAlgorithm(0, 0).
virtual void UpdateInformation()
Bring the algorithm's information up-to-date.
int * GetUpdateExtent(int port)
virtual int UpdatePiece(int piece, int numPieces, int ghostLevels, const int extents[6]=nullptr)
Convenience method to update an algorithm after passing requests to its first output port.
vtkAbstractArray * GetInputAbstractArrayToProcess(int idx, vtkInformationVector **inputVector, int &association)
Proxy object to connect input/output ports.
vtkExecutive * GetInputExecutive()
Equivalent to GetInputExecutive(0, 0)
vtkInformation * GetInputArrayInformation(int idx)
Get the info object for the specified input array to this algorithm.
virtual void UpdateWholeExtent()
Bring this algorithm's outputs up-to-date.
int GetUpdateNumberOfPieces(int port)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkAlgorithm * GetInputAlgorithm(int port, int index)
Returns the algorithm connected to a port-index pair.
static void SetDefaultExecutivePrototype(vtkExecutive *proto)
If the DefaultExecutivePrototype is set, a copy of it is created in CreateDefaultExecutive() using Ne...
void GetUpdateExtent(int port, int &x0, int &x1, int &y0, int &y1, int &z0, int &z1)
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.
virtual void SetNthInputConnection(int port, int index, vtkAlgorithmOutput *input)
Replace the Nth connection on the given input port.
virtual void UpdateDataObject()
Create output object(s).
virtual void SetInformation(vtkInformation *)
virtual void SetNumberOfOutputPorts(int n)
Set the number of output ports provided by the algorithm.
Basic class to optionally replace vtkAlgorithm progress functionality.
int GetNumberOfInputConnections(int port)
Get the number of inputs currently connected to a port.
general representation of visualization data
static vtkExecutive * DefaultExecutivePrototype
int ProcessRequest(vtkInformation *request, vtkCollection *inInfo, vtkInformationVector *outInfo)
Version of ProcessRequest() that is wrapped.
virtual int FillOutputPortInformation(int port, vtkInformation *info)
Fill the output port information objects for this algorithm.
virtual void SetInputConnection(vtkAlgorithmOutput *input)
int GetInputArrayAssociation(int idx, int connection, vtkInformationVector **inputVector)
Filters that have multiple connections on one port can use this signature.
void AddInputDataInternal(int port, vtkDataObject *input)
DesiredOutputPrecision
Values used for setting the desired output precision for various algorithms.
vtkTypeUInt32 vtkMTimeType
virtual void SetInputDataObject(int port, vtkDataObject *data)
Sets the data-object as an input on the given port index.
vtkInformation * GetOutputInformation(int port)
Return the information object that is associated with a particular output port.
int GetUpdateGhostLevel(int port)
vtkAbstractArray * GetInputAbstractArrayToProcess(int idx, vtkDataObject *input)