Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

nvsg::CgFx Class Reference

Effect attribute. More...

#include <CgFx.h>

Inheritance diagram for nvsg::CgFx:

Inheritance graph
[legend]
Collaboration diagram for nvsg::CgFx:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual NVSG_API const CgFxclone (void) const
 Get a clone of this CgFx attribute.
NVSG_API bool createEffectFromFile (const std::string &file)
 Create effect from file.
NVSG_API bool isEffectValid (void) const
 Detect whether the embedded effect is valid.
NVSG_API const std::string & getEffectFile (void) const
 Get effect file.
NVSG_API size_t getNumberOfTransforms (void) const
 Get the number of transforms.
NVSG_API const CgFxTransformgetTransform (size_t index) const
 Get transform by index.
NVSG_API size_t getNumberOfTweakables (void) const
 Get the number of tweakables.
NVSG_API CgFxParameterHandle getTweakable (size_t index) const
 Get tweakable by index.
NVSG_API CgFxParameterHandle getTweakable (const std::string &name) const
 Get tweakable by name.
NVSG_API size_t getNumberOfAnnotations (CgFxEntityHandle hdl) const
 Get the number of Annotations.
NVSG_API CgFxAnnotationHandle getAnnotation (CgFxEntityHandle hdl, size_t index) const
 Get annotation by index.
NVSG_API CgFxAnnotationHandle getAnnotation (CgFxEntityHandle hdl, const std::string &name) const
 Get annotation by name.
template<typename ValueType>
void getValue (CgFxParameterHandle hdl, ValueType &value) const
 Get a CgFxParameter's value.
template<typename ValueType>
void getValue (CgFxParameterHandle hdl, ValueType *value) const
 getValue specialization for general pointer types.
NVSG_API void getValue (CgFxParameterHandle hdl, const char **value) const
 getValue specialization for 'pointer to char pointer' types.
NVSG_API void getValue (CgFxParameterHandle hdl, std::string &value) const
 getValue specialization for string types.
template<typename ValueType>
void setValue (CgFxParameterHandle hdl, const ValueType &value)
 Set a CgFxParameter's value.
template<typename ValueType>
void setValue (CgFxParameterHandle hdl, const ValueType &value) const
template<typename ValueType>
void setValue (CgFxParameterHandle hdl, const ValueType *value)
 setValue specialization for general pointer types.
template<typename ValueType>
void setValue (CgFxParameterHandle hdl, const ValueType *value) const
NVSG_API void setValue (CgFxParameterHandle hdl, const char *value)
 setValue specialization for 'pointer to char' types.
NVSG_API void setValue (CgFxParameterHandle hdl, const char *value) const
NVSG_API void setValue (CgFxParameterHandle hdl, const std::string &value)
 setValue specialization for string types.
NVSG_API void setValue (CgFxParameterHandle hdl, const std::string &value) const
NVSG_API size_t getNumberOfTechniques (void) const
 Get the number of techniques.
NVSG_API CgFxTechniqueHandle getTechnique (size_t index) const
 Get the technique by index.
NVSG_API size_t getCurrentTechnique (void) const
NVSG_API void setCurrentTechnique (size_t index)
NVSG_API bool validateCurrentTechnique (void) const
 Validate the current technique.
NVSG_API bool isCurrentTechniqueValid (void) const
 Determine if the current technique is valid.
NVSG_API bool isCurrentTechniqueValidationPending (void) const
 Detect whether validation of the current technique is pending.
NVSG_API size_t getNumberOfPasses (CgFxTechniqueHandle hdl) const
 Get the number of render passes.
NVSG_API CgFxPassHandle getPass (CgFxTechniqueHandle hdl, size_t index) const
 Get the render pass by index.
NVSG_API bool passFirstPass (void) const
 Initiate the first rendering pass.
NVSG_API bool passNextPass (void) const
 Introduce subsequent rendering passes.
virtual NVSG_API DataID getDataID (void) const
 Shared data identifier.
virtual NVSG_API bool isDataShared (void) const
 Data sharing.

Static Public Member Functions

static NVSG_API const CgFxcreate (void)
 Create a CgFx.
static NVSG_API const CgFxcreateFromBase (const StateAttribute &rhs)
 Create a CgFx by copying from a StateAttribute.

Protected Member Functions

NVSG_API CgFx (void)
 Default Constructor.
NVSG_API CgFx (const StateAttribute &rhs)
 Partial Constructor.
NVSG_API CgFx (const CgFx &rhs)
 Copy Constructor.

Detailed Description

Effect attribute.

A special state attribute describing a CgFX effect.


Constructor & Destructor Documentation

NVSG_API nvsg::CgFx::CgFx void   )  [protected]
 

Default Constructor.

NVSG_API nvsg::CgFx::CgFx const StateAttribute rhs  )  [protected]
 

Partial Constructor.

NVSG_API nvsg::CgFx::CgFx const CgFx rhs  )  [protected]
 

Copy Constructor.


Member Function Documentation

static NVSG_API const CgFx* nvsg::CgFx::create void   )  [static]
 

Create a CgFx.

Returns:
a constant pointer to a CgFx.

static NVSG_API const CgFx* nvsg::CgFx::createFromBase const StateAttribute rhs  )  [static]
 

Create a CgFx by copying from a StateAttribute.

Returns:
a constant pointer to a CgFx.
Parameters:
rhs  StateAttribute to copy from

virtual NVSG_API const CgFx* nvsg::CgFx::clone void   )  const [virtual]
 

Get a clone of this CgFx attribute.

Returns:
A constant pointer to the new created clone.

Implements nvsg::StateAttribute.

NVSG_API bool nvsg::CgFx::createEffectFromFile const std::string &  file  ) 
 

Create effect from file.

This function creates an effect from an effect file given by file.

Returns:
true if creation was successfull, false otherwise.
Parameters:
file  Name of the effect file.

bool nvsg::CgFx::isEffectValid void   )  const [inline]
 

Detect whether the embedded effect is valid.

Returns:
true if the embedded effect is valid, false otherwise.

const std::string & nvsg::CgFx::getEffectFile void   )  const [inline]
 

Get effect file.

Returns:
The filename of the effect file that was taken to create the effect.

size_t nvsg::CgFx::getNumberOfTransforms void   )  const [inline]
 

Get the number of transforms.

Returns:
The number of transform parameters for this effect.

const CgFxTransform & nvsg::CgFx::getTransform size_t  index  )  const [inline]
 

Get transform by index.

Returns:
A reference to the CgFxTransform object at index index.
Parameters:
index  Zero based index.

size_t nvsg::CgFx::getNumberOfTweakables void   )  const [inline]
 

Get the number of tweakables.

Returns:
The number of tweakable parameters for this effect.

CgFxParameterHandle nvsg::CgFx::getTweakable size_t  index  )  const [inline]
 

Get tweakable by index.

Returns:
A handle for the tweakable parameter at index index.
Parameters:
index  Zero based index.

NVSG_API CgFxParameterHandle nvsg::CgFx::getTweakable const std::string &  name  )  const
 

Get tweakable by name.

Returns:
A handle for the tweakable parameter if found, NULL otherwise.
Parameters:
name  name of the tweakable parameter.

size_t nvsg::CgFx::getNumberOfAnnotations CgFxEntityHandle  hdl  )  const [inline]
 

Get the number of Annotations.

Returns:
The number of annotations for an entity identified by hdl
Parameters:
hdl  Handle for the object holding annotations.

CgFxAnnotationHandle nvsg::CgFx::getAnnotation CgFxEntityHandle  hdl,
size_t  index
const [inline]
 

Get annotation by index.

Returns:
A handle for the annotation if successful, NULL otherwise.
Parameters:
hdl  Handle for the object holding annotations.
index  Zero based index of the annotation.

NVSG_API CgFxAnnotationHandle nvsg::CgFx::getAnnotation CgFxEntityHandle  hdl,
const std::string &  name
const
 

Get annotation by name.

Returns:
A handle for the annotation if successful, a NULL otherwise.
Parameters:
hdl  Handle for the object holding annotations.
name  Name of the annotation.

template<typename ValueType>
void nvsg::CgFx::getValue CgFxParameterHandle  hdl,
ValueType &  value
const [inline]
 

Get a CgFxParameter's value.

A function of this function family obtains the current value for a CgFxParameter identified by by hdl.

Note:
ValueType must be convertible to the embedded parameter's type. The embedded parameter's type arises out of the parameter's base type and the parameter's dimension.
Parameters:
hdl  Handle for the target parameter object.
value  Reference to an object of type ValueType to receive the value.

template<typename ValueType>
void nvsg::CgFx::getValue CgFxParameterHandle  hdl,
ValueType *  value
const [inline]
 

getValue specialization for general pointer types.

Parameters:
hdl  Handle for the target parameter object.
value  Pointer to an object of type ValueType to receive the value.

void nvsg::CgFx::getValue CgFxParameterHandle  hdl,
const char **  value
const [inline]
 

getValue specialization for 'pointer to char pointer' types.

Parameters:
hdl  Handle for the target parameter object.
value  Pointer to a 'C'-string to receive the string.

void nvsg::CgFx::getValue CgFxParameterHandle  hdl,
std::string &  value
const [inline]
 

getValue specialization for string types.

Parameters:
hdl  Handle for the target parameter object.
value  Reference to a string object to receive the string.

template<typename ValueType>
void nvsg::CgFx::setValue CgFxParameterHandle  hdl,
const ValueType &  value
[inline]
 

Set a CgFxParameter's value.

A function of this family updates the current value for a CgFxParameter identified by hdl.

Note:
ValueType must be convertible to the embedded parameter's type. The embedded parameter's type arises out of the parameter's base type and the parameter's dimension.
Parameters:
hdl  Handle for the target parameter object.
value  Reference to an object of type ValueType which holds the value to set.

template<typename ValueType>
void nvsg::CgFx::setValue CgFxParameterHandle  hdl,
const ValueType &  value
const [inline]
 

Parameters:
hdl  Handle for the target parameter object.
value  Reference to an object of type ValueType which holds the value to set.

template<typename ValueType>
void nvsg::CgFx::setValue CgFxParameterHandle  hdl,
const ValueType *  value
[inline]
 

setValue specialization for general pointer types.

Parameters:
hdl  Handle for the target parameter object.
value  Pointer to an object of type ValueType which holds the value to set.

template<typename ValueType>
void nvsg::CgFx::setValue CgFxParameterHandle  hdl,
const ValueType *  value
const [inline]
 

Parameters:
hdl  Handle for the target parameter object.
value  Pointer to an object of type ValueType which holds the value to set.

void nvsg::CgFx::setValue CgFxParameterHandle  hdl,
const char *  value
[inline]
 

setValue specialization for 'pointer to char' types.

Parameters:
hdl  Handle for the target parameter object.
value  Pointer to a 'C'-string which holds the string to set.

void nvsg::CgFx::setValue CgFxParameterHandle  hdl,
const char *  value
const [inline]
 

Parameters:
hdl  Handle for the target parameter object.
value  Pointer to a 'C'-string which holds the string to set.

void nvsg::CgFx::setValue CgFxParameterHandle  hdl,
const std::string &  value
[inline]
 

setValue specialization for string types.

Parameters:
hdl  Handle for the target parameter object.
value  Pointer to a string object which holds the string to set.

void nvsg::CgFx::setValue CgFxParameterHandle  hdl,
const std::string &  value
const [inline]
 

Parameters:
hdl  Handle for the target parameter object.
value  Pointer to a string object which holds the string to set.

size_t nvsg::CgFx::getNumberOfTechniques void   )  const [inline]
 

Get the number of techniques.

Returns:
The number of techniques available for this effect.

CgFxTechniqueHandle nvsg::CgFx::getTechnique size_t  index  )  const [inline]
 

Get the technique by index.

Returns:
A handle for the CgFxTechnique object at index index.
Parameters:
index  Zero based index of the technique.

size_t nvsg::CgFx::getCurrentTechnique void   )  const [inline]
 

Returns:
The zero based index of the technique currently used for rendering.

void nvsg::CgFx::setCurrentTechnique size_t  index  )  [inline]
 

Makes the technique at index index the current one for subsequent rendering.

Parameters:
index  Zero based index of the technique.

NVSG_API bool nvsg::CgFx::validateCurrentTechnique void   )  const
 

Validate the current technique.

Validates the current technique for subsequent rendering.

Returns:
true if validation was successfull, false otherwise.

bool nvsg::CgFx::isCurrentTechniqueValid void   )  const [inline]
 

Determine if the current technique is valid.

Returns:
true if the current technique is valid, false otherwise.

bool nvsg::CgFx::isCurrentTechniqueValidationPending void   )  const [inline]
 

Detect whether validation of the current technique is pending.

Returns:
true if the current technique was not validated before, false otherwise.

size_t nvsg::CgFx::getNumberOfPasses CgFxTechniqueHandle  hdl  )  const [inline]
 

Get the number of render passes.

Returns:
The number of render passes required for the technique identified by by tech.
Parameters:
hdl  Handle for the technique to query.

CgFxPassHandle nvsg::CgFx::getPass CgFxTechniqueHandle  hdl,
size_t  index
const [inline]
 

Get the render pass by index.

Returns:
A handle for the CgFxPass object at index index of the technique identified by by tech.
Parameters:
hdl  Handle for the technique to query.
index  Zero base index of the render pass.

NVSG_API bool nvsg::CgFx::passFirstPass void   )  const
 

Initiate the first rendering pass.

Initiates the first render pass for the current technique. Before the client code sends vertex data to the hardware for rendering, this call is needed to a.) set up the current technique for subsequent application on a per-pass basis, and b.) to apply the state for the first rendering pass.

Returns:
true if successful, false otherwise.

NVSG_API bool nvsg::CgFx::passNextPass void   )  const
 

Introduce subsequent rendering passes.

Applies the state for the very next rendering pass if available. If no subsequent rendering pass is available, this function properly ends the application of the current technique.

Returns:
true if supsequent rendering passes are available, false otherwise.

virtual NVSG_API DataID nvsg::CgFx::getDataID void   )  const [virtual]
 

Shared data identifier.

Data that is shared between different CgFx attributes will be unambiguously identified by its data ID.

Returns:
The data ID for the underlying data.

Reimplemented from nvsg::StateAttribute.

virtual NVSG_API bool nvsg::CgFx::isDataShared void   )  const [virtual]
 

Data sharing.

A CgFX attribute can share its data with annother CgFx attribute to save memory.

Returns:
Whether the underlying data is shared.

Reimplemented from nvsg::StateAttribute.


The documentation for this class was generated from the following file:
Generated on Tue Mar 1 13:20:43 2005 for NVSGSDK by NVIDIA