VTK
vtkTexture.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkTexture.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
51 #ifndef __vtkTexture_h
52 #define __vtkTexture_h
53 
54 #include "vtkImageAlgorithm.h"
55 
56 class vtkImageData;
57 class vtkScalarsToColors;
58 class vtkRenderer;
60 class vtkWindow;
61 class vtkDataArray;
62 class vtkTransform;
63 
64 #define VTK_TEXTURE_QUALITY_DEFAULT 0
65 #define VTK_TEXTURE_QUALITY_16BIT 16
66 #define VTK_TEXTURE_QUALITY_32BIT 32
67 
69 {
70 public:
71  static vtkTexture *New();
73  void PrintSelf(ostream& os, vtkIndent indent);
74 
78  virtual void Render(vtkRenderer *ren);
79 
82  virtual void PostRender(vtkRenderer *) {};
83 
87  virtual void ReleaseGraphicsResources(vtkWindow *) {};
88 
92  virtual void Load(vtkRenderer *) {};
93 
95 
97  vtkGetMacro(Repeat,int);
98  vtkSetMacro(Repeat,int);
99  vtkBooleanMacro(Repeat,int);
101 
103 
106  vtkGetMacro(EdgeClamp,int);
107  vtkSetMacro(EdgeClamp,int);
108  vtkBooleanMacro(EdgeClamp,int);
110 
112 
113  vtkGetMacro(Interpolate,int);
114  vtkSetMacro(Interpolate,int);
115  vtkBooleanMacro(Interpolate,int);
117 
119 
121  vtkSetMacro(Quality,int);
122  vtkGetMacro(Quality,int);
124  void SetQualityTo16Bit() {this->SetQuality(VTK_TEXTURE_QUALITY_16BIT);};
125  void SetQualityTo32Bit() {this->SetQuality(VTK_TEXTURE_QUALITY_32BIT);};
127 
129 
135  vtkGetMacro(MapColorScalarsThroughLookupTable,int);
136  vtkSetMacro(MapColorScalarsThroughLookupTable,int);
137  vtkBooleanMacro(MapColorScalarsThroughLookupTable,int);
139 
140 //BTX
142 
145 //ETX
147 
149 
150  void SetLookupTable(vtkScalarsToColors *);
151  vtkGetObjectMacro(LookupTable,vtkScalarsToColors);
153 
155 
156  vtkGetObjectMacro(MappedScalars,vtkUnsignedCharArray);
158 
160  unsigned char *MapScalarsToColors (vtkDataArray *scalars);
161 
163 
165  void SetTransform(vtkTransform *transform);
166  vtkGetObjectMacro(Transform, vtkTransform);
168 
169 //BTX
171 
174  {
175  VTK_TEXTURE_BLENDING_MODE_NONE = 0,
181  VTK_TEXTURE_BLENDING_MODE_SUBTRACT
182  };
183 //ETX
185 
187 
189  vtkGetMacro(BlendingMode, int);
190  vtkSetMacro(BlendingMode, int);
192 
194 
196  vtkGetMacro(PremultipliedAlpha,bool);
197  vtkSetMacro(PremultipliedAlpha,bool);
198  vtkBooleanMacro(PremultipliedAlpha,bool);
200 
202 
207  vtkGetMacro(RestrictPowerOf2ImageSmaller,int);
208  vtkSetMacro(RestrictPowerOf2ImageSmaller,int);
209  vtkBooleanMacro(RestrictPowerOf2ImageSmaller,int);
211 
215  virtual int IsTranslucent();
216 
217 protected:
218  vtkTexture();
219  ~vtkTexture();
220 
221  int Repeat;
224  int Quality;
229 
232  // this is to duplicated the previous behavior of SelfCreatedLookUpTable
235 
236  // the result of HasTranslucentPolygonalGeometry is cached
239 
240 private:
241  vtkTexture(const vtkTexture&); // Not implemented.
242  void operator=(const vtkTexture&); // Not implemented.
243 };
244 
245 #endif