H3D API  2.4.1
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
H3D::X3DTextureCoordinateNode Class Reference

This abstract node type is the base type for all node types which specify texture coordinates. More...

#include <H3D/X3DTextureCoordinateNode.h>

Inheritance diagram for H3D::X3DTextureCoordinateNode:
Inheritance graph

Public Member Functions

 X3DTextureCoordinateNode (Inst< SFNode > _metadata=0)
 Constructor.
 
virtual bool supportsExplicitTexCoords ()
 Returns true if the node supports rendering of explicit texture coordinates.
 
virtual void render (int)
 Perform the OpenGL commands to render a texture coordinate given the index of the texture coordinate.
 
virtual void renderForTextureUnit (int, unsigned int)
 Render the texture coordinate for given texture unit.
 
void renderForTextureUnits (int index, unsigned int start_unit, unsigned int end_unit)
 Render the texture coordinate for the texture units between and including start_unit and end_unit.
 
void renderForActiveTexture (int index)
 Render the texture coordinate for all texture units used by the texture in X3DTextureNode::getActiveTexture.
 
void renderForTexture (int index, X3DTextureNode *t)
 Render the texture coordinate for all texture units used by the texture.
 
virtual unsigned int nrAvailableTexCoords ()
 Returns the number of texture coordinates this node can render. More...
 
virtual void renderArray ()
 Perform the OpenGL commands to render all texture coordinates as an arary.
 
void renderArrayForTexture (X3DTextureNode *t)
 Render the texture coordinate for all texture units used by the texture.
 
void renderArrayForActiveTexture ()
 Render the texture coordinate for all texture units used by the texture in X3DTextureNode::getActiveTexture.
 
virtual void renderArrayForTextureUnit (unsigned int texture_unit)
 Perform the OpenGL commands to render all texture coordinates as an array for the given texture unit.
 
void renderArrayForTextureUnits (unsigned int start_unit, unsigned int end_unit)
 Perform the OpenGL commands to render all texture coordinates as an array for the texture units between and including start_unit and end_unit.
 
virtual void disableArray ()
 Disable the array state enabled in renderArray().
 
void disableArrayForTexture (X3DTextureNode *t)
 Disable the array state enabled in renderArrayForTexture.
 
void disableArrayForActiveTexture ()
 Disable the array state enabled in renderArrayForActiveTexture.
 
virtual void disableArrayForTextureUnit (unsigned int texture_unit)
 Disable the array state enabled in renderArrayForTextureUnit().
 
void disableArrayForTextureUnits (unsigned int start_unit, unsigned int end_unit)
 Disable the array state enabled in renderArrayForTextureUnits().
 
void renderVertexBufferObjectForTexture (X3DTextureNode *t)
 Render the texture coordinate for all texture units used by the texture.
 
void renderVertexBufferObjectForActiveTexture ()
 Render the texture coordinate for all texture units used by the texture in X3DTextureNode::getActiveTexture.
 
virtual void renderVertexBufferObjectForTextureUnit (unsigned int texture_unit)
 Perform the OpenGL commands to render all texture coordinates as an vertex buffer object for the given texture unit.
 
void renderVertexBufferObjectForTextureUnits (unsigned int start_unit, unsigned int end_unit)
 Perform the OpenGL commands to render all texture coordinates as an vertex buffer object for the texture units between and including start_unit and end_unit.
 
virtual void setAttributeData ()
 Implement the method to specify data and releated information.
 
virtual void renderVBO ()
 VBO rendering implementation.
 
virtual void disableVBO ()
 VBO disabling implementation.
 
void disableVertexBufferObjectForTexture (X3DTextureNode *t)
 Disable the vertex buffer object state state enabled in renderVertexBufferObjectForTexture.
 
void disableVertexBufferObjectForActiveTexture ()
 Disable the vertex buffer object state enabled in renderVertexBufferObjectForActiveTexture.
 
virtual void disableVertexBufferObjectForTextureUnit (unsigned int texture_unit)
 Disable the vertex buffer object state enabled in renderVertexBufferObjectForTextureUnit().
 
void disableVertexBufferObjectForTextureUnits (unsigned int start_unit, unsigned int end_unit)
 Disable the vertex buffer object state enabled in renderVertexBufferObjectForTextureUnits().
 
virtual bool supportsTexGen ()
 Returns true if the node supports rendering of explicit texture coordinates.
 
virtual void startTexGen ()
 Start hardware texture coordinate generation. More...
 
virtual void stopTexGen ()
 Stop the texture coordinate generation started with startTexGen().
 
virtual bool supportsGetTexCoord (unsigned int)
 Returns true if the getTexCoord function is available for use. More...
 
virtual Vec4f getTexCoord (int, unsigned int)
 Gets texture coordinate of the given index and texture unit. More...
 
virtual void startTexGenForTexture (X3DTextureNode *t)
 Start hardware texture coordinate generateion for all texture units used by the texture

 
void startTexGenForActiveTexture ()
 Start hardware texture coordinate generateion for all texture units used by the texture in X3DTextureNode::getActiveTexture.
 
virtual void stopTexGenForTexture (X3DTextureNode *t)
 Stop texture coordinate generateion for all texture units used by the texture

 
void stopTexGenForActiveTexture ()
 Stop hardware texture coordinate generateion for all texture units used by the texture in X3DTextureNode::getActiveTexture.
 
void startTexGenForTextureUnits (unsigned int start_unit, unsigned int end_unit)
 Start hardware texture coordinate generation for the texture units between and including start_unit and end_unit. More...
 
virtual void startTexGenForTextureUnit (unsigned int texture_unit)
 Start hardware texture coordinate generation for the texture unit specified. More...
 
void stopTexGenForTextureUnits (unsigned int start_unit, unsigned int end_unit)
 Stop the texture coordinate generation started with startTexGenForTextureUnits().
 
virtual void stopTexGenForTextureUnit (unsigned int texture_unit)
 Stop hardware texture coordinate generation for the texture unit specified. More...
 
virtual string defaultXMLContainerField ()
 Returns the default xml containerField attribute value. More...
 
- Public Member Functions inherited from H3D::X3DGeometricPropertyNode
 X3DGeometricPropertyNode (Inst< SFNode > _metadata=0)
 Constructor.
 
- Public Member Functions inherited from H3D::X3DNode
 X3DNode (Inst< SFNode > _metadata=0)
 Constructor.
 
X3DMetadataObjectgetMetadataByName (const string &_name)
 Given a name, the first X3DMetadataObject in the metadata field that matches that name is returned. More...
 
- Public Member Functions inherited from H3D::Node
 Node ()
 Constructor.
 
virtual Nodeclone (bool deepCopy=true, DeepCopyMap *deepCopyMap=NULL)
 Returns a new instance of this node type with the same state as this one. More...
 
virtual ~Node ()
 Destructor.
 
X3DPrototypeInstancegetProtoInstanceParent ()
 If this node is the root node in the proto body of a X3DPrototypeInstance then this will return that node. More...
 
void setProtoInstanceParent (X3DPrototypeInstance *p)
 Set the X3DPrototypeInstance this node is the the root node if applicaple.
 
virtual void render ()
 the render() function is used for the depth-first rendering traversal of the scene-graph. More...
 
virtual void traverseSG (TraverseInfo &ti)
 traverseSG is called once per scenegraph loop on the scene in order to traverse the scenegraph. More...
 
virtual bool lineIntersect (const Vec3f &from, const Vec3f &to, LineIntersectResult &result)
 Detect intersection between a line segment and the Node. More...
 
virtual void closestPoint (const Vec3f &p, NodeIntersectResult &result)
 Find closest point on Node to p. More...
 
virtual bool movingSphereIntersect (H3DFloat radius, const Vec3f &from, const Vec3f &to, NodeIntersectResult &result)
 Detect collision between a moving sphere and the Node. More...
 
virtual FieldgetField (const string &_name) const
 return a pointer to the field specified by name within this instance
 
int addDestructCallback (void(*func)(Node *, void *), void *args)
 Add a callback function to be run on destruction of node. More...
 
int removeDestructCallback (void(*func)(Node *, void *), void *args)
 Add a callback function to be run on destruction of node. More...
 
- Public Member Functions inherited from H3D::GLVertexAttributeObject
 GLVertexAttributeObject (VERTEXATTRIBUTE::VERTEXATTRIBUTETYPE type)
 Constructor.
 
virtual ~GLVertexAttributeObject ()
 Destructor.
 
virtual bool preRenderCheckFail ()
 pre-render check to dertermine if need to render this vertex attribute
 
void renderVertexBufferObject ()
 Perform the OpenGL commands to render all vertices as a vertex buffer object.
 
void disableVertexBufferObject ()
 Disable the vertex buffer object enabled in renderVertexBufferObject().
 
virtual void updateVertexBufferObject ()
 Perform the OpenGL commands to update vertex attribute data/format.
 

Static Public Member Functions

static void renderTexCoordForActiveTexture (const Vec3f &tc)
 Render the texture coordinate for all texture units used by the texture in X3DTextureNode::getActiveTexture.
 
static void renderTexCoordForTexture (const Vec3f &tc, X3DTextureNode *t)
 Render the texture coordinate for all texture units used by the given texture .
 
static void renderVertexBufferObjectForActiveTexture (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
 Render the vertex buffer object for all texture units used by the texture in X3DTextureNode::getActiveTexture. More...
 
static void renderVertexBufferObjectForTexture (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer, X3DTextureNode *t)
 Render the vertex buffer object for all texture units used by the given texture. More...
 
static void disableVBOForActiveTexture ()
 Function that corresponds to the static version of the function renderVertexBufferObjectForActiveTexture. More...
 
static void disableVBOForTexture (X3DTextureNode *t)
 Function that corresponds to the static version of the function renderVertexBufferObjectForTexture. More...
 
- Static Public Member Functions inherited from H3D::Node
static unsigned int nrNodesAlive ()
 Returns the nr of nodes currently alive, i.e. nodes created but not destructed.
 
static int nrNodesCreated ()
 Returns the number of nodes created in total since the start of the program.
 

Protected Attributes

unsigned int texture_index
 the current texture index
 
- Protected Attributes inherited from H3D::GLVertexAttributeObject
H3DUniquePtr< FieldvboFieldsUpToDate
 Internal field used to know if vertex buffer object can be created. More...
 

Additional Inherited Members

- Public Types inherited from H3D::Node
typedef std::map< Node *, Node * > DeepCopyMap
 A map type used during a deep copy clone() to map from original nodes to cloned nodes.
 
- Public Attributes inherited from H3D::X3DGeometricPropertyNode
H3DUniquePtr< FieldpropertyChanged
 Field that indicated whether the properties have changed. More...
 
- Public Attributes inherited from H3D::X3DNode
H3DUniquePtr< SFNodemetadata
 Meta data about the node. More...
 
- Public Attributes inherited from H3D::GLVertexAttributeObject
H3DUniquePtr< SFBoolisDynamic
 Option to indicate whether this vertex attribute is dynamic or not Access type: inputOutput
Default value: false.
 
- Static Public Attributes inherited from H3D::X3DNode
static H3DNodeDatabase database
 The H3DNodeDatabase for this node.
 
- Protected Member Functions inherited from H3D::Node
void cloneFieldValue (Field &_from, Field &_to, bool deepCopy, DeepCopyMap &deepCopyMap)
 A helper function for the clone() method. More...
 
- Static Protected Member Functions inherited from H3D::Node
static NodegetClonedInstance (Node *original, bool deepCopy, DeepCopyMap &deepCopyMap)
 A helper function for nodes that implement clone() More...
 

Detailed Description

This abstract node type is the base type for all node types which specify texture coordinates.

It adds a new geometric property node type to those specified in 11 Rendering component.

Texture coordinate nodes comes in two flavours, types that generate texture coordinates and nodes that specify the texture coordinates explicitly. There are two groups of functions, one for each of the types. When a user wants to use a function he should first check if it is supported by calling the supportsExplicitTexCoords() and supportsTexGen() functions.

Member Function Documentation

◆ defaultXMLContainerField()

virtual string H3D::X3DTextureCoordinateNode::defaultXMLContainerField ( )
inlinevirtual

Returns the default xml containerField attribute value.

For this node it is "texCoord".

Reimplemented from H3D::Node.

◆ disableVBOForActiveTexture()

void X3DTextureCoordinateNode::disableVBOForActiveTexture ( )
static

Function that corresponds to the static version of the function renderVertexBufferObjectForActiveTexture.

Disables state for active texture.

References disableVBOForTexture(), and H3D::X3DTextureNode::getActiveTexture().

Referenced by H3D::Cylinder::render(), H3D::FullscreenRectangle::render(), and H3D::Sphere::render().

◆ disableVBOForTexture()

void X3DTextureCoordinateNode::disableVBOForTexture ( X3DTextureNode t)
static

Function that corresponds to the static version of the function renderVertexBufferObjectForTexture.

Disables state for given texture.

References H3D::MultiTexture::texture.

Referenced by disableVBOForActiveTexture().

◆ getTexCoord()

virtual Vec4f H3D::X3DTextureCoordinateNode::getTexCoord ( int  ,
unsigned int   
)
inlinevirtual

Gets texture coordinate of the given index and texture unit.

This function is only valid if supporteGetTexCoord returns true. TextureCoordinateGenerator e.g. does not support this function.

Reimplemented in H3D::TextureCoordinate, H3D::TextureCoordinate4D, H3D::TextureCoordinate3D, and H3D::MultiTextureCoordinate.

References Vec4f().

Referenced by H3D::MultiTextureCoordinate::getTexCoord(), and H3D::IndexedFaceSet::AutoTangent::getTexCoord().

◆ nrAvailableTexCoords()

virtual unsigned int H3D::X3DTextureCoordinateNode::nrAvailableTexCoords ( )
inlinevirtual

Returns the number of texture coordinates this node can render.

-1 means that the node is a texture coordinate generator in which case nr available coords has no meaning.

Reimplemented in H3D::TextureCoordinate4D, H3D::TextureCoordinate3D, H3D::TextureCoordinate, and H3D::MultiTextureCoordinate.

Referenced by H3D::MultiTextureCoordinate::nrAvailableTexCoords(), H3D::IndexedTriangleFanSet::render(), H3D::IndexedTriangleSet::render(), H3D::IndexedTriangleStripSet::render(), H3D::TriangleFanSet::render(), H3D::TriangleSet::render(), and H3D::TriangleStripSet::render().

◆ renderVertexBufferObjectForActiveTexture()

void X3DTextureCoordinateNode::renderVertexBufferObjectForActiveTexture ( GLint  size,
GLenum  type,
GLsizei  stride,
const GLvoid *  pointer 
)
static

Render the vertex buffer object for all texture units used by the texture in X3DTextureNode::getActiveTexture.

The arguments to this function are the same arguments as to glTexCoordPointer when using vertex buffer objects since this function is basically a wrapper around that function to handle the case of the texture being a MultiTexture.

References H3D::X3DTextureNode::getActiveTexture(), and renderVertexBufferObjectForTexture().

Referenced by H3D::ElevationGrid::render(), and H3D::X3DComposedGeometryNode::renderTexCoordVertexBufferObject().

◆ renderVertexBufferObjectForTexture()

void X3DTextureCoordinateNode::renderVertexBufferObjectForTexture ( GLint  size,
GLenum  type,
GLsizei  stride,
const GLvoid *  pointer,
X3DTextureNode t 
)
static

Render the vertex buffer object for all texture units used by the given texture.

The other arguments to this function are the same arguments as to glTexCoordPointer when using vertex buffer objects since this function is basically a wrapper around that function to handle the case of the texture being a MultiTexture.

References H3D::MultiTexture::texture.

Referenced by renderVertexBufferObjectForActiveTexture().

◆ startTexGen()

virtual void H3D::X3DTextureCoordinateNode::startTexGen ( )
inlinevirtual

Start hardware texture coordinate generation.

Algorithm depends on the texture coordinate node

Reimplemented in H3D::TextureCoordinateGenerator, and H3D::MultiTextureCoordinate.

Referenced by startTexGenForTextureUnit().

◆ startTexGenForTextureUnit()

void X3DTextureCoordinateNode::startTexGenForTextureUnit ( unsigned int  texture_unit)
virtual

Start hardware texture coordinate generation for the texture unit specified.

Algorithm depends on the texture coordinate node

Reimplemented in H3D::MultiTextureCoordinate.

References startTexGen().

Referenced by startTexGenForTexture(), H3D::MultiTextureCoordinate::startTexGenForTextureUnit(), and startTexGenForTextureUnits().

◆ startTexGenForTextureUnits()

void X3DTextureCoordinateNode::startTexGenForTextureUnits ( unsigned int  start_unit,
unsigned int  end_unit 
)

Start hardware texture coordinate generation for the texture units between and including start_unit and end_unit.

Algorithm depends on the texture coordinate node

References startTexGenForTextureUnit().

Referenced by startTexGenForTexture().

◆ stopTexGenForTextureUnit()

void X3DTextureCoordinateNode::stopTexGenForTextureUnit ( unsigned int  texture_unit)
virtual

Stop hardware texture coordinate generation for the texture unit specified.

Algorithm depends on the texture coordinate node

Reimplemented in H3D::MultiTextureCoordinate.

References stopTexGen().

Referenced by stopTexGenForTexture(), H3D::MultiTextureCoordinate::stopTexGenForTextureUnit(), and stopTexGenForTextureUnits().

◆ supportsGetTexCoord()

virtual bool H3D::X3DTextureCoordinateNode::supportsGetTexCoord ( unsigned int  )
inlinevirtual

Returns true if the getTexCoord function is available for use.

Some X3DTextureCoordinate nodes do not support getting a coordinate by an index and will return false(e.g. TextureCoordinateGenerator)

Reimplemented in H3D::TextureCoordinate, H3D::TextureCoordinate4D, H3D::TextureCoordinate3D, and H3D::MultiTextureCoordinate.

Referenced by H3D::IndexedFaceSet::AutoTangent::getTexCoord(), and H3D::MultiTextureCoordinate::supportsGetTexCoord().


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