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

vtkTexture.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkTexture.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 =========================================================================*/
00064 #ifndef __vtkTexture_h
00065 #define __vtkTexture_h
00066 
00067 #include "vtkProcessObject.h"
00068 
00069 class vtkImageData;
00070 class vtkLookupTable;
00071 class vtkRenderer;
00072 class vtkUnsignedCharArray;
00073 class vtkWindow;
00074 class vtkDataArray;
00075 
00076 #define VTK_TEXTURE_QUALITY_DEFAULT 0
00077 #define VTK_TEXTURE_QUALITY_16BIT   16
00078 #define VTK_TEXTURE_QUALITY_32BIT   32
00079 
00080 class VTK_RENDERING_EXPORT vtkTexture : public vtkProcessObject
00081 {
00082 public:
00083   static vtkTexture *New();
00084   vtkTypeRevisionMacro(vtkTexture,vtkProcessObject);
00085   void PrintSelf(ostream& os, vtkIndent indent);
00086 
00090   virtual void Render(vtkRenderer *ren);
00091 
00095   virtual void ReleaseGraphicsResources(vtkWindow *) {};
00096 
00100   virtual void Load(vtkRenderer *) {};
00101 
00103 
00105   vtkGetMacro(Repeat,int);
00106   vtkSetMacro(Repeat,int);
00107   vtkBooleanMacro(Repeat,int);
00109 
00111 
00112   vtkGetMacro(Interpolate,int);
00113   vtkSetMacro(Interpolate,int);
00114   vtkBooleanMacro(Interpolate,int);
00116 
00118 
00120   vtkSetMacro(Quality,int);
00121   vtkGetMacro(Quality,int);
00122   void SetQualityToDefault() {this->SetQuality(VTK_TEXTURE_QUALITY_DEFAULT);};
00123   void SetQualityTo16Bit() {this->SetQuality(VTK_TEXTURE_QUALITY_16BIT);};
00124   void SetQualityTo32Bit() {this->SetQuality(VTK_TEXTURE_QUALITY_32BIT);};
00126 
00128 
00134   vtkGetMacro(MapColorScalarsThroughLookupTable,int);
00135   vtkSetMacro(MapColorScalarsThroughLookupTable,int);
00136   vtkBooleanMacro(MapColorScalarsThroughLookupTable,int);
00138 
00140 
00141   void SetInput( vtkImageData *input );
00142   vtkImageData *GetInput();
00144   
00146 
00147   void SetLookupTable(vtkLookupTable *);
00148   vtkGetObjectMacro(LookupTable,vtkLookupTable);
00150 
00152 
00153   vtkGetObjectMacro(MappedScalars,vtkUnsignedCharArray);
00155 
00157   unsigned char *MapScalarsToColors (vtkDataArray *scalars);
00158 
00159 protected:
00160   vtkTexture();
00161   ~vtkTexture();
00162 
00163   int   Repeat;
00164   int   Interpolate;
00165   int   Quality;
00166   int   MapColorScalarsThroughLookupTable;
00167   vtkLookupTable *LookupTable;
00168   vtkUnsignedCharArray *MappedScalars;
00169   
00170   // this is to duplicated the previous behavior of SelfCreatedLookUpTable
00171   int SelfAdjustingTableRange;
00172 private:
00173   vtkTexture(const vtkTexture&);  // Not implemented.
00174   void operator=(const vtkTexture&);  // Not implemented.
00175 };
00176 
00177 #endif