Open Inventor Reference
SoTextureCoordinateBundle Class Reference

Bundle that allows shapes to deal with texture coordinates more easily. More...

#include <Inventor/bundles/SoTextureCoordinateBundle.h>

Inheritance diagram for SoTextureCoordinateBundle:
SoBundle

Public Member Functions

 SoTextureCoordinateBundle (SoAction *action, bool forRendering, bool setUpDefault=TRUE)
 Constructor - takes the action the bundle is used for and a flag to indicate whether the bundle is being used for rendering.
 
 ~SoTextureCoordinateBundle ()
 Destructor.
 
bool needCoordinates () const
 Returns TRUE if texture coordinates are needed at all.
 
bool isFunction () const
 return value to determine which get() to use.
 
SbVec4f get (const SbVec3f &point, const SbVec3f &normal) const
 Returns texture coordinate computed by function during primitive generation or rendering.
 
SbVec4f get (int index) const
 Returns indexed texture coordinate during primitive generation or rendering.
 
void send (int index) const
 Sends indexed texture coordinate to GL during rendering.
 

Additional Inherited Members

- Protected Member Functions inherited from SoBundle
 SoBundle (SoAction *action)
 Constructor takes action from whose state bundle is to access elements.
 
 ~SoBundle ()
 Destructor.
 
- Protected Attributes inherited from SoBundle
SoStatestate
 Stores state for any bundle.
 

Detailed Description

This class provides a fairly simple interface to texture coordinate handling, including default texture coordinate generation. This can be used during either rendering or primitive generation.

This class can be used during either rendering or primitive generation. For primitive generation, there are two cases, distinguished by the flag returned by isFunction(). If this flag is TRUE, the texture coordinates are to be generated using the get(point, normal) method, which uses a software texture coordinate function. (This process is also used for texture coordinates that are generated by default when necessary - in this case, the function does a linear map across two sides of the bounding box of the shape.) If the isFunction() flag is FALSE, the coordinates are accessed directly from the element using the get(index) method.

For GL rendering, there is an additional case. If needCoordinates() returns FALSE, no texture coordinates need to be sent at all, and the bundle does not have to be used for anything else. Otherwise, send(index) should be used.

Definition at line 91 of file SoTextureCoordinateBundle.h.

Constructor & Destructor Documentation

◆ SoTextureCoordinateBundle()

SoTextureCoordinateBundle::SoTextureCoordinateBundle ( SoAction action,
bool  forRendering,
bool  setUpDefault = TRUE 
)

If this is TRUE, the bundle can be used to send texture coordinates to GL. If it is FALSE, the setUpDefault flag (default TRUE) indicates whether to set up a texture coordinate function if the binding is DEFAULT. Shapes can pass FALSE here if they are picking and want to delay computation of the texture coordinates until an intersection is found.

◆ ~SoTextureCoordinateBundle()

SoTextureCoordinateBundle::~SoTextureCoordinateBundle ( )

Member Function Documentation

◆ get() [1/2]

SbVec4f SoTextureCoordinateBundle::get ( const SbVec3f point,
const SbVec3f normal 
) const
inline

Definition at line 116 of file SoTextureCoordinateBundle.h.

◆ get() [2/2]

SbVec4f SoTextureCoordinateBundle::get ( int  index) const
inline

Definition at line 121 of file SoTextureCoordinateBundle.h.

◆ isFunction()

bool SoTextureCoordinateBundle::isFunction ( ) const
inline

Definition at line 112 of file SoTextureCoordinateBundle.h.

◆ needCoordinates()

bool SoTextureCoordinateBundle::needCoordinates ( ) const
inline

Definition at line 109 of file SoTextureCoordinateBundle.h.

◆ send()

void SoTextureCoordinateBundle::send ( int  index) const
inline

Definition at line 127 of file SoTextureCoordinateBundle.h.


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