Open Inventor Reference
SoTexture2 Class Reference

Texture mapping node. More...

#include <Inventor/nodes/SoTexture2.h>

Inheritance diagram for SoTexture2:
SoNode SoFieldContainer SoBase

List of all members.

Public Types

enum  Model { MODULATE = GL_MODULATE, DECAL = GL_DECAL, BLEND = GL_BLEND }
 Texture model. More...
enum  Wrap { REPEAT = GL_REPEAT, CLAMP = GL_CLAMP }
 Texture wrap type. More...

Public Member Functions

 SoTexture2 ()
 Creates a texture node with default settings.
virtual void doAction (SoAction *action)
 This method performs the "typical" operation of a node for any action.
virtual void GLRender (SoGLRenderAction *action)
 These virtual functions implement all of the actions for nodes, Most of the default implementations do nothing.
virtual void callback (SoCallbackAction *action)

Static Public Member Functions

static void initClass ()
 Initializes base node class.
static SbBool readImage (const SbString &fname, int &w, int &h, int &nc, unsigned char *&bytes)
 Read libimage-format file.

Public Attributes

SoSFString filename
 Fields.
SoSFImage image
 The texture.
SoSFEnum wrapS
SoSFEnum wrapT
SoSFEnum model
SoSFColor blendColor

Protected Member Functions

virtual SbBool readInstance (SoInput *in, unsigned short flags)
 Reads stuff into instance. Returns FALSE on error.
virtual ~SoTexture2 ()
int getReadStatus ()
void setReadStatus (int s)

Detailed Description

This property node defines a texture map and parameters for that map. This map is used to apply texture to subsequent shapes as they are rendered.

The texture can be read from the file specified by the filename field. Once the texture has been read, the image field contains the texture data. However, this field is marked so the image is not written out when the texture node is written to a file. To turn off texturing, set the filename field to an empty string ("").

Textures can also be specified in memory by setting the image field to contain the texture data. Doing so resets the filename to the empty string.

If the texture image's width or height is not a power of 2, or the image's width or height is greater than the maximum supported by OpenGL, then the image will be automatically scaled up or down to the next power of 2 or the maximum texture size. For maximum speed, point-sampling is used to do the scale; if you want more accurate resampling, pre-filter images to a power of 2 smaller than the maximum texture size (use the OpenGL glGetIntegerv(GL_MAX_TEXTURE_SIZE...) call to determine maximum texture for a specific OpenGL implementation).

The quality of the texturing is affected by the textureQuality field of the SoComplexity node. The textureQuality field affects what kind of filtering is done to the texture when it must be minified or magnified. The mapping of a particular texture quality value to a particular OpenGL filtering technique is implementation dependent, and varies based on the texturing performance. If mipmap filtering is required, mipmaps are automatically created using the simple box filter.

File Format/Default
Action Behavior
SoGLRenderAction, SoCallbackAction
Sets current texture in state.
See Also
SoComplexity, SoMaterial, SoTexture2Transform, SoTextureCoordinate2, SoTextureCoordinateBinding, SoTextureCoordinateFunction

Definition at line 143 of file SoTexture2.h.


Member Enumeration Documentation

Enumerator:
MODULATE 
DECAL 
BLEND 

Definition at line 149 of file SoTexture2.h.

Enumerator:
REPEAT 
CLAMP 

Definition at line 156 of file SoTexture2.h.


Constructor & Destructor Documentation

SoTexture2::SoTexture2 ( )
virtual SoTexture2::~SoTexture2 ( ) [protected, virtual]

Member Function Documentation

virtual void SoTexture2::callback ( SoCallbackAction action) [virtual]

Reimplemented from SoNode.

virtual void SoTexture2::doAction ( SoAction action) [virtual]

The default implementation does nothing.

Reimplemented from SoNode.

int SoTexture2::getReadStatus ( ) [inline, protected]

Definition at line 190 of file SoTexture2.h.

virtual void SoTexture2::GLRender ( SoGLRenderAction action) [virtual]

Reimplemented from SoNode.

static void SoTexture2::initClass ( ) [static]

Reimplemented from SoNode.

static SbBool SoTexture2::readImage ( const SbString fname,
int &  w,
int &  h,
int &  nc,
unsigned char *&  bytes 
) [static]
virtual SbBool SoTexture2::readInstance ( SoInput in,
unsigned short  flags 
) [protected, virtual]

Reimplemented from SoFieldContainer.

void SoTexture2::setReadStatus ( int  s) [inline, protected]

Definition at line 191 of file SoTexture2.h.


Member Data Documentation

Definition at line 167 of file SoTexture2.h.

file to read texture from

Definition at line 162 of file SoTexture2.h.

Definition at line 163 of file SoTexture2.h.

Definition at line 166 of file SoTexture2.h.

Definition at line 164 of file SoTexture2.h.

Definition at line 165 of file SoTexture2.h.


The documentation for this class was generated from the following file: