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 "vtkRenderingCoreModule.h" // For export macro
55 #include "vtkImageAlgorithm.h"
56 
57 class vtkImageData;
58 class vtkScalarsToColors;
59 class vtkRenderer;
61 class vtkWindow;
62 class vtkDataArray;
63 class vtkTransform;
64 
65 #define VTK_TEXTURE_QUALITY_DEFAULT 0
66 #define VTK_TEXTURE_QUALITY_16BIT 16
67 #define VTK_TEXTURE_QUALITY_32BIT 32
68 
70 {
71 public:
72  static vtkTexture* New();
73  vtkTypeMacro(vtkTexture, vtkImageAlgorithm);
74  void PrintSelf(ostream& os, vtkIndent indent);
75 
79  virtual void Render(vtkRenderer* ren);
80 
83  virtual void PostRender(vtkRenderer*) {}
84 
89 
93  virtual void Load(vtkRenderer*) {}
94 
96 
98  vtkGetMacro(Repeat, int);
99  vtkSetMacro(Repeat, int);
100  vtkBooleanMacro(Repeat, int);
102 
104 
107  vtkGetMacro(EdgeClamp, int);
108  vtkSetMacro(EdgeClamp, int);
109  vtkBooleanMacro(EdgeClamp, int);
111 
113 
114  vtkGetMacro(Interpolate, int);
115  vtkSetMacro(Interpolate, int);
116  vtkBooleanMacro(Interpolate, int);
118 
120 
122  vtkSetMacro(Quality, int);
123  vtkGetMacro(Quality, int);
125  { this->SetQuality(VTK_TEXTURE_QUALITY_DEFAULT); }
127  { this->SetQuality(VTK_TEXTURE_QUALITY_16BIT); }
129  { this->SetQuality(VTK_TEXTURE_QUALITY_32BIT); }
131 
133 
139  vtkGetMacro(MapColorScalarsThroughLookupTable, int);
140  vtkSetMacro(MapColorScalarsThroughLookupTable, int);
141  vtkBooleanMacro(MapColorScalarsThroughLookupTable, int);
143 
144 //BTX
146 
149 //ETX
151 
153 
154  void SetLookupTable(vtkScalarsToColors *);
155  vtkGetObjectMacro(LookupTable, vtkScalarsToColors);
157 
159 
160  vtkGetObjectMacro(MappedScalars, vtkUnsignedCharArray);
162 
164  unsigned char* MapScalarsToColors(vtkDataArray* scalars);
165 
167 
169  void SetTransform(vtkTransform *transform);
170  vtkGetObjectMacro(Transform, vtkTransform);
172 
173 //BTX
175 
178  {
179  VTK_TEXTURE_BLENDING_MODE_NONE = 0,
185  VTK_TEXTURE_BLENDING_MODE_SUBTRACT
186  };
187 //ETX
189 
191 
193  vtkGetMacro(BlendingMode, int);
194  vtkSetMacro(BlendingMode, int);
196 
198 
200  vtkGetMacro(PremultipliedAlpha, bool);
201  vtkSetMacro(PremultipliedAlpha, bool);
202  vtkBooleanMacro(PremultipliedAlpha, bool);
204 
206 
211  vtkGetMacro(RestrictPowerOf2ImageSmaller, int);
212  vtkSetMacro(RestrictPowerOf2ImageSmaller, int);
213  vtkBooleanMacro(RestrictPowerOf2ImageSmaller, int);
215 
219  virtual int IsTranslucent();
220 
222  virtual int GetTextureUnit() { return 0; }
223 
224 protected:
225  vtkTexture();
226  ~vtkTexture();
227 
228  // A texture is a sink, so there is no need to do anything.
229  // This definition avoids a warning when doing Update() on a vtkTexture object.
230  virtual void ExecuteData(vtkDataObject *)
231  {
232  }
233 
234  int Repeat;
237  int Quality;
242 
245  // this is to duplicated the previous behavior of SelfCreatedLookUpTable
248 
249  // the result of HasTranslucentPolygonalGeometry is cached
252 
253 private:
254  vtkTexture(const vtkTexture&); // Not implemented.
255  void operator=(const vtkTexture&); // Not implemented.
256 };
257 
258 #endif
virtual void PostRender(vtkRenderer *)
Definition: vtkTexture.h:83
VTKTextureBlendingMode
Definition: vtkTexture.h:177
#define VTK_TEXTURE_QUALITY_16BIT
Definition: vtkTexture.h:66
void SetQualityTo16Bit()
Definition: vtkTexture.h:126
int Interpolate
Definition: vtkTexture.h:236
record modification and/or execution time
Definition: vtkTimeStamp.h:34
vtkScalarsToColors * LookupTable
Definition: vtkTexture.h:239
virtual void ExecuteData(vtkDataObject *)
Definition: vtkTexture.h:230
int TranslucentCachedResult
Definition: vtkTexture.h:251
bool PremultipliedAlpha
Definition: vtkTexture.h:247
virtual void ReleaseGraphicsResources(vtkWindow *)
Definition: vtkTexture.h:88
vtkDataObject * GetInput()
abstract specification for renderers
Definition: vtkRenderer.h:63
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:59
virtual void Load(vtkRenderer *)
Definition: vtkTexture.h:93
#define VTK_TEXTURE_QUALITY_DEFAULT
Definition: vtkTexture.h:65
Superclass for mapping scalar values to colors.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:36
int MapColorScalarsThroughLookupTable
Definition: vtkTexture.h:238
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkTransform * Transform
Definition: vtkTexture.h:241
topologically and geometrically regular array of data
Definition: vtkImageData.h:44
vtkTimeStamp TranslucentComputationTime
Definition: vtkTexture.h:250
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
handles properties associated with a texture map
Definition: vtkTexture.h:69
void SetQualityToDefault()
Definition: vtkTexture.h:124
vtkUnsignedCharArray * MappedScalars
Definition: vtkTexture.h:240
dynamic, self-adjusting array of unsigned char
virtual int GetTextureUnit()
Definition: vtkTexture.h:222
int SelfAdjustingTableRange
Definition: vtkTexture.h:246
int EdgeClamp
Definition: vtkTexture.h:235
void SetQualityTo32Bit()
Definition: vtkTexture.h:128
#define VTKRENDERINGCORE_EXPORT
int RestrictPowerOf2ImageSmaller
Definition: vtkTexture.h:244
Generic algorithm superclass for image algs.
void PrintSelf(ostream &os, vtkIndent indent)
static vtkAlgorithm * New()
#define VTK_TEXTURE_QUALITY_32BIT
Definition: vtkTexture.h:67
general representation of visualization data
Definition: vtkDataObject.h:64
int BlendingMode
Definition: vtkTexture.h:243