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();
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 
157 
159 
162 
164  unsigned char* MapScalarsToColors(vtkDataArray* scalars);
165 
167 
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:
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
vtkTexture::VTK_TEXTURE_BLENDING_MODE_ADD_SIGNED
@ VTK_TEXTURE_BLENDING_MODE_ADD_SIGNED
Definition: vtkTexture.h:183
vtkTexture::VTK_TEXTURE_BLENDING_MODE_ADD
@ VTK_TEXTURE_BLENDING_MODE_ADD
Definition: vtkTexture.h:182
vtkGetObjectMacro
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:232
vtkTexture::SelfAdjustingTableRange
int SelfAdjustingTableRange
Definition: vtkTexture.h:246
vtkTexture::vtkTexture
vtkTexture()
vtkTexture::Render
virtual void Render(vtkRenderer *ren)
vtkTexture::TranslucentComputationTime
vtkTimeStamp TranslucentComputationTime
Definition: vtkTexture.h:250
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:35
vtkUnsignedCharArray
dynamic, self-adjusting array of unsigned char
Definition: vtkUnsignedCharArray.h:49
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkImageAlgorithm.h
vtkTexture::Quality
int Quality
Definition: vtkTexture.h:237
vtkTexture::MapScalarsToColors
unsigned char * MapScalarsToColors(vtkDataArray *scalars)
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
vtkImageAlgorithm
Generic algorithm superclass for image algs.
Definition: vtkImageAlgorithm.h:40
vtkTexture::MappedScalars
vtkUnsignedCharArray * MappedScalars
Definition: vtkTexture.h:240
vtkTexture::SetQualityTo32Bit
void SetQualityTo32Bit()
Definition: vtkTexture.h:128
vtkTransform
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:60
vtkX3D::Transform
@ Transform
Definition: vtkX3D.h:41
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
vtkTexture::BlendingMode
int BlendingMode
Definition: vtkTexture.h:243
VTK_TEXTURE_QUALITY_DEFAULT
#define VTK_TEXTURE_QUALITY_DEFAULT
Definition: vtkTexture.h:65
vtkTexture
handles properties associated with a texture map
Definition: vtkTexture.h:70
vtkTexture::EdgeClamp
int EdgeClamp
Definition: vtkTexture.h:235
vtkTexture::ExecuteData
virtual void ExecuteData(vtkDataObject *)
Definition: vtkTexture.h:230
vtkTexture::SetQualityTo16Bit
void SetQualityTo16Bit()
Definition: vtkTexture.h:126
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkTexture::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkRenderingCoreModule.h
vtkTexture::VTKTextureBlendingMode
VTKTextureBlendingMode
Definition: vtkTexture.h:178
vtkTexture::Repeat
int Repeat
Definition: vtkTexture.h:234
vtkTexture::SetLookupTable
void SetLookupTable(vtkScalarsToColors *)
vtkTexture::PremultipliedAlpha
bool PremultipliedAlpha
Definition: vtkTexture.h:247
vtkTexture::SetTransform
void SetTransform(vtkTransform *transform)
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkTexture::PostRender
virtual void PostRender(vtkRenderer *)
Definition: vtkTexture.h:83
vtkScalarsToColors
Superclass for mapping scalar values to colors.
Definition: vtkScalarsToColors.h:63
vtkTexture::Load
virtual void Load(vtkRenderer *)
Definition: vtkTexture.h:93
vtkTexture::VTK_TEXTURE_BLENDING_MODE_INTERPOLATE
@ VTK_TEXTURE_BLENDING_MODE_INTERPOLATE
Definition: vtkTexture.h:184
vtkTexture::~vtkTexture
~vtkTexture()
vtkTexture::Transform
vtkTransform * Transform
Definition: vtkTexture.h:241
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkTexture::TranslucentCachedResult
int TranslucentCachedResult
Definition: vtkTexture.h:251
vtkTexture::MapColorScalarsThroughLookupTable
int MapColorScalarsThroughLookupTable
Definition: vtkTexture.h:238
vtkTexture::GetInput
vtkImageData * GetInput()
VTK_TEXTURE_QUALITY_32BIT
#define VTK_TEXTURE_QUALITY_32BIT
Definition: vtkTexture.h:67
vtkTexture::Interpolate
int Interpolate
Definition: vtkTexture.h:236
vtkTexture::LookupTable
vtkScalarsToColors * LookupTable
Definition: vtkTexture.h:239
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:64
vtkTexture::New
static vtkTexture * New()
vtkTexture::IsTranslucent
virtual int IsTranslucent()
vtkTexture::GetTextureUnit
virtual int GetTextureUnit()
Definition: vtkTexture.h:222
VTKRENDERINGCORE_EXPORT
#define VTKRENDERINGCORE_EXPORT
Definition: vtkRenderingCoreModule.h:15
vtkTexture::VTK_TEXTURE_BLENDING_MODE_REPLACE
@ VTK_TEXTURE_BLENDING_MODE_REPLACE
Definition: vtkTexture.h:180
vtkTexture::ReleaseGraphicsResources
virtual void ReleaseGraphicsResources(vtkWindow *)
Definition: vtkTexture.h:88
vtkgl::transform
GLuint GLenum GLenum transform
Definition: vtkgl.h:16451
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:65
vtkTexture::VTK_TEXTURE_BLENDING_MODE_MODULATE
@ VTK_TEXTURE_BLENDING_MODE_MODULATE
Definition: vtkTexture.h:181
vtkTexture::RestrictPowerOf2ImageSmaller
int RestrictPowerOf2ImageSmaller
Definition: vtkTexture.h:244
vtkTexture::SetQualityToDefault
void SetQualityToDefault()
Definition: vtkTexture.h:124
VTK_TEXTURE_QUALITY_16BIT
#define VTK_TEXTURE_QUALITY_16BIT
Definition: vtkTexture.h:66