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 =========================================================================*/
52 #ifndef vtkTexture_h
53 #define vtkTexture_h
54 
55 #include "vtkRenderingCoreModule.h" // For export macro
56 #include "vtkImageAlgorithm.h"
57 
58 class vtkImageData;
59 class vtkScalarsToColors;
60 class vtkRenderer;
62 class vtkWindow;
63 class vtkDataArray;
64 class vtkTransform;
65 
66 #define VTK_TEXTURE_QUALITY_DEFAULT 0
67 #define VTK_TEXTURE_QUALITY_16BIT 16
68 #define VTK_TEXTURE_QUALITY_32BIT 32
69 
70 class VTKRENDERINGCORE_EXPORT vtkTexture : public vtkImageAlgorithm
71 {
72 public:
73  static vtkTexture* New();
74  vtkTypeMacro(vtkTexture, vtkImageAlgorithm);
75  void PrintSelf(ostream& os, vtkIndent indent);
76 
82  virtual void Render(vtkRenderer* ren);
83 
88  virtual void PostRender(vtkRenderer*) {}
89 
96 
102  virtual void Load(vtkRenderer*) {}
103 
105 
109  vtkGetMacro(Repeat, int);
110  vtkSetMacro(Repeat, int);
111  vtkBooleanMacro(Repeat, int);
113 
115 
121  vtkGetMacro(EdgeClamp, int);
122  vtkSetMacro(EdgeClamp, int);
123  vtkBooleanMacro(EdgeClamp, int);
125 
127 
130  vtkGetMacro(Interpolate, int);
131  vtkSetMacro(Interpolate, int);
132  vtkBooleanMacro(Interpolate, int);
134 
136 
140  vtkSetMacro(Quality, int);
141  vtkGetMacro(Quality, int);
143  { this->SetQuality(VTK_TEXTURE_QUALITY_DEFAULT); }
145  { this->SetQuality(VTK_TEXTURE_QUALITY_16BIT); }
147  { this->SetQuality(VTK_TEXTURE_QUALITY_32BIT); }
149 
151 
159  vtkGetMacro(MapColorScalarsThroughLookupTable, int);
160  vtkSetMacro(MapColorScalarsThroughLookupTable, int);
161  vtkBooleanMacro(MapColorScalarsThroughLookupTable, int);
163 
169 
171 
174  void SetLookupTable(vtkScalarsToColors *);
175  vtkGetObjectMacro(LookupTable, vtkScalarsToColors);
177 
179 
182  vtkGetObjectMacro(MappedScalars, vtkUnsignedCharArray);
184 
188  unsigned char* MapScalarsToColors(vtkDataArray* scalars);
189 
191 
195  void SetTransform(vtkTransform *transform);
196  vtkGetObjectMacro(Transform, vtkTransform);
198 
204  {
205  VTK_TEXTURE_BLENDING_MODE_NONE = 0,
211  VTK_TEXTURE_BLENDING_MODE_SUBTRACT
212  };
213 
215 
219  vtkGetMacro(BlendingMode, int);
220  vtkSetMacro(BlendingMode, int);
222 
224 
228  vtkGetMacro(PremultipliedAlpha, bool);
229  vtkSetMacro(PremultipliedAlpha, bool);
230  vtkBooleanMacro(PremultipliedAlpha, bool);
232 
234 
241  vtkGetMacro(RestrictPowerOf2ImageSmaller, int);
242  vtkSetMacro(RestrictPowerOf2ImageSmaller, int);
243  vtkBooleanMacro(RestrictPowerOf2ImageSmaller, int);
245 
252  virtual int IsTranslucent();
253 
257  virtual int GetTextureUnit() { return 0; }
258 
259 protected:
260  vtkTexture();
261  ~vtkTexture();
262 
263  // A texture is a sink, so there is no need to do anything.
264  // This definition avoids a warning when doing Update() on a vtkTexture object.
265  virtual void ExecuteData(vtkDataObject *)
266  {
267  }
268 
269  int Repeat;
272  int Quality;
277 
280  // this is to duplicated the previous behavior of SelfCreatedLookUpTable
283 
284  // the result of HasTranslucentPolygonalGeometry is cached
287 
288 private:
289  vtkTexture(const vtkTexture&) VTK_DELETE_FUNCTION;
290  void operator=(const vtkTexture&) VTK_DELETE_FUNCTION;
291 };
292 
293 #endif
virtual void PostRender(vtkRenderer *)
Cleans up after the texture rendering to restore the state of the graphics context.
Definition: vtkTexture.h:88
VTKTextureBlendingMode
Used to specify how the texture will blend its RGB and Alpha values with other textures and the fragm...
Definition: vtkTexture.h:203
#define VTK_TEXTURE_QUALITY_16BIT
Definition: vtkTexture.h:67
void SetQualityTo16Bit()
Force texture quality to 16-bit or 32-bit.
Definition: vtkTexture.h:144
int Interpolate
Definition: vtkTexture.h:271
record modification and/or execution time
Definition: vtkTimeStamp.h:35
vtkScalarsToColors * LookupTable
Definition: vtkTexture.h:274
virtual void ExecuteData(vtkDataObject *)
This method is the old style execute method, provided for the sake of backwards compatibility with ol...
Definition: vtkTexture.h:265
int TranslucentCachedResult
Definition: vtkTexture.h:286
bool PremultipliedAlpha
Definition: vtkTexture.h:282
virtual void ReleaseGraphicsResources(vtkWindow *)
Release any graphics resources that are being consumed by this texture.
Definition: vtkTexture.h:95
vtkDataObject * GetInput()
Get a data object for one of the input port connections.
abstract specification for renderers
Definition: vtkRenderer.h:63
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:60
virtual void Load(vtkRenderer *)
Abstract interface to renderer.
Definition: vtkTexture.h:102
#define VTK_TEXTURE_QUALITY_DEFAULT
Definition: vtkTexture.h:66
Superclass for mapping scalar values to colors.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
int MapColorScalarsThroughLookupTable
Definition: vtkTexture.h:273
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkTransform * Transform
Definition: vtkTexture.h:276
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
vtkTimeStamp TranslucentComputationTime
Definition: vtkTexture.h:285
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
handles properties associated with a texture map
Definition: vtkTexture.h:70
void SetQualityToDefault()
Force texture quality to 16-bit or 32-bit.
Definition: vtkTexture.h:142
vtkUnsignedCharArray * MappedScalars
Definition: vtkTexture.h:275
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:257
int SelfAdjustingTableRange
Definition: vtkTexture.h:281
int EdgeClamp
Definition: vtkTexture.h:270
void SetQualityTo32Bit()
Force texture quality to 16-bit or 32-bit.
Definition: vtkTexture.h:146
int RestrictPowerOf2ImageSmaller
Definition: vtkTexture.h:279
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:68
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
general representation of visualization data
Definition: vtkDataObject.h:64
int BlendingMode
Definition: vtkTexture.h:278
Transform
Definition: ADIOSDefs.h:39