VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 =========================================================================*/
31 #ifndef __vtkImageAppend_h
32 #define __vtkImageAppend_h
33 
34 #include "vtkFiltersCoreModule.h" // For export macro
35 #include "vtkThreadedImageAlgorithm.h"
36 
37 class VTKFILTERSCORE_EXPORT vtkImageAppend : public vtkThreadedImageAlgorithm
38 {
39 public:
40  static vtkImageAppend *New();
41  vtkTypeMacro(vtkImageAppend,vtkThreadedImageAlgorithm);
42  void PrintSelf(ostream& os, vtkIndent indent);
43 
48  virtual void ReplaceNthInputConnection(int idx, vtkAlgorithmOutput* input);
49 
51 
54  void SetInputData(int num, vtkDataObject *input);
55  void SetInputData(vtkDataObject *input) { this->SetInputData(0, input); };
57 
59 
62  vtkDataObject *GetInput(int num);
63  vtkDataObject *GetInput() { return this->GetInput(0); };
65 
69  int GetNumberOfInputs() { return this->GetNumberOfInputConnections(0); };
70 
72 
75  vtkSetMacro(AppendAxis, int);
76  vtkGetMacro(AppendAxis, int);
78 
80 
86  vtkSetMacro(PreserveExtents, int);
87  vtkGetMacro(PreserveExtents, int);
88  vtkBooleanMacro(PreserveExtents, int);
90 
91 protected:
93  ~vtkImageAppend();
94 
97  // Array holds the AppendAxisExtent shift for each input.
98  int *Shifts;
99 
100  virtual int RequestInformation (vtkInformation *,
101  vtkInformationVector **,
102  vtkInformationVector *);
103 
104  virtual int RequestUpdateExtent(vtkInformation *,
105  vtkInformationVector **,
106  vtkInformationVector *);
107 
108  void ThreadedRequestData (vtkInformation* request,
109  vtkInformationVector** inputVector,
110  vtkInformationVector* outputVector,
111  vtkImageData ***inData, vtkImageData **outData,
112  int ext[6], int id);
113 
114 
115  // see vtkAlgorithm for docs.
116  virtual int FillInputPortInformation(int, vtkInformation*);
117 
118  void InitOutput(int outExt[6], vtkImageData *outData);
119 
120  void InternalComputeInputUpdateExtent(
121  int *inExt, int *outExt, int *inWextent, int whichInput);
122 
123  // overridden to allocate all of the output arrays, not just active scalars
124  virtual void AllocateOutputData(vtkImageData *out,
125  vtkInformation* outInfo,
126  int *uExtent);
127  virtual vtkImageData *AllocateOutputData(vtkDataObject *out,
128  vtkInformation* outInfo);
129 
130  // overridden to prevent shallow copies across, since we have to do it elementwise
131  virtual void CopyAttributeData(vtkImageData *in, vtkImageData *out,
132  vtkInformationVector** inputVector);
133 
134 
135 private:
136  vtkImageAppend(const vtkImageAppend&); // Not implemented.
137  void operator=(const vtkImageAppend&); // Not implemented.
138 };
139 
140 #endif
141 
142 
143 
144 
Collects data from multiple inputs into one image.
int GetNumberOfInputs()
vtkDataObject * GetInput()
void SetInputData(vtkDataObject *input)