VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkImageAppend.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00031 #ifndef __vtkImageAppend_h 00032 #define __vtkImageAppend_h 00033 00034 #include "vtkFiltersCoreModule.h" // For export macro 00035 #include "vtkThreadedImageAlgorithm.h" 00036 00037 class VTKFILTERSCORE_EXPORT vtkImageAppend : public vtkThreadedImageAlgorithm 00038 { 00039 public: 00040 static vtkImageAppend *New(); 00041 vtkTypeMacro(vtkImageAppend,vtkThreadedImageAlgorithm); 00042 void PrintSelf(ostream& os, vtkIndent indent); 00043 00048 virtual void ReplaceNthInputConnection(int idx, vtkAlgorithmOutput* input); 00049 00051 00054 void SetInputData(int num, vtkDataObject *input); 00055 void SetInputData(vtkDataObject *input) { this->SetInputData(0, input); }; 00057 00059 00062 vtkDataObject *GetInput(int num); 00063 vtkDataObject *GetInput() { return this->GetInput(0); }; 00065 00069 int GetNumberOfInputs() { return this->GetNumberOfInputConnections(0); }; 00070 00072 00075 vtkSetMacro(AppendAxis, int); 00076 vtkGetMacro(AppendAxis, int); 00078 00080 00086 vtkSetMacro(PreserveExtents, int); 00087 vtkGetMacro(PreserveExtents, int); 00088 vtkBooleanMacro(PreserveExtents, int); 00090 00091 protected: 00092 vtkImageAppend(); 00093 ~vtkImageAppend(); 00094 00095 int PreserveExtents; 00096 int AppendAxis; 00097 // Array holds the AppendAxisExtent shift for each input. 00098 int *Shifts; 00099 00100 virtual int RequestInformation (vtkInformation *, 00101 vtkInformationVector **, 00102 vtkInformationVector *); 00103 00104 virtual int RequestUpdateExtent(vtkInformation *, 00105 vtkInformationVector **, 00106 vtkInformationVector *); 00107 00108 void ThreadedRequestData (vtkInformation* request, 00109 vtkInformationVector** inputVector, 00110 vtkInformationVector* outputVector, 00111 vtkImageData ***inData, vtkImageData **outData, 00112 int ext[6], int id); 00113 00114 00115 // see vtkAlgorithm for docs. 00116 virtual int FillInputPortInformation(int, vtkInformation*); 00117 00118 void InitOutput(int outExt[6], vtkImageData *outData); 00119 00120 void InternalComputeInputUpdateExtent( 00121 int *inExt, int *outExt, int *inWextent, int whichInput); 00122 00123 // overridden to allocate all of the output arrays, not just active scalars 00124 virtual void AllocateOutputData(vtkImageData *out, 00125 vtkInformation* outInfo, 00126 int *uExtent); 00127 virtual vtkImageData *AllocateOutputData(vtkDataObject *out, 00128 vtkInformation* outInfo); 00129 00130 // overridden to prevent shallow copies across, since we have to do it elementwise 00131 virtual void CopyAttributeData(vtkImageData *in, vtkImageData *out, 00132 vtkInformationVector** inputVector); 00133 00134 00135 private: 00136 vtkImageAppend(const vtkImageAppend&); // Not implemented. 00137 void operator=(const vtkImageAppend&); // Not implemented. 00138 }; 00139 00140 #endif 00141 00142 00143 00144