VTK  9.7.1
vtkImageAppend.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
20 #ifndef vtkImageAppend_h
21 #define vtkImageAppend_h
22 
23 #include "vtkFiltersCoreModule.h" // For export macro
25 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
26 
27 VTK_ABI_NAMESPACE_BEGIN
28 class VTKFILTERSCORE_EXPORT VTK_MARSHALAUTO vtkImageAppend : public vtkThreadedImageAlgorithm
29 {
30 public:
31  static vtkImageAppend* New();
33  void PrintSelf(ostream& os, vtkIndent indent) override;
34 
41  virtual void ReplaceNthInputConnection(int idx, vtkAlgorithmOutput* input);
42 
44 
49  void SetInputData(int idx, vtkDataObject* input);
50  void SetInputData(vtkDataObject* input) { this->SetInputData(0, input); }
52 
54 
59  vtkDataObject* GetInput(int idx);
60  vtkDataObject* GetInput() { return this->GetInput(0); }
62 
69 
71 
77  vtkSetMacro(AppendAxis, int);
78  vtkGetMacro(AppendAxis, int);
80 
82 
90  vtkSetMacro(PreserveExtents, vtkTypeBool);
91  vtkGetMacro(PreserveExtents, vtkTypeBool);
92  vtkBooleanMacro(PreserveExtents, vtkTypeBool);
94 
95 protected:
97  ~vtkImageAppend() override;
98 
101  // Array holds the AppendAxisExtent shift for each input.
102  int* Shifts;
103 
105 
107 
108  void ThreadedRequestData(vtkInformation* request, vtkInformationVector** inputVector,
109  vtkInformationVector* outputVector, vtkImageData*** inData, vtkImageData** outData,
110  VTK_FUTURE_CONST int ext[6], int id) override;
111 
112  // see vtkAlgorithm for docs.
113  int FillInputPortInformation(int, vtkInformation*) override;
114 
115  void InitOutput(VTK_FUTURE_CONST int outExt[6], vtkImageData* outData);
116 
117  void InternalComputeInputUpdateExtent(int inExt[6], VTK_FUTURE_CONST int outExt[6],
118  VTK_FUTURE_CONST int inWextent[6], int whichInput);
119 
120  // overridden to allocate all of the output arrays, not just active scalars
121  void AllocateOutputData(
122  vtkImageData* out, vtkInformation* outInfo, VTK_FUTURE_CONST int uExtent[6]) override;
124 
125  // overridden to prevent shallow copies across, since we have to do it elementwise
126  void CopyAttributeData(
127  vtkImageData* in, vtkImageData* out, vtkInformationVector** inputVector) override;
128 
129 private:
130  vtkImageAppend(const vtkImageAppend&) = delete;
131  void operator=(const vtkImageAppend&) = delete;
132 };
133 
134 VTK_ABI_NAMESPACE_END
135 #endif
int GetNumberOfInputConnections(int port)
Get the number of inputs currently connected to a port.
Collects data from multiple inputs into one image.
Store vtkAlgorithm input/output information.
vtkTypeBool PreserveExtents
vtkDataObject * GetInput()
Get a data object for one of the input port connections.
void SetInputData(vtkDataObject *)
Assign a data object as input.
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Subclasses can reimplement this method to translate the update extent requests from each output port ...
Proxy object to connect input/output ports.
int vtkTypeBool
Definition: vtkABI.h:64
Generic filter that has one input.
a simple class to control print indentation
Definition: vtkIndent.h:28
virtual void AllocateOutputData(vtkImageData *out, vtkInformation *outInfo, VTK_FUTURE_CONST int uExtent[6])
Allocate the output data.
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Subclasses can reimplement this method to collect information from their inputs and set information f...
virtual void ThreadedRequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector, vtkImageData ***inData, vtkImageData **outData, VTK_FUTURE_CONST int extent[6], int threadId)
If the subclass does not define an Execute method, then the task will be broken up, multiple threads will be spawned, and each thread will call this method.
virtual void CopyAttributeData(vtkImageData *in, vtkImageData *out, vtkInformationVector **inputVector)
Copy the other point and cell data.
int GetNumberOfInputs()
Get the number of inputs to this filter.
int FillInputPortInformation(int port, vtkInformation *info) override
These method should be reimplemented by subclasses that have more than a single input or single outpu...
Store zero or more vtkInformation instances.
static vtkAlgorithm * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
#define VTK_MARSHALAUTO
vtkDataObject * GetInput()
Get one input to this filter.
general representation of visualization data
Definition: vtkDataObject.h:55
void SetInputData(vtkDataObject *input)
Assign a data object as input.