Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

Imaging/vtkImageBlend.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkImageBlend.h,v $
00005   Language:  C++
00006 
00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
00008   All rights reserved.
00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00010 
00011      This software is distributed WITHOUT ANY WARRANTY; without even 
00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00013      PURPOSE.  See the above copyright notice for more information.
00014 
00015 =========================================================================*/
00091 #ifndef __vtkImageBlend_h
00092 #define __vtkImageBlend_h
00093 
00094 
00095 #include "vtkImageMultipleInputFilter.h"
00096 
00097 class vtkImageStencilData;
00098 
00099 #define VTK_IMAGE_BLEND_MODE_NORMAL    0
00100 #define VTK_IMAGE_BLEND_MODE_COMPOUND 1
00101 
00102 class VTK_IMAGING_EXPORT vtkImageBlend : public vtkImageMultipleInputFilter
00103 {
00104 public:
00105   static vtkImageBlend *New();
00106   vtkTypeRevisionMacro(vtkImageBlend,vtkImageMultipleInputFilter);
00107   void PrintSelf(ostream& os, vtkIndent indent);
00108 
00110 
00112   void SetOpacity(int idx, double opacity);
00113   double GetOpacity(int idx);
00115 
00117 
00118   virtual void SetStencil(vtkImageStencilData*);
00119   vtkGetObjectMacro(Stencil, vtkImageStencilData);
00121 
00123 
00124   vtkSetClampMacro(BlendMode,int,
00125                    VTK_IMAGE_BLEND_MODE_NORMAL, 
00126                    VTK_IMAGE_BLEND_MODE_COMPOUND );
00127   vtkGetMacro(BlendMode,int);
00128   void SetBlendModeToNormal() 
00129         {this->SetBlendMode(VTK_IMAGE_BLEND_MODE_NORMAL);};
00130   void SetBlendModeToCompound() 
00131         {this->SetBlendMode(VTK_IMAGE_BLEND_MODE_COMPOUND);};
00132   const char *GetBlendModeAsString(void);
00134 
00136 
00138   vtkSetMacro(CompoundThreshold,float);
00139   vtkGetMacro(CompoundThreshold,float);
00141 
00142 protected:
00143   vtkImageBlend();
00144   ~vtkImageBlend();
00145 
00146   void ComputeInputUpdateExtent(int inExt[6], int outExt[6],
00147                                 int whichInput);
00148 
00149   void ExecuteInformation() {
00150     this->vtkImageMultipleInputFilter::ExecuteInformation(); };
00151 
00152   void ExecuteInformation(vtkImageData **, vtkImageData *);
00153 
00154   void ThreadedExecute(vtkImageData **inDatas, 
00155                        vtkImageData *outData,
00156                        int extent[6], 
00157                        int id);
00158 
00159   void ExecuteData(vtkDataObject *output);
00160   
00161   vtkImageStencilData *Stencil;
00162   double *Opacity;
00163   int OpacityArrayLength;
00164   int BlendMode;
00165   float CompoundThreshold;
00166   int DataWasPassed;  
00167 private:
00168   vtkImageBlend(const vtkImageBlend&);  // Not implemented.
00169   void operator=(const vtkImageBlend&);  // Not implemented.
00170 };
00171 
00173 inline const char *vtkImageBlend::GetBlendModeAsString()
00174 {
00175   switch (this->BlendMode)
00176     {
00177     case VTK_IMAGE_BLEND_MODE_NORMAL:
00178       return "Normal";
00179     case VTK_IMAGE_BLEND_MODE_COMPOUND:
00180       return "Compound";
00181     default:
00182       return "Unknown Blend Mode";
00183     }
00184 }
00185 
00186 
00187 #endif
00188 
00189 
00190 
00191