vtkTexture Class Reference

#include <vtkTexture.h>

Inheritance diagram for vtkTexture:

Inheritance graph
[legend]
Collaboration diagram for vtkTexture:

Collaboration graph
[legend]
List of all members.

Detailed Description

handles properties associated with a texture map

vtkTexture is an object that handles loading and binding of texture maps. It obtains its data from an input image data dataset type. Thus you can create visualization pipelines to read, process, and construct textures. Note that textures will only work if texture coordinates are also defined, and if the rendering system supports texture.

Instances of vtkTexture are associated with actors via the actor's SetTexture() method. Actors can share texture maps (this is encouraged to save memory resources.)

Warning:
Currently only 2D texture maps are supported, even though the data pipeline supports 1,2, and 3D texture coordinates.

Some renderers such as OpenGL require that the texture map dimensions are a power of two in each direction. Other renderers may have similar (ridiculous) restrictions, so be careful out there... (Note: a recent change to vtk allows use of non-power of two texture maps in OpenGL. The texture is automatically resampled to a power of two in one or more directions.)

See also:
vtkActor vtkRenderer vtkOpenGLTexture
Examples:
vtkTexture (Examples)
Tests:
vtkTexture (Tests)

Definition at line 67 of file vtkTexture.h.

Public Types

typedef vtkImageAlgorithm Superclass
 VTK_TEXTURE_BLENDING_MODE_NONE = 0
 VTK_TEXTURE_BLENDING_MODE_REPLACE
 VTK_TEXTURE_BLENDING_MODE_MODULATE
 VTK_TEXTURE_BLENDING_MODE_ADD
 VTK_TEXTURE_BLENDING_MODE_ADD_SIGNED
 VTK_TEXTURE_BLENDING_MODE_INTERPOLATE
 VTK_TEXTURE_BLENDING_MODE_SUBTRACT
 VTK_TEXTURE_UNIT_0 = 0
 VTK_TEXTURE_UNIT_1
 VTK_TEXTURE_UNIT_2
 VTK_TEXTURE_UNIT_3
 VTK_TEXTURE_UNIT_4
 VTK_TEXTURE_UNIT_5
 VTK_TEXTURE_UNIT_6
 VTK_TEXTURE_UNIT_7
enum  VTKTextureBlendingMode {
  VTK_TEXTURE_BLENDING_MODE_NONE = 0, VTK_TEXTURE_BLENDING_MODE_REPLACE, VTK_TEXTURE_BLENDING_MODE_MODULATE, VTK_TEXTURE_BLENDING_MODE_ADD,
  VTK_TEXTURE_BLENDING_MODE_ADD_SIGNED, VTK_TEXTURE_BLENDING_MODE_INTERPOLATE, VTK_TEXTURE_BLENDING_MODE_SUBTRACT
}
enum  VTKTextureUnit {
  VTK_TEXTURE_UNIT_0 = 0, VTK_TEXTURE_UNIT_1, VTK_TEXTURE_UNIT_2, VTK_TEXTURE_UNIT_3,
  VTK_TEXTURE_UNIT_4, VTK_TEXTURE_UNIT_5, VTK_TEXTURE_UNIT_6, VTK_TEXTURE_UNIT_7
}

Public Member Functions

virtual const char * GetClassName ()
virtual int IsA (const char *type)
void PrintSelf (ostream &os, vtkIndent indent)
virtual void Render (vtkRenderer *ren)
virtual void ReleaseGraphicsResources (vtkWindow *)
virtual void Load (vtkRenderer *)
vtkImageDataGetInput ()
unsigned char * MapScalarsToColors (vtkDataArray *scalars)
virtual int GetRepeat ()
virtual void SetRepeat (int)
virtual void RepeatOn ()
virtual void RepeatOff ()
virtual int GetInterpolate ()
virtual void SetInterpolate (int)
virtual void InterpolateOn ()
virtual void InterpolateOff ()
virtual void SetQuality (int)
virtual int GetQuality ()
void SetQualityToDefault ()
void SetQualityTo16Bit ()
void SetQualityTo32Bit ()
virtual int GetMapColorScalarsThroughLookupTable ()
virtual void SetMapColorScalarsThroughLookupTable (int)
virtual void MapColorScalarsThroughLookupTableOn ()
virtual void MapColorScalarsThroughLookupTableOff ()
void SetLookupTable (vtkScalarsToColors *)
virtual vtkScalarsToColorsGetLookupTable ()
virtual vtkUnsignedCharArrayGetMappedScalars ()
void SetTransform (vtkTransform *transform)
virtual vtkTransformGetTransform ()
virtual int GetBlendingMode ()
virtual void SetBlendingMode (int)
virtual int GetTextureUnit ()
virtual void SetTextureUnit (int)

Static Public Member Functions

static vtkTextureNew ()
static int IsTypeOf (const char *type)
static vtkTextureSafeDownCast (vtkObject *o)

Protected Member Functions

 vtkTexture ()
 ~vtkTexture ()

Protected Attributes

int Repeat
int Interpolate
int Quality
int MapColorScalarsThroughLookupTable
vtkScalarsToColorsLookupTable
vtkUnsignedCharArrayMappedScalars
vtkTransformTransform
int TextureUnit
int BlendingMode
int SelfAdjustingTableRange


Member Typedef Documentation

typedef vtkImageAlgorithm vtkTexture::Superclass

Reimplemented from vtkImageAlgorithm.

Reimplemented in vtkMesaTexture, and vtkOpenGLTexture.

Definition at line 71 of file vtkTexture.h.


Member Enumeration Documentation

enum vtkTexture::VTKTextureBlendingMode

Used to specify how the texture will blend its RGB and Alpha values with other textures and the fragment the texture is rendered upon. BTX

Enumerator:
VTK_TEXTURE_BLENDING_MODE_NONE 
VTK_TEXTURE_BLENDING_MODE_REPLACE 
VTK_TEXTURE_BLENDING_MODE_MODULATE 
VTK_TEXTURE_BLENDING_MODE_ADD 
VTK_TEXTURE_BLENDING_MODE_ADD_SIGNED 
VTK_TEXTURE_BLENDING_MODE_INTERPOLATE 
VTK_TEXTURE_BLENDING_MODE_SUBTRACT 

Definition at line 157 of file vtkTexture.h.

enum vtkTexture::VTKTextureUnit

Used to specify which texture unit a texture will use. Only relevant when multitexturing. BTX

Enumerator:
VTK_TEXTURE_UNIT_0 
VTK_TEXTURE_UNIT_1 
VTK_TEXTURE_UNIT_2 
VTK_TEXTURE_UNIT_3 
VTK_TEXTURE_UNIT_4 
VTK_TEXTURE_UNIT_5 
VTK_TEXTURE_UNIT_6 
VTK_TEXTURE_UNIT_7 

Definition at line 173 of file vtkTexture.h.


Constructor & Destructor Documentation

vtkTexture::vtkTexture (  )  [protected]

vtkTexture::~vtkTexture (  )  [protected]


Member Function Documentation

static vtkTexture* vtkTexture::New (  )  [static]

Create an object with Debug turned off, modified time initialized to zero, and reference counting on.

Reimplemented from vtkAlgorithm.

Reimplemented in vtkMesaTexture, and vtkOpenGLTexture.

virtual const char* vtkTexture::GetClassName (  )  [virtual]

Reimplemented from vtkImageAlgorithm.

Reimplemented in vtkMesaTexture, and vtkOpenGLTexture.

static int vtkTexture::IsTypeOf ( const char *  type  )  [static]

Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeRevisionMacro found in vtkSetGet.h.

Reimplemented from vtkImageAlgorithm.

Reimplemented in vtkMesaTexture, and vtkOpenGLTexture.

virtual int vtkTexture::IsA ( const char *  type  )  [virtual]

Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeRevisionMacro found in vtkSetGet.h.

Reimplemented from vtkImageAlgorithm.

Reimplemented in vtkMesaTexture, and vtkOpenGLTexture.

static vtkTexture* vtkTexture::SafeDownCast ( vtkObject o  )  [static]

Reimplemented from vtkImageAlgorithm.

Reimplemented in vtkMesaTexture, and vtkOpenGLTexture.

void vtkTexture::PrintSelf ( ostream &  os,
vtkIndent  indent 
) [virtual]

Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from vtkImageAlgorithm.

Reimplemented in vtkMesaTexture, and vtkOpenGLTexture.

virtual void vtkTexture::Render ( vtkRenderer ren  )  [virtual]

Renders a texture map. It first checks the object's modified time to make sure the texture maps Input is valid, then it invokes the Load() method.

virtual void vtkTexture::ReleaseGraphicsResources ( vtkWindow  )  [inline, virtual]

Release any graphics resources that are being consumed by this texture. The parameter window could be used to determine which graphic resources to release.

Reimplemented in vtkMesaTexture, and vtkOpenGLTexture.

Definition at line 82 of file vtkTexture.h.

virtual void vtkTexture::Load ( vtkRenderer  )  [inline, virtual]

Abstract interface to renderer. Each concrete subclass of vtkTexture will load its data into graphics system in response to this method invocation.

Reimplemented in vtkMesaTexture, and vtkOpenGLTexture.

Definition at line 87 of file vtkTexture.h.

virtual int vtkTexture::GetRepeat (  )  [virtual]

Turn on/off the repetition of the texture map when the texture coords extend beyond the [0,1] range.

virtual void vtkTexture::SetRepeat ( int   )  [virtual]

Turn on/off the repetition of the texture map when the texture coords extend beyond the [0,1] range.

virtual void vtkTexture::RepeatOn (  )  [virtual]

Turn on/off the repetition of the texture map when the texture coords extend beyond the [0,1] range.

virtual void vtkTexture::RepeatOff (  )  [virtual]

Turn on/off the repetition of the texture map when the texture coords extend beyond the [0,1] range.

virtual int vtkTexture::GetInterpolate (  )  [virtual]

Turn on/off linear interpolation of the texture map when rendering.

virtual void vtkTexture::SetInterpolate ( int   )  [virtual]

Turn on/off linear interpolation of the texture map when rendering.

virtual void vtkTexture::InterpolateOn (  )  [virtual]

Turn on/off linear interpolation of the texture map when rendering.

virtual void vtkTexture::InterpolateOff (  )  [virtual]

Turn on/off linear interpolation of the texture map when rendering.

virtual void vtkTexture::SetQuality ( int   )  [virtual]

Force texture quality to 16-bit or 32-bit. This might not be supported on all machines.

virtual int vtkTexture::GetQuality (  )  [virtual]

Force texture quality to 16-bit or 32-bit. This might not be supported on all machines.

void vtkTexture::SetQualityToDefault (  )  [inline]

Force texture quality to 16-bit or 32-bit. This might not be supported on all machines.

Definition at line 109 of file vtkTexture.h.

References VTK_TEXTURE_QUALITY_DEFAULT.

void vtkTexture::SetQualityTo16Bit (  )  [inline]

Force texture quality to 16-bit or 32-bit. This might not be supported on all machines.

Definition at line 110 of file vtkTexture.h.

References VTK_TEXTURE_QUALITY_16BIT.

void vtkTexture::SetQualityTo32Bit (  )  [inline]

Force texture quality to 16-bit or 32-bit. This might not be supported on all machines.

Definition at line 111 of file vtkTexture.h.

References VTK_TEXTURE_QUALITY_32BIT.

virtual int vtkTexture::GetMapColorScalarsThroughLookupTable (  )  [virtual]

Turn on/off the mapping of color scalars through the lookup table. The default is Off. If Off, unsigned char scalars will be used directly as texture. If On, scalars will be mapped through the lookup table to generate 4-component unsigned char scalars. This ivar does not affect other scalars like unsigned short, float, etc. These scalars are always mapped through lookup tables.

virtual void vtkTexture::SetMapColorScalarsThroughLookupTable ( int   )  [virtual]

Turn on/off the mapping of color scalars through the lookup table. The default is Off. If Off, unsigned char scalars will be used directly as texture. If On, scalars will be mapped through the lookup table to generate 4-component unsigned char scalars. This ivar does not affect other scalars like unsigned short, float, etc. These scalars are always mapped through lookup tables.

virtual void vtkTexture::MapColorScalarsThroughLookupTableOn (  )  [virtual]

Turn on/off the mapping of color scalars through the lookup table. The default is Off. If Off, unsigned char scalars will be used directly as texture. If On, scalars will be mapped through the lookup table to generate 4-component unsigned char scalars. This ivar does not affect other scalars like unsigned short, float, etc. These scalars are always mapped through lookup tables.

virtual void vtkTexture::MapColorScalarsThroughLookupTableOff (  )  [virtual]

Turn on/off the mapping of color scalars through the lookup table. The default is Off. If Off, unsigned char scalars will be used directly as texture. If On, scalars will be mapped through the lookup table to generate 4-component unsigned char scalars. This ivar does not affect other scalars like unsigned short, float, etc. These scalars are always mapped through lookup tables.

vtkImageData* vtkTexture::GetInput (  ) 

Get the input as a vtkImageData object. This method is for backwards compatibility.

Reimplemented from vtkImageAlgorithm.

void vtkTexture::SetLookupTable ( vtkScalarsToColors  ) 

Specify the lookup table to convert scalars if necessary

virtual vtkScalarsToColors* vtkTexture::GetLookupTable (  )  [virtual]

Specify the lookup table to convert scalars if necessary

virtual vtkUnsignedCharArray* vtkTexture::GetMappedScalars (  )  [virtual]

Get Mapped Scalars

unsigned char* vtkTexture::MapScalarsToColors ( vtkDataArray scalars  ) 

Map scalar values into color scalars.

void vtkTexture::SetTransform ( vtkTransform transform  ) 

Set a transform on the texture which allows one to scale, rotate and translate the texture.

virtual vtkTransform* vtkTexture::GetTransform (  )  [virtual]

Set a transform on the texture which allows one to scale, rotate and translate the texture.

virtual int vtkTexture::GetBlendingMode (  )  [virtual]

Used to specify how the texture will blend its RGB and Alpha values with other textures and the fragment the texture is rendered upon.

virtual void vtkTexture::SetBlendingMode ( int   )  [virtual]

Used to specify how the texture will blend its RGB and Alpha values with other textures and the fragment the texture is rendered upon.

virtual int vtkTexture::GetTextureUnit (  )  [virtual]

Used to specify which texture unit a texture will use. Only relevant when multitexturing.

virtual void vtkTexture::SetTextureUnit ( int   )  [virtual]

Used to specify which texture unit a texture will use. Only relevant when multitexturing.


Member Data Documentation

int vtkTexture::Repeat [protected]

Definition at line 205 of file vtkTexture.h.

int vtkTexture::Interpolate [protected]

Definition at line 206 of file vtkTexture.h.

int vtkTexture::Quality [protected]

Definition at line 207 of file vtkTexture.h.

int vtkTexture::MapColorScalarsThroughLookupTable [protected]

Definition at line 208 of file vtkTexture.h.

vtkScalarsToColors* vtkTexture::LookupTable [protected]

Definition at line 209 of file vtkTexture.h.

vtkUnsignedCharArray* vtkTexture::MappedScalars [protected]

Definition at line 210 of file vtkTexture.h.

vtkTransform* vtkTexture::Transform [protected]

Definition at line 211 of file vtkTexture.h.

int vtkTexture::TextureUnit [protected]

Definition at line 213 of file vtkTexture.h.

int vtkTexture::BlendingMode [protected]

Definition at line 214 of file vtkTexture.h.

int vtkTexture::SelfAdjustingTableRange [protected]

Definition at line 217 of file vtkTexture.h.


The documentation for this class was generated from the following file:
Generated on Mon Oct 6 16:26:18 2008 for VTK by  doxygen 1.4.7