VTK  9.0.1
vtkImageAppend.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkImageAppend.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 =========================================================================*/
29 #ifndef vtkImageAppend_h
30 #define vtkImageAppend_h
31 
32 #include "vtkFiltersCoreModule.h" // For export macro
34 
35 class VTKFILTERSCORE_EXPORT vtkImageAppend : public vtkThreadedImageAlgorithm
36 {
37 public:
38  static vtkImageAppend* New();
40  void PrintSelf(ostream& os, vtkIndent indent) override;
41 
48  virtual void ReplaceNthInputConnection(int idx, vtkAlgorithmOutput* input);
49 
51 
56  void SetInputData(int num, vtkDataObject* input);
57  void SetInputData(vtkDataObject* input) { this->SetInputData(0, input); }
59 
61 
66  vtkDataObject* GetInput(int num);
67  vtkDataObject* GetInput() { return this->GetInput(0); }
69 
76 
78 
84  vtkSetMacro(AppendAxis, int);
85  vtkGetMacro(AppendAxis, int);
87 
89 
97  vtkSetMacro(PreserveExtents, vtkTypeBool);
98  vtkGetMacro(PreserveExtents, vtkTypeBool);
99  vtkBooleanMacro(PreserveExtents, vtkTypeBool);
101 
102 protected:
103  vtkImageAppend();
104  ~vtkImageAppend() override;
105 
108  // Array holds the AppendAxisExtent shift for each input.
109  int* Shifts;
110 
112 
114 
115  void ThreadedRequestData(vtkInformation* request, vtkInformationVector** inputVector,
116  vtkInformationVector* outputVector, vtkImageData*** inData, vtkImageData** outData, int ext[6],
117  int id) override;
118 
119  // see vtkAlgorithm for docs.
120  int FillInputPortInformation(int, vtkInformation*) override;
121 
122  void InitOutput(int outExt[6], vtkImageData* outData);
123 
124  void InternalComputeInputUpdateExtent(int* inExt, int* outExt, int* inWextent, int whichInput);
125 
126  // overridden to allocate all of the output arrays, not just active scalars
127  void AllocateOutputData(vtkImageData* out, vtkInformation* outInfo, int* uExtent) override;
129 
130  // overridden to prevent shallow copies across, since we have to do it elementwise
131  void CopyAttributeData(
132  vtkImageData* in, vtkImageData* out, vtkInformationVector** inputVector) override;
133 
134 private:
135  vtkImageAppend(const vtkImageAppend&) = delete;
136  void operator=(const vtkImageAppend&) = delete;
137 };
138 
139 #endif
vtkThreadedImageAlgorithm::ThreadedRequestData
virtual void ThreadedRequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector, vtkImageData ***inData, vtkImageData **outData, int extent[6], int threadId)
If the subclass does not define an Execute method, then the task will be broken up,...
vtkImageAppend::SetInputData
void SetInputData(vtkDataObject *input)
Definition: vtkImageAppend.h:57
vtkImageAppend::Shifts
int * Shifts
Definition: vtkImageAppend.h:109
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkThreadedImageAlgorithm
Generic filter that has one input.
Definition: vtkThreadedImageAlgorithm.h:37
vtkImageAlgorithm::GetInput
vtkDataObject * GetInput()
Definition: vtkImageAlgorithm.h:77
vtkThreadedImageAlgorithm.h
vtkImageAlgorithm::SetInputData
void SetInputData(vtkDataObject *)
Assign a data object as input.
vtkImageAlgorithm::RequestUpdateExtent
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Subclasses can reimplement this method to translate the update extent requests from each output port ...
vtkImageAlgorithm::RequestInformation
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Subclasses can reimplement this method to collect information from their inputs and set information f...
vtkThreadedImageAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkImageAlgorithm::AllocateOutputData
virtual void AllocateOutputData(vtkImageData *out, vtkInformation *outInfo, int *uExtent)
Allocate the output data.
vtkImageAppend::GetNumberOfInputs
int GetNumberOfInputs()
Get the number of inputs to this filter.
Definition: vtkImageAppend.h:75
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:41
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkImageAppend::PreserveExtents
vtkTypeBool PreserveExtents
Definition: vtkImageAppend.h:106
vtkImageAppend
Collects data from multiple inputs into one image.
Definition: vtkImageAppend.h:35
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:73
vtkAlgorithm::New
static vtkAlgorithm * New()
vtkImageAlgorithm::CopyAttributeData
virtual void CopyAttributeData(vtkImageData *in, vtkImageData *out, vtkInformationVector **inputVector)
Copy the other point and cell data.
vtkAlgorithmOutput
Proxy object to connect input/output ports.
Definition: vtkAlgorithmOutput.h:36
vtkImageAppend::GetInput
vtkDataObject * GetInput()
Definition: vtkImageAppend.h:67
vtkAlgorithm::GetNumberOfInputConnections
int GetNumberOfInputConnections(int port)
Get the number of inputs currently connected to a port.
vtkImageAlgorithm::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:59
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkImageAppend::AppendAxis
int AppendAxis
Definition: vtkImageAppend.h:107