Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

vtkImageBlend.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkImageBlend.h,v $
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 =========================================================================*/
00076 #ifndef __vtkImageBlend_h
00077 #define __vtkImageBlend_h
00078 
00079 
00080 #include "vtkThreadedImageAlgorithm.h"
00081 
00082 class vtkImageStencilData;
00083 
00084 #define VTK_IMAGE_BLEND_MODE_NORMAL    0
00085 #define VTK_IMAGE_BLEND_MODE_COMPOUND 1
00086 
00087 class VTK_IMAGING_EXPORT vtkImageBlend : public vtkThreadedImageAlgorithm
00088 {
00089 public:
00090   static vtkImageBlend *New();
00091   vtkTypeRevisionMacro(vtkImageBlend,vtkThreadedImageAlgorithm);
00092   void PrintSelf(ostream& os, vtkIndent indent);
00093 
00095 
00098   void SetInput(int num, vtkDataObject *input);
00099   void SetInput(vtkDataObject *input) { this->SetInput(0, input); };
00101 
00103 
00106   vtkDataObject *GetInput(int num);
00107   vtkDataObject *GetInput() { return this->GetInput(0); };
00109 
00113   int GetNumberOfInputs() { return this->GetNumberOfInputConnections(0); };
00114 
00116 
00118   void SetOpacity(int idx, double opacity);
00119   double GetOpacity(int idx);
00121 
00123 
00124   void SetStencil(vtkImageStencilData *stencil);
00125   vtkImageStencilData *GetStencil();
00127 
00129 
00130   vtkSetClampMacro(BlendMode,int,
00131                    VTK_IMAGE_BLEND_MODE_NORMAL, 
00132                    VTK_IMAGE_BLEND_MODE_COMPOUND );
00133   vtkGetMacro(BlendMode,int);
00134   void SetBlendModeToNormal() 
00135         {this->SetBlendMode(VTK_IMAGE_BLEND_MODE_NORMAL);};
00136   void SetBlendModeToCompound() 
00137         {this->SetBlendMode(VTK_IMAGE_BLEND_MODE_COMPOUND);};
00138   const char *GetBlendModeAsString(void);
00140 
00142 
00144   vtkSetMacro(CompoundThreshold,double);
00145   vtkGetMacro(CompoundThreshold,double);
00147 
00148 protected:
00149   vtkImageBlend();
00150   ~vtkImageBlend();
00151 
00152   virtual int RequestUpdateExtent(vtkInformation *, 
00153                                   vtkInformationVector **,
00154                                   vtkInformationVector *);
00155 
00156   void InternalComputeInputUpdateExtent(int inExt[6], int outExt[6],
00157                                         int inWExtent[6]);
00158 
00159   
00160 
00161   virtual int RequestInformation (vtkInformation *, 
00162                                   vtkInformationVector **,
00163                                   vtkInformationVector *);
00164 
00165   void ThreadedRequestData (vtkInformation* request,
00166                             vtkInformationVector** inputVector,
00167                             vtkInformationVector* outputVector,
00168                             vtkImageData ***inData, vtkImageData **outData,
00169                             int ext[6], int id);
00170 
00171   // see vtkAlgorithm for docs.
00172   virtual int FillInputPortInformation(int, vtkInformation*);
00173 
00174   // see vtkAlgorithm for docs.
00175   virtual int RequestData(vtkInformation* request,
00176                           vtkInformationVector** inputVector,
00177                           vtkInformationVector* outputVector);
00178   
00179   double *Opacity;
00180   int OpacityArrayLength;
00181   int BlendMode;
00182   double CompoundThreshold;
00183   int DataWasPassed;  
00184 
00185 private:
00186   vtkImageBlend(const vtkImageBlend&);  // Not implemented.
00187   void operator=(const vtkImageBlend&);  // Not implemented.
00188 };
00189 
00191 inline const char *vtkImageBlend::GetBlendModeAsString()
00192 {
00193   switch (this->BlendMode)
00194     {
00195     case VTK_IMAGE_BLEND_MODE_NORMAL:
00196       return "Normal";
00197     case VTK_IMAGE_BLEND_MODE_COMPOUND:
00198       return "Compound";
00199     default:
00200       return "Unknown Blend Mode";
00201     }
00202 }
00203 
00204 
00205 #endif
00206 
00207 
00208 
00209 

Generated on Mon Jan 21 23:07:28 2008 for VTK by  doxygen 1.4.3-20050530