OpenWalnut  1.4.0
Public Types | Public Member Functions | Protected Attributes
WGEPropertyUniformCallback< T > Class Template Reference

This class is an OSG Callback which allows uniforms to be controlled by properties. More...

#include <WGEPropertyUniformCallback.h>

+ Inheritance diagram for WGEPropertyUniformCallback< T >:

List of all members.

Public Types

typedef wge::UniformType
< typename
T::element_type::ValueType >
::Type 
UniformType
 The type which is used for this uniform.

Public Member Functions

 WGEPropertyUniformCallback (T property)
 Constructor.
virtual ~WGEPropertyUniformCallback ()
 Destructor.
virtual void operator() (osg::Uniform *uniform, osg::NodeVisitor *nv)
 The callback.

Protected Attributes

m_property
 The property.

Detailed Description

template<typename T>
class WGEPropertyUniformCallback< T >

This class is an OSG Callback which allows uniforms to be controlled by properties.

This is useful to simply forward properties to a shader. Please note that you still need to add this callback to the desired uniforms. A convenience class is WGEPropertyUniform which uses this callback. On each traversal of the OSG, the callback sets the value of the property to the uniform but does NOT reset the change flag.

Template Parameters:
Tthe type used as control mechanism. The type specified must support access via T->get(). Specialize the class if you do not specify a pointer.

Definition at line 43 of file WGEPropertyUniformCallback.h.


Member Typedef Documentation

template<typename T>
typedef wge::UniformType< typename T::element_type::ValueType >::Type WGEPropertyUniformCallback< T >::UniformType

The type which is used for this uniform.

Definition at line 69 of file WGEPropertyUniformCallback.h.


Constructor & Destructor Documentation

template<typename T >
WGEPropertyUniformCallback< T >::WGEPropertyUniformCallback ( property) [explicit]

Constructor.

Creates the callback. You still need to add it to the desired uniform.

Parameters:
propertythe property containing the value

Definition at line 81 of file WGEPropertyUniformCallback.h.

template<typename T >
WGEPropertyUniformCallback< T >::~WGEPropertyUniformCallback ( ) [virtual]

Destructor.

Definition at line 89 of file WGEPropertyUniformCallback.h.


Member Function Documentation

template<typename T >
void WGEPropertyUniformCallback< T >::operator() ( osg::Uniform *  uniform,
osg::NodeVisitor *  nv 
) [virtual]

The callback.

Called every render traversal for the uniform. It sets the value of the property to the uniform.

Parameters:
uniformthe uniform for which this callback is.
nvthe visitor.

Definition at line 95 of file WGEPropertyUniformCallback.h.

References wge::toUniformType().


Member Data Documentation

template<typename T>
T WGEPropertyUniformCallback< T >::m_property [protected]

The property.

Definition at line 75 of file WGEPropertyUniformCallback.h.


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