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 =========================================================================*/
46 #ifndef vtkTexture_h
47 #define vtkTexture_h
48 
49 #include "vtkRenderingCoreModule.h" // For export macro
50 #include "vtkImageAlgorithm.h"
51 
52 class vtkImageData;
53 class vtkScalarsToColors;
54 class vtkRenderer;
56 class vtkWindow;
57 class vtkDataArray;
58 class vtkTransform;
59 
60 #define VTK_TEXTURE_QUALITY_DEFAULT 0
61 #define VTK_TEXTURE_QUALITY_16BIT 16
62 #define VTK_TEXTURE_QUALITY_32BIT 32
63 
64 class VTKRENDERINGCORE_EXPORT vtkTexture : public vtkImageAlgorithm
65 {
66 public:
67  static vtkTexture* New();
68  vtkTypeMacro(vtkTexture, vtkImageAlgorithm);
69  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
70 
76  virtual void Render(vtkRenderer* ren);
77 
82  virtual void PostRender(vtkRenderer*) {}
83 
90 
96  virtual void Load(vtkRenderer*) {}
97 
99 
103  vtkGetMacro(Repeat, int);
104  vtkSetMacro(Repeat, int);
105  vtkBooleanMacro(Repeat, int);
107 
109 
115  vtkGetMacro(EdgeClamp, int);
116  vtkSetMacro(EdgeClamp, int);
117  vtkBooleanMacro(EdgeClamp, int);
119 
121 
124  vtkGetMacro(Interpolate, int);
125  vtkSetMacro(Interpolate, int);
126  vtkBooleanMacro(Interpolate, int);
128 
130 
134  vtkSetMacro(Quality, int);
135  vtkGetMacro(Quality, int);
137  { this->SetQuality(VTK_TEXTURE_QUALITY_DEFAULT); }
139  { this->SetQuality(VTK_TEXTURE_QUALITY_16BIT); }
141  { this->SetQuality(VTK_TEXTURE_QUALITY_32BIT); }
143 
145 
153  vtkGetMacro(MapColorScalarsThroughLookupTable, int);
154  vtkSetMacro(MapColorScalarsThroughLookupTable, int);
155  vtkBooleanMacro(MapColorScalarsThroughLookupTable, int);
157 
163 
165 
168  void SetLookupTable(vtkScalarsToColors *);
169  vtkGetObjectMacro(LookupTable, vtkScalarsToColors);
171 
173 
176  vtkGetObjectMacro(MappedScalars, vtkUnsignedCharArray);
178 
182  unsigned char* MapScalarsToColors(vtkDataArray* scalars);
183 
185 
189  void SetTransform(vtkTransform *transform);
190  vtkGetObjectMacro(Transform, vtkTransform);
192 
198  {
199  VTK_TEXTURE_BLENDING_MODE_NONE = 0,
205  VTK_TEXTURE_BLENDING_MODE_SUBTRACT
206  };
207 
209 
213  vtkGetMacro(BlendingMode, int);
214  vtkSetMacro(BlendingMode, int);
216 
218 
222  vtkGetMacro(PremultipliedAlpha, bool);
223  vtkSetMacro(PremultipliedAlpha, bool);
224  vtkBooleanMacro(PremultipliedAlpha, bool);
226 
228 
235  vtkGetMacro(RestrictPowerOf2ImageSmaller, int);
236  vtkSetMacro(RestrictPowerOf2ImageSmaller, int);
237  vtkBooleanMacro(RestrictPowerOf2ImageSmaller, int);
239 
246  virtual int IsTranslucent();
247 
251  virtual int GetTextureUnit() { return 0; }
252 
253 protected:
254  vtkTexture();
255  ~vtkTexture() VTK_OVERRIDE;
256 
257  // A texture is a sink, so there is no need to do anything.
258  // This definition avoids a warning when doing Update() on a vtkTexture object.
259  void ExecuteData(vtkDataObject *) VTK_OVERRIDE
260  {
261  }
262 
263  int Repeat;
266  int Quality;
271 
274  // this is to duplicated the previous behavior of SelfCreatedLookUpTable
277 
278  // the result of HasTranslucentPolygonalGeometry is cached
281 
282 private:
283  vtkTexture(const vtkTexture&) VTK_DELETE_FUNCTION;
284  void operator=(const vtkTexture&) VTK_DELETE_FUNCTION;
285 };
286 
287 #endif
virtual void PostRender(vtkRenderer *)
Cleans up after the texture rendering to restore the state of the graphics context.
Definition: vtkTexture.h:82
VTKTextureBlendingMode
Used to specify how the texture will blend its RGB and Alpha values with other textures and the fragm...
Definition: vtkTexture.h:197
#define VTK_TEXTURE_QUALITY_16BIT
Definition: vtkTexture.h:61
void SetQualityTo16Bit()
Force texture quality to 16-bit or 32-bit.
Definition: vtkTexture.h:138
int Interpolate
Definition: vtkTexture.h:265
record modification and/or execution time
Definition: vtkTimeStamp.h:32
vtkScalarsToColors * LookupTable
Definition: vtkTexture.h:268
int TranslucentCachedResult
Definition: vtkTexture.h:280
bool PremultipliedAlpha
Definition: vtkTexture.h:276
virtual void ReleaseGraphicsResources(vtkWindow *)
Release any graphics resources that are being consumed by this texture.
Definition: vtkTexture.h:89
vtkDataObject * GetInput()
Get a data object for one of the input port connections.
abstract specification for renderers
Definition: vtkRenderer.h:57
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:54
virtual void Load(vtkRenderer *)
Abstract interface to renderer.
Definition: vtkTexture.h:96
#define VTK_TEXTURE_QUALITY_DEFAULT
Definition: vtkTexture.h:60
Superclass for mapping scalar values to colors.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
int MapColorScalarsThroughLookupTable
Definition: vtkTexture.h:267
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkTransform * Transform
Definition: vtkTexture.h:270
topologically and geometrically regular array of data
Definition: vtkImageData.h:39
vtkTimeStamp TranslucentComputationTime
Definition: vtkTexture.h:279
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:48
handles properties associated with a texture map
Definition: vtkTexture.h:64
void SetQualityToDefault()
Force texture quality to 16-bit or 32-bit.
Definition: vtkTexture.h:136
vtkUnsignedCharArray * MappedScalars
Definition: vtkTexture.h:269
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
dynamic, self-adjusting array of unsigned char
virtual int GetTextureUnit()
Return the texture unit used for this texture.
Definition: vtkTexture.h:251
int SelfAdjustingTableRange
Definition: vtkTexture.h:275
int EdgeClamp
Definition: vtkTexture.h:264
void SetQualityTo32Bit()
Force texture quality to 16-bit or 32-bit.
Definition: vtkTexture.h:140
void ExecuteData(vtkDataObject *) override
This method is the old style execute method, provided for the sake of backwards compatibility with ol...
Definition: vtkTexture.h:259
int RestrictPowerOf2ImageSmaller
Definition: vtkTexture.h:273
Generic algorithm superclass for image algs.
static vtkAlgorithm * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
#define VTK_TEXTURE_QUALITY_32BIT
Definition: vtkTexture.h:62
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
general representation of visualization data
Definition: vtkDataObject.h:58
int BlendingMode
Definition: vtkTexture.h:272
Transform
Definition: ADIOSDefs.h:39