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

Rendering/vtkTexture.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkTexture.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 =========================================================================*/
00068 #ifndef __vtkTexture_h
00069 #define __vtkTexture_h
00070 
00071 #include "vtkProcessObject.h"
00072 
00073 class vtkImageData;
00074 class vtkLookupTable;
00075 class vtkRenderer;
00076 class vtkUnsignedCharArray;
00077 class vtkWindow;
00078 class vtkDataArray;
00079 
00080 #define VTK_TEXTURE_QUALITY_DEFAULT 0
00081 #define VTK_TEXTURE_QUALITY_16BIT   16
00082 #define VTK_TEXTURE_QUALITY_32BIT   32
00083 
00084 class VTK_RENDERING_EXPORT vtkTexture : public vtkProcessObject
00085 {
00086 public:
00087   static vtkTexture *New();
00088   vtkTypeRevisionMacro(vtkTexture,vtkProcessObject);
00089   void PrintSelf(ostream& os, vtkIndent indent);
00090 
00094   virtual void Render(vtkRenderer *ren);
00095 
00099   virtual void ReleaseGraphicsResources(vtkWindow *) {};
00100 
00104   virtual void Load(vtkRenderer *) {};
00105 
00107 
00109   vtkGetMacro(Repeat,int);
00110   vtkSetMacro(Repeat,int);
00111   vtkBooleanMacro(Repeat,int);
00113 
00115 
00116   vtkGetMacro(Interpolate,int);
00117   vtkSetMacro(Interpolate,int);
00118   vtkBooleanMacro(Interpolate,int);
00120 
00122 
00124   vtkSetMacro(Quality,int);
00125   vtkGetMacro(Quality,int);
00126   void SetQualityToDefault() {this->SetQuality(VTK_TEXTURE_QUALITY_DEFAULT);};
00127   void SetQualityTo16Bit() {this->SetQuality(VTK_TEXTURE_QUALITY_16BIT);};
00128   void SetQualityTo32Bit() {this->SetQuality(VTK_TEXTURE_QUALITY_32BIT);};
00130 
00132 
00138   vtkGetMacro(MapColorScalarsThroughLookupTable,int);
00139   vtkSetMacro(MapColorScalarsThroughLookupTable,int);
00140   vtkBooleanMacro(MapColorScalarsThroughLookupTable,int);
00142 
00144 
00145   void SetInput( vtkImageData *input );
00146   vtkImageData *GetInput();
00148   
00150 
00151   void SetLookupTable(vtkLookupTable *);
00152   vtkGetObjectMacro(LookupTable,vtkLookupTable);
00154 
00156 
00157   vtkGetObjectMacro(MappedScalars,vtkUnsignedCharArray);
00159 
00161   unsigned char *MapScalarsToColors (vtkDataArray *scalars);
00162 
00163 protected:
00164   vtkTexture();
00165   ~vtkTexture();
00166 
00167   int   Repeat;
00168   int   Interpolate;
00169   int   Quality;
00170   int   MapColorScalarsThroughLookupTable;
00171   vtkLookupTable *LookupTable;
00172   vtkUnsignedCharArray *MappedScalars;
00173   
00174   // this is to duplicated the previous behavior of SelfCreatedLookUpTable
00175   int SelfAdjustingTableRange;
00176 private:
00177   vtkTexture(const vtkTexture&);  // Not implemented.
00178   void operator=(const vtkTexture&);  // Not implemented.
00179 };
00180 
00181 #endif