40 #ifndef __vtkAlgorithm_h
41 #define __vtkAlgorithm_h
43 #include "vtkCommonExecutionModelModule.h"
44 #include "vtkObject.h"
46 class vtkAbstractArray;
47 class vtkAlgorithmInternals;
54 class vtkInformationInformationVectorKey;
55 class vtkInformationIntegerKey;
56 class vtkInformationStringKey;
57 class vtkInformationStringVectorKey;
58 class vtkInformationVector;
60 class VTKCOMMONEXECUTIONMODEL_EXPORT
vtkAlgorithm :
public vtkObject
65 void PrintSelf(ostream& os, vtkIndent indent);
111 virtual int ProcessRequest(vtkInformation* request,
112 vtkInformationVector** inInfo,
113 vtkInformationVector* outInfo);
119 int ProcessRequest(vtkInformation* request,
120 vtkCollection* inInfo,
121 vtkInformationVector* outInfo);
129 ComputePipelineMTime(vtkInformation* request,
130 vtkInformationVector** inInfoVec,
131 vtkInformationVector* outInfoVec,
132 int requestFromOutputPort,
133 unsigned long* mtime);
141 virtual int ModifyRequest(vtkInformation* request,
int when);
147 vtkInformation* GetInputPortInformation(
int port);
153 vtkInformation* GetOutputPortInformation(
int port);
157 vtkGetObjectMacro(Information, vtkInformation);
158 virtual void SetInformation(vtkInformation*);
162 int GetNumberOfInputPorts();
165 int GetNumberOfOutputPorts();
169 virtual void Register(vtkObjectBase* o);
170 virtual void UnRegister(vtkObjectBase* o);
176 vtkSetMacro(AbortExecute,
int);
177 vtkGetMacro(AbortExecute,
int);
178 vtkBooleanMacro(AbortExecute,
int);
183 vtkSetClampMacro(Progress,
double,0.0,1.0);
184 vtkGetMacro(Progress,
double);
190 void UpdateProgress(
double amount);
198 void SetProgressText(
const char* ptext);
199 vtkGetStringMacro(ProgressText);
205 vtkGetMacro( ErrorCode,
unsigned long );
213 static vtkInformationIntegerKey* INPUT_IS_OPTIONAL();
214 static vtkInformationIntegerKey* INPUT_IS_REPEATABLE();
215 static vtkInformationInformationVectorKey* INPUT_REQUIRED_FIELDS();
216 static vtkInformationStringVectorKey* INPUT_REQUIRED_DATA_TYPE();
217 static vtkInformationInformationVectorKey* INPUT_ARRAYS_TO_PROCESS();
218 static vtkInformationIntegerKey* INPUT_PORT();
219 static vtkInformationIntegerKey* INPUT_CONNECTION();
230 virtual void SetInputArrayToProcess(
int idx,
int port,
int connection,
231 int fieldAssociation,
233 virtual void SetInputArrayToProcess(
int idx,
int port,
int connection,
234 int fieldAssociation,
235 int fieldAttributeType);
236 virtual void SetInputArrayToProcess(
int idx, vtkInformation *info);
254 virtual void SetInputArrayToProcess(
int idx,
int port,
int connection,
255 const char* fieldAssociation,
256 const char* attributeTypeorName);
260 vtkInformation *GetInputArrayInformation(
int idx);
267 void RemoveAllInputs();
313 virtual void RemoveInputConnection(
int port,
int idx);
316 virtual void RemoveAllInputConnections(
int port);
326 virtual void SetInputDataObject(
int port,
vtkDataObject* data);
328 { this->SetInputDataObject(0, data); }
335 virtual void AddInputDataObject(
int port,
vtkDataObject* data);
337 { this->AddInputDataObject(0, data); }
347 return this->GetOutputPort(0); }
351 int GetNumberOfInputConnections(
int port);
354 int GetTotalNumberOfInputConnections();
361 vtkAlgorithm* GetInputAlgorithm(
int port,
int index,
int& algPort);
370 return this->GetInputAlgorithm(0, 0);
381 return this->GetInputExecutive(0, 0);
391 vtkInformation* GetInputInformation(
int port,
int index);
397 return this->GetInputInformation(0, 0);
405 vtkInformation* GetOutputInformation(
int port);
409 virtual void Update(
int port);
410 virtual void Update();
415 virtual void UpdateInformation();
418 virtual void PropagateUpdateExtent();
421 virtual void UpdateWholeExtent();
425 void ConvertTotalInputToPortConnection(
int ind,
int& port,
int& conn);
435 virtual void SetReleaseDataFlag(
int);
436 virtual int GetReleaseDataFlag();
437 void ReleaseDataFlagOn();
438 void ReleaseDataFlagOff();
448 int UpdateExtentIsEmpty(vtkInformation *pinfo,
vtkDataObject *output);
449 int UpdateExtentIsEmpty(vtkInformation *pinfo,
int extentType);
454 static void SetDefaultExecutivePrototype(
vtkExecutive* proto);
459 virtual double ComputePriority();
464 static vtkInformationIntegerKey* PRESERVES_DATASET();
465 static vtkInformationIntegerKey* PRESERVES_GEOMETRY();
466 static vtkInformationIntegerKey* PRESERVES_BOUNDS();
467 static vtkInformationIntegerKey* PRESERVES_TOPOLOGY();
468 static vtkInformationIntegerKey* PRESERVES_ATTRIBUTES();
469 static vtkInformationIntegerKey* PRESERVES_RANGES();
470 static vtkInformationIntegerKey* MANAGES_METAINFORMATION();
477 int SetUpdateExtentToWholeExtent(
int port);
482 int SetUpdateExtentToWholeExtent();
486 void SetUpdateExtent(
int port,
487 int piece,
int numPieces,
int ghostLevel);
495 this->SetUpdateExtent(0, piece, numPieces, ghostLevel);
500 void SetUpdateExtent(
int port,
int extent[6]);
506 this->SetUpdateExtent(0, extent);
515 return this->GetUpdateExtent(0);
517 int* GetUpdateExtent(
int port);
521 this->GetUpdateExtent(0, x0, x1, y0, y1, z0, z1);
523 void GetUpdateExtent(
int port,
524 int& x0,
int& x1,
int& y0,
int& y1,
528 this->GetUpdateExtent(0, extent);
530 void GetUpdateExtent(
int port,
int extent[6]);
538 return this->GetUpdatePiece(0);
540 int GetUpdatePiece(
int port);
543 return this->GetUpdateNumberOfPieces(0);
545 int GetUpdateNumberOfPieces(
int port);
548 return this->GetUpdateGhostLevel(0);
550 int GetUpdateGhostLevel(
int port);
559 static vtkInformationIntegerKey* PORT_REQUIREMENTS_FILLED();
567 virtual int FillInputPortInformation(
int port, vtkInformation* info);
572 virtual int FillOutputPortInformation(
int port, vtkInformation* info);
575 virtual void SetNumberOfInputPorts(
int n);
578 virtual void SetNumberOfOutputPorts(
int n);
581 int InputPortIndexInRange(
int index,
const char* action);
582 int OutputPortIndexInRange(
int index,
const char* action);
587 int GetInputArrayAssociation(
int idx, vtkInformationVector **inputVector);
596 int GetInputArrayAssociation(
int idx,
int connection,
597 vtkInformationVector **inputVector);
605 vtkDataArray *GetInputArrayToProcess(
int idx,vtkInformationVector **inputVector);
606 vtkDataArray *GetInputArrayToProcess(
int idx,
607 vtkInformationVector **inputVector,
618 vtkDataArray *GetInputArrayToProcess(
int idx,
620 vtkInformationVector **inputVector);
621 vtkDataArray *GetInputArrayToProcess(
int idx,
623 vtkInformationVector **inputVector,
625 vtkDataArray *GetInputArrayToProcess(
int idx,
627 vtkDataArray *GetInputArrayToProcess(
int idx,
636 vtkAbstractArray *GetInputAbstractArrayToProcess(
int idx,vtkInformationVector **inputVector);
637 vtkAbstractArray *GetInputAbstractArrayToProcess
638 (
int idx, vtkInformationVector **inputVector,
int& association);
648 vtkAbstractArray *GetInputAbstractArrayToProcess(
int idx,
650 vtkInformationVector **inputVector);
651 vtkAbstractArray *GetInputAbstractArrayToProcess(
int idx,
653 vtkInformationVector **inputVector,
655 vtkAbstractArray *GetInputAbstractArrayToProcess(
int idx,
657 vtkAbstractArray *GetInputAbstractArrayToProcess(
int idx,
670 vtkInformation *GetInputArrayFieldInformation(
int idx,
671 vtkInformationVector **inputVector);
684 vtkSetMacro( ErrorCode,
unsigned long );
693 virtual void ReportReferences(vtkGarbageCollector*);
702 virtual void SetNthInputConnection(
int port,
int index,
710 virtual void SetNumberOfInputConnections(
int port,
int n);
720 { this->SetInputDataObject(port, input); }
722 { this->AddInputDataObject(port, input); }
727 vtkInformationVector* InputPortInformation;
728 vtkInformationVector* OutputPortInformation;
729 vtkAlgorithmInternals* AlgorithmInternal;
730 static void ConnectionAdd(
vtkAlgorithm* producer,
int producerPort,
732 static void ConnectionRemove(
vtkAlgorithm* producer,
int producerPort,
734 static void ConnectionRemoveAllInput(
vtkAlgorithm* consumer,
int port);
735 static void ConnectionRemoveAllOutput(
vtkAlgorithm* producer,
int port);
vtkAlgorithmOutput * GetOutputPort()
void GetUpdateExtent(int extent[6])
void SetUpdateExtent(int extent[6])
vtkAlgorithm * GetInputAlgorithm()
vtkInformation * GetInputInformation()
virtual void AddInputDataObject(vtkDataObject *data)
Superclass for all pipeline executives in VTK.
void SetInputDataInternal(int port, vtkDataObject *input)
Proxy object to connect input/output ports.
void AddInputDataInternal(int port, vtkDataObject *input)
Superclass for all sources, filters, and sinks in VTK.
vtkInformation * Information
int GetUpdateNumberOfPieces()
virtual void SetInputDataObject(vtkDataObject *data)
void SetUpdateExtent(int piece, int numPieces, int ghostLevel)
int GetUpdateGhostLevel()
general representation of visualization data
vtkExecutive * GetInputExecutive()
void GetUpdateExtent(int &x0, int &x1, int &y0, int &y1, int &z0, int &z1)
static vtkExecutive * DefaultExecutivePrototype