H3D::X3DTexture3DNode Class Reference
[Abstract nodes.]

This abstract node type is the base type for all node types which specify 3D sources for texture images. More...

#include <H3D/X3DTexture3DNode.h>

Inheritance diagram for H3D::X3DTexture3DNode:

Inheritance graph

List of all members.

Public Types

typedef DependentSFNode
< FieldRef< TextureProperties,
Field,&TextureProperties::propertyChanged > > 
SFTextureProperties
 The SFTextureProperties is dependent on the propertyChanged field of the contained TextureProperties.

Public Member Functions

 X3DTexture3DNode (Inst< DisplayList > _displayList=0, Inst< SFNode > _metadata=0, Inst< SFBool > _repeatS=0, Inst< SFBool > _repeatT=0, Inst< SFBool > _repeatR=0, Inst< SFBool > _scaleToP2=0, Inst< SFImage > _image=0, Inst< SFTextureProperties > _textureProperties=0)
 Constructor.
 ~X3DTexture3DNode ()
 Destructor.
virtual void render ()
 Performs the OpenGL rendering required to install the image as a texture.
virtual void renderTextureProperties ()
 Render all OpenGL texture properties.
virtual GLint glInternalFormat (Image *image)
 Returns the internal OpenGL format to use given an Image.
virtual void enableTexturing ()
 Virtual function for making all OpenGL calls that are needed to enable texturing for the texture.
virtual void disableTexturing ()
 Virtual function for making all OpenGL calls that are needed to disable texturing for the texture.
GLuint getTextureId ()
 Get the OpenGL texture id that is used for this texture.
GLuint getTextureUnit ()
 Get the OpenGL texture unit that is used for this texture.
virtual Vec3f textureSize ()
 Sometimes the texture represents a volume in space, e.g.
virtual void glTexImage (Image *image, GLenum texture_target, bool scale_to_power_of_two)
 Installs the given image as a OpenGL texture with a call to the glTexImage3D function.
virtual void renderSubImage (Image *image, GLenum texture_target, int xoffset, int yoffset, int z_offset, int width, int height, int depth)
 Replaces part of the current texture from an image.

Public Attributes

auto_ptr< SFBoolrepeatS
 If true the texture will repeat itself when the s texture coordinate is outside the range [0,1].
auto_ptr< SFBoolrepeatT
 If true the texture will repeat itself when the t texture coordinate is outside the range [0,1].
auto_ptr< SFBoolrepeatR
 If true the texture will repeat itself when the r texture coordinate is outside the range [0,1].
auto_ptr< SFBoolscaleToPowerOfTwo
 If true the image used will be scaled so that the dimensions are a power of two if they are not.
auto_ptr< SFTexturePropertiestextureProperties
 The textureProperties field contains a TextureProperties node which allows fine control over a texture's application.

Static Public Attributes

static H3DNodeDatabase database
 The H3DNodeDatabase for this node.

Protected Attributes

GLuint texture_id
 The OpenGL texture id of the installed texture, 0 if not installed.
GLint texture_unit
 The OpenGL texture unit that is used to render this texture.


Detailed Description

This abstract node type is the base type for all node types which specify 3D sources for texture images.

Internal routes:
X3DTexture3DNode.dot

Member Typedef Documentation

The SFTextureProperties is dependent on the propertyChanged field of the contained TextureProperties.


Member Function Documentation

void X3DTexture3DNode::glTexImage ( Image image,
GLenum  texture_target,
bool  scale_to_power_of_two 
) [virtual]

Installs the given image as a OpenGL texture with a call to the glTexImage3D function.

This function is used by renderImage () and uses the glInternalFormat (), glPixelFormat () and glPixelComponentType () functions to get the arguments to the glTexImage3D call.

Reimplemented from H3D::X3DTextureNode.

References H3D::TextureProperties::borderWidth, H3DUtil::Image::byteAlignment(), H3DUtil::Image::depth(), H3D::TextureProperties::generateMipMaps, H3DUtil::Image::getImageData(), H3DUtil::RefCountedClass::getName(), glInternalFormat(), H3D::X3DTextureNode::glPixelComponentType(), H3D::X3DTextureNode::glPixelFormat(), H3DUtil::Image::height(), isPowerOfTwo(), nextPowerOfTwo(), textureProperties, and H3DUtil::Image::width().

void X3DTexture3DNode::render (  )  [virtual]

virtual Vec3f H3D::X3DTexture3DNode::textureSize (  )  [inline, virtual]

Sometimes the texture represents a volume in space, e.g.

when it contains volume data to be rendered. This function returns the size of the space the volume occupies in metres.

Reimplemented from H3D::X3DTextureNode.

References H3DUtil::Image::depth(), H3DUtil::Image::height(), H3DUtil::Image::pixelSize(), and H3DUtil::Image::width().


Member Data Documentation

If true the texture will repeat itself when the r texture coordinate is outside the range [0,1].

If false the texture will be clamped if outside the same range.

Access type: inputOutput
Default value: FALSE

X3DTexture3DNode_repeatR.dot

Referenced by renderTextureProperties(), and X3DTexture3DNode().

If true the texture will repeat itself when the s texture coordinate is outside the range [0,1].

If false the texture will be clamped if outside the same range.

Access type: inputOutput
Default value: FALSE

X3DTexture3DNode_repeatS.dot

Referenced by renderTextureProperties(), and X3DTexture3DNode().

If true the texture will repeat itself when the t texture coordinate is outside the range [0,1].

If false the texture will be clamped if outside the same range.

Access type: inputOutput
Default value: FALSE

X3DTexture3DNode_repeatT.dot

Referenced by renderTextureProperties(), and X3DTexture3DNode().

If true the image used will be scaled so that the dimensions are a power of two if they are not.

This will however take up more memory and might cause some unwanted strething effects on the texture. The new texture values will be linearly interpolated from the original ones.

Access type: inputOutput
Default value: FALSE

X3DTexture3DNode_scaleToPowerOfTwo.dot

Referenced by render(), and X3DTexture3DNode().

The textureProperties field contains a TextureProperties node which allows fine control over a texture's application.

Access type: inputOutput

X3DTexture3DNode_textureProperties.dot

Referenced by glInternalFormat(), glTexImage(), renderTextureProperties(), and X3DTexture3DNode().


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

Generated on Fri Nov 7 10:31:32 2008 for H3D API by  doxygen 1.5.7