Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class 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 
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 =========================================================================*/
00050 #ifndef __vtkTexture_h
00051 #define __vtkTexture_h
00052 
00053 #include "vtkProcessObject.h"
00054 
00055 class vtkImageData;
00056 class vtkLookupTable;
00057 class vtkRenderer;
00058 class vtkUnsignedCharArray;
00059 class vtkWindow;
00060 class vtkDataArray;
00061 
00062 #define VTK_TEXTURE_QUALITY_DEFAULT 0
00063 #define VTK_TEXTURE_QUALITY_16BIT   16
00064 #define VTK_TEXTURE_QUALITY_32BIT   32
00065 
00066 class VTK_RENDERING_EXPORT vtkTexture : public vtkProcessObject
00067 {
00068 public:
00069   static vtkTexture *New();
00070   vtkTypeRevisionMacro(vtkTexture,vtkProcessObject);
00071   void PrintSelf(ostream& os, vtkIndent indent);
00072 
00076   virtual void Render(vtkRenderer *ren);
00077 
00081   virtual void ReleaseGraphicsResources(vtkWindow *) {};
00082 
00086   virtual void Load(vtkRenderer *) {};
00087 
00089 
00091   vtkGetMacro(Repeat,int);
00092   vtkSetMacro(Repeat,int);
00093   vtkBooleanMacro(Repeat,int);
00095 
00097 
00098   vtkGetMacro(Interpolate,int);
00099   vtkSetMacro(Interpolate,int);
00100   vtkBooleanMacro(Interpolate,int);
00102 
00104 
00106   vtkSetMacro(Quality,int);
00107   vtkGetMacro(Quality,int);
00108   void SetQualityToDefault() {this->SetQuality(VTK_TEXTURE_QUALITY_DEFAULT);};
00109   void SetQualityTo16Bit() {this->SetQuality(VTK_TEXTURE_QUALITY_16BIT);};
00110   void SetQualityTo32Bit() {this->SetQuality(VTK_TEXTURE_QUALITY_32BIT);};
00112 
00114 
00120   vtkGetMacro(MapColorScalarsThroughLookupTable,int);
00121   vtkSetMacro(MapColorScalarsThroughLookupTable,int);
00122   vtkBooleanMacro(MapColorScalarsThroughLookupTable,int);
00124 
00126 
00127   void SetInput( vtkImageData *input );
00128   vtkImageData *GetInput();
00130   
00132 
00133   void SetLookupTable(vtkLookupTable *);
00134   vtkGetObjectMacro(LookupTable,vtkLookupTable);
00136 
00138 
00139   vtkGetObjectMacro(MappedScalars,vtkUnsignedCharArray);
00141 
00143   unsigned char *MapScalarsToColors (vtkDataArray *scalars);
00144 
00145 protected:
00146   vtkTexture();
00147   ~vtkTexture();
00148 
00149   int   Repeat;
00150   int   Interpolate;
00151   int   Quality;
00152   int   MapColorScalarsThroughLookupTable;
00153   vtkLookupTable *LookupTable;
00154   vtkUnsignedCharArray *MappedScalars;
00155   
00156   // this is to duplicated the previous behavior of SelfCreatedLookUpTable
00157   int SelfAdjustingTableRange;
00158 private:
00159   vtkTexture(const vtkTexture&);  // Not implemented.
00160   void operator=(const vtkTexture&);  // Not implemented.
00161 };
00162 
00163 #endif