VTK
dox/Imaging/vtkImageAppend.h
Go to the documentation of this file.
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 "vtkThreadedImageAlgorithm.h"
00035 
00036 class VTK_IMAGING_EXPORT vtkImageAppend : public vtkThreadedImageAlgorithm
00037 {
00038 public:
00039   static vtkImageAppend *New();
00040   vtkTypeMacro(vtkImageAppend,vtkThreadedImageAlgorithm);
00041   void PrintSelf(ostream& os, vtkIndent indent);
00042 
00047   virtual void ReplaceNthInputConnection(int idx, vtkAlgorithmOutput* input);
00048 
00050 
00054   void SetInput(int num, vtkDataObject *input);
00055   void SetInput(vtkDataObject *input) { this->SetInput(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                                   int *uExtent);
00126   virtual vtkImageData *AllocateOutputData(vtkDataObject *out);
00127 
00128   // overridden to prevent shallow copies across, since we have to do it elementwise
00129   virtual void CopyAttributeData(vtkImageData *in, vtkImageData *out,
00130                                  vtkInformationVector** inputVector);
00131 
00132 
00133 private:
00134   vtkImageAppend(const vtkImageAppend&);  // Not implemented.
00135   void operator=(const vtkImageAppend&);  // Not implemented.
00136 };
00137 
00138 #endif
00139 
00140 
00141 
00142