VTK  9.7.1
vtkDataObjectAlgorithm.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
21 #ifndef vtkDataObjectAlgorithm_h
22 #define vtkDataObjectAlgorithm_h
23 
24 #include "vtkAlgorithm.h"
25 #include "vtkCommonExecutionModelModule.h" // For export macro
26 #include "vtkDataObject.h" // makes things a bit easier
27 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
28 
29 VTK_ABI_NAMESPACE_BEGIN
30 class vtkDataSet;
31 class vtkDataObject;
32 
33 class VTKCOMMONEXECUTIONMODEL_EXPORT VTK_MARSHALAUTO vtkDataObjectAlgorithm : public vtkAlgorithm
34 {
35 public:
36  static vtkDataObjectAlgorithm* New();
38  void PrintSelf(ostream& os, vtkIndent indent) override;
39 
41 
44  vtkDataObject* GetOutput();
45  vtkDataObject* GetOutput(int);
46  virtual void SetOutput(vtkDataObject* d);
48 
54 
55  // this method is not recommended for use, but lots of old style filters
56  // use it
57  vtkDataObject* GetInput();
58  vtkDataObject* GetInput(int port);
59 
61 
66  void SetInputData(vtkDataObject*);
67  void SetInputData(int, vtkDataObject*);
69 
71 
76  void AddInputData(vtkDataObject*);
77  void AddInputData(int, vtkDataObject*);
79 
80 protected:
82  ~vtkDataObjectAlgorithm() override;
83 
84  // convenience method
85  virtual int RequestInformation(vtkInformation* request, vtkInformationVector** inputVector,
86  vtkInformationVector* outputVector);
87 
93  {
94  return 1;
95  }
96 
102  {
103  return 1;
104  }
105 
107  {
108  return 1;
109  }
110 
112  {
113  return 1;
114  }
115 
116  // see algorithm for more info
118  int FillInputPortInformation(int port, vtkInformation* info) override;
119 
128  static bool SetOutputDataObject(
129  int dataType, vtkInformation* outputInformation, bool exact = false);
130 
131 private:
133  void operator=(const vtkDataObjectAlgorithm&) = delete;
134 };
135 
136 VTK_ABI_NAMESPACE_END
137 #endif
virtual int RequestDataObject(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int vtkTypeBool
Definition: vtkABI.h:64
virtual vtkTypeBool ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
Upstream/Downstream requests form the generalized interface through which executives invoke a algorit...
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:53
virtual int FillOutputPortInformation(int port, vtkInformation *info)
Fill the output port information objects for this algorithm.
a simple class to control print indentation
Definition: vtkIndent.h:28
virtual int RequestUpdateTime(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
virtual int FillInputPortInformation(int port, vtkInformation *info)
Fill the input port information objects for this algorithm.
Superclass for algorithms that produce only data object as output.
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Store zero or more vtkInformation instances.
static vtkAlgorithm * New()
#define VTK_MARSHALAUTO
general representation of visualization data
Definition: vtkDataObject.h:55