Castor3D  ..
Public Member Functions | Static Public Member Functions | Protected Types | Protected Attributes | List of all members
Castor3D::MatrixFrameVariable< T, Rows, Columns > Class Template Reference

Matrix shader variable with variable type and dimensions. More...

+ Inheritance diagram for Castor3D::MatrixFrameVariable< T, Rows, Columns >:
+ Collaboration diagram for Castor3D::MatrixFrameVariable< T, Rows, Columns >:

Public Member Functions

 MatrixFrameVariable (ShaderProgram *p_program)
 Constructor. More...
 
 MatrixFrameVariable (ShaderProgram *p_program, uint32_t p_occurences)
 Constructor. More...
 
 MatrixFrameVariable (MatrixFrameVariable< T, Rows, Columns > const &p_object)
 Copy constructor. More...
 
 MatrixFrameVariable (MatrixFrameVariable< T, Rows, Columns > &&p_object)
 Move constructor. More...
 
MatrixFrameVariableoperator= (MatrixFrameVariable< T, Rows, Columns > const &p_object)
 Copy assignment operator. More...
 
MatrixFrameVariableoperator= (MatrixFrameVariable< T, Rows, Columns > &&p_object)
 Move assignment operator. More...
 
virtual ~MatrixFrameVariable ()
 Destructor. More...
 
Castor::Matrix< T, Rows, Columns > & GetValue ()
 Retrieves the value. More...
 
Castor::Matrix< T, Rows, Columns > const & GetValue () const
 Retrieves the value. More...
 
Castor::Matrix< T, Rows, Columns > & GetValue (uint32_t p_index)
 Retrieves the value at given index. More...
 
Castor::Matrix< T, Rows, Columns > const & GetValue (uint32_t p_index) const
 Retrieves the value at given index. More...
 
void SetValue (Castor::Matrix< T, Rows, Columns > const &p_value)
 Defines the value of the variable. More...
 
void SetValue (Castor::Matrix< T, Rows, Columns > const &p_value, uint32_t p_index)
 Defines the value of the variable. More...
 
virtual uint32_t size () const
 Retrieves the byte size of the variable. More...
 
virtual void link (uint8_t *p_buffer)
 Defines the buffer holding the frame variable. More...
 
Castor::Matrix< T, Rows, Columns > & operator[] (uint32_t p_index)
 Array subscript operator. More...
 
Castor::Matrix< T, Rows, Columns > const & operator[] (uint32_t p_index) const
 Array subscript operator. More...
 
eVARIABLE_TYPE GetType () const
 Retrieves the variable type. More...
 
eFRAME_VARIABLE_TYPE GetFullType () const
 Retrieves the variable full type. More...
 
Castor::String GetFullTypeName () const
 Gives the variable full type name. More...
 
- Public Member Functions inherited from Castor3D::TFrameVariable< T >
 TFrameVariable (ShaderProgram *p_program)
 Constructor. More...
 
 TFrameVariable (ShaderProgram *p_program, uint32_t p_occurences)
 Constructor. More...
 
 TFrameVariable (TFrameVariable< T > const &p_object)
 Copy constructor. More...
 
 TFrameVariable (TFrameVariable< T > &&p_object)
 Move constructor. More...
 
TFrameVariableoperator= (TFrameVariable< T > const &p_object)
 Copy assignment operator. More...
 
TFrameVariableoperator= (TFrameVariable< T > &&p_object)
 Move assignment operator. More...
 
virtual ~TFrameVariable ()
 Destructor. More...
 
Castor::String GetDataTypeName () const
 Gives the variable data type. More...
 
virtual uint8_t const *const const_ptr () const
 Retrieves a pointer to the variable data. More...
 
- Public Member Functions inherited from Castor3D::FrameVariable
C3D_API FrameVariable (ShaderProgram *p_program)
 Constructor. More...
 
C3D_API FrameVariable (ShaderProgram *p_program, uint32_t p_occurences)
 Constructor. More...
 
C3D_API FrameVariable (FrameVariable const &p_object)
 Copy constructor. More...
 
C3D_API FrameVariable (FrameVariable &&p_object)
 Move constructor. More...
 
C3D_API FrameVariableoperator= (FrameVariable const &p_object)
 Copy assignment operator. More...
 
C3D_API FrameVariableoperator= (FrameVariable &&p_object)
 Move assignment operator. More...
 
virtual C3D_API ~FrameVariable ()
 Destructor. More...
 
virtual C3D_API bool Initialise ()=0
 Initialises the variable. More...
 
virtual C3D_API void Cleanup ()=0
 Cleans up the variable. More...
 
virtual C3D_API void Bind ()=0
 Binds this variable to the shader. More...
 
virtual C3D_API void Unbind ()=0
 Unbinds this variable from the shader. More...
 
virtual C3D_API void SetValueStr (Castor::String const &p_value)
 Defines the value of the variable, from a string. More...
 
virtual C3D_API void SetValueStr (Castor::String const &p_value, uint32_t p_index)
 Defines the value of the variable, from a string. More...
 
virtual void SetName (Castor::String const &p_name)
 Defines the name of the variable, as it appears in the shader program. More...
 
Castor::String GetName () const
 Gives the name of the variable, as it appears in the shader program. More...
 
Castor::String GetStrValue () const
 Retrieves the variable string value. More...
 
Castor::String GetStrValue (uint32_t p_index) const
 Retrieves the variable string value at given index. More...
 
const uint32_t & GetOccCount () const
 Retrieves the occurences count. More...
 
ShaderProgramGetProgram () const
 Retrieves the parent program. More...
 

Static Public Member Functions

static eVARIABLE_TYPE GetVariableType ()
 Gives the full type of the variable. More...
 
static eFRAME_VARIABLE_TYPE GetFrameVariableType ()
 Gives the variable full type. More...
 
static Castor::String GetFrameVariableTypeName ()
 Gives the variable full type name. More...
 

Protected Types

typedef Castor::Policy< T > policy
 
- Protected Types inherited from Castor3D::TFrameVariable< T >
typedef Castor::Policy< T > policy
 

Protected Attributes

Castor::Matrix< T, Rows, Columns > * m_mtxValue
 The matrix values. More...
 
- Protected Attributes inherited from Castor3D::TFrameVariable< T >
bool m_bOwnBuffer
 Tells the variable owns it's buffer. More...
 
T * m_values
 The buffer containing all values. More...
 
- Protected Attributes inherited from Castor3D::FrameVariable
Castor::String m_name
 The variable name as it appears in the shader program. More...
 
bool m_changed
 Tells if the variable has changed since last execution of the shader. More...
 
uint32_t m_occurences
 The array dimension if the variable represents an array. More...
 
Castor::StringArray m_strValue
 The value of the variable. More...
 
ShaderProgramm_program
 The parent shader program. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Castor3D::TFrameVariable< T >
void DoCleanupBuffer ()
 

Detailed Description

template<typename T, uint32_t Rows, uint32_t Columns>
class Castor3D::MatrixFrameVariable< T, Rows, Columns >

Matrix shader variable with variable type and dimensions.

Author
Sylvain DOREMUS
Version
0.6.1.0
Date
14/08/2010

Member Typedef Documentation

◆ policy

template<typename T, uint32_t Rows, uint32_t Columns>
typedef Castor::Policy<T> Castor3D::MatrixFrameVariable< T, Rows, Columns >::policy
protected

Constructor & Destructor Documentation

◆ MatrixFrameVariable() [1/4]

template<typename T, uint32_t Rows, uint32_t Columns>
Castor3D::MatrixFrameVariable< T, Rows, Columns >::MatrixFrameVariable ( ShaderProgram p_program)

Constructor.

Parameters
[in]p_programThe program

◆ MatrixFrameVariable() [2/4]

template<typename T, uint32_t Rows, uint32_t Columns>
Castor3D::MatrixFrameVariable< T, Rows, Columns >::MatrixFrameVariable ( ShaderProgram p_program,
uint32_t  p_occurences 
)

Constructor.

Parameters
[in]p_programThe program
[in]p_occurencesThe array dimension

◆ MatrixFrameVariable() [3/4]

template<typename T, uint32_t Rows, uint32_t Columns>
Castor3D::MatrixFrameVariable< T, Rows, Columns >::MatrixFrameVariable ( MatrixFrameVariable< T, Rows, Columns > const &  p_object)

Copy constructor.

Parameters
[in]p_objectThe object to copy

◆ MatrixFrameVariable() [4/4]

template<typename T, uint32_t Rows, uint32_t Columns>
Castor3D::MatrixFrameVariable< T, Rows, Columns >::MatrixFrameVariable ( MatrixFrameVariable< T, Rows, Columns > &&  p_object)

Move constructor.

Parameters
[in]p_objectThe object to move

◆ ~MatrixFrameVariable()

template<typename T, uint32_t Rows, uint32_t Columns>
virtual Castor3D::MatrixFrameVariable< T, Rows, Columns >::~MatrixFrameVariable ( )
virtual

Destructor.

Member Function Documentation

◆ GetFrameVariableType()

template<typename T, uint32_t Rows, uint32_t Columns>
static eFRAME_VARIABLE_TYPE Castor3D::MatrixFrameVariable< T, Rows, Columns >::GetFrameVariableType ( )
inlinestatic

Gives the variable full type.

Returns
The type

Donne le type complet de la variable

Returns
Le type

Referenced by Castor3D::MatrixFrameVariable< T, Rows, Columns >::GetFullType().

+ Here is the caller graph for this function:

◆ GetFrameVariableTypeName()

template<typename T, uint32_t Rows, uint32_t Columns>
static Castor::String Castor3D::MatrixFrameVariable< T, Rows, Columns >::GetFrameVariableTypeName ( )
inlinestatic

Gives the variable full type name.

Returns
The name

Donne le nom du type complet de la variable

Returns
Le nom

Referenced by Castor3D::MatrixFrameVariable< T, Rows, Columns >::GetFullTypeName().

+ Here is the caller graph for this function:

◆ GetFullType()

template<typename T, uint32_t Rows, uint32_t Columns>
eFRAME_VARIABLE_TYPE Castor3D::MatrixFrameVariable< T, Rows, Columns >::GetFullType ( ) const
inlinevirtual

Retrieves the variable full type.

Returns
The type

Implements Castor3D::FrameVariable.

References Castor3D::MatrixFrameVariable< T, Rows, Columns >::GetFrameVariableType().

+ Here is the call graph for this function:

◆ GetFullTypeName()

template<typename T, uint32_t Rows, uint32_t Columns>
Castor::String Castor3D::MatrixFrameVariable< T, Rows, Columns >::GetFullTypeName ( ) const
inlinevirtual

Gives the variable full type name.

Returns
The type

Donne le nom du type complet de la variable

Returns
Le type

Implements Castor3D::FrameVariable.

References Castor3D::MatrixFrameVariable< T, Rows, Columns >::GetFrameVariableTypeName().

+ Here is the call graph for this function:

◆ GetType()

template<typename T, uint32_t Rows, uint32_t Columns>
eVARIABLE_TYPE Castor3D::MatrixFrameVariable< T, Rows, Columns >::GetType ( ) const
inlinevirtual

Retrieves the variable type.

Returns
The variable type

Implements Castor3D::FrameVariable.

References Castor3D::MatrixFrameVariable< T, Rows, Columns >::GetVariableType().

+ Here is the call graph for this function:

◆ GetValue() [1/4]

template<typename T, uint32_t Rows, uint32_t Columns>
Castor::Matrix< T, Rows, Columns >& Castor3D::MatrixFrameVariable< T, Rows, Columns >::GetValue ( )
inline

Retrieves the value.

Returns
A reference to the value

◆ GetValue() [2/4]

template<typename T, uint32_t Rows, uint32_t Columns>
Castor::Matrix< T, Rows, Columns > const& Castor3D::MatrixFrameVariable< T, Rows, Columns >::GetValue ( ) const
inline

Retrieves the value.

Returns
A constant reference to the value

◆ GetValue() [3/4]

template<typename T, uint32_t Rows, uint32_t Columns>
Castor::Matrix< T, Rows, Columns >& Castor3D::MatrixFrameVariable< T, Rows, Columns >::GetValue ( uint32_t  p_index)
inline

Retrieves the value at given index.

Remarks
Check the index bounds
Parameters
[in]p_indexThe index
Returns
A reference to the value at given index

◆ GetValue() [4/4]

template<typename T, uint32_t Rows, uint32_t Columns>
Castor::Matrix< T, Rows, Columns > const& Castor3D::MatrixFrameVariable< T, Rows, Columns >::GetValue ( uint32_t  p_index) const
inline

Retrieves the value at given index.

Remarks
Check the index bounds
Parameters
[in]p_indexThe index
Returns
A constant reference to the value at given index

◆ GetVariableType()

template<typename T, uint32_t Rows, uint32_t Columns>
static eVARIABLE_TYPE Castor3D::MatrixFrameVariable< T, Rows, Columns >::GetVariableType ( )
static

Gives the full type of the variable.

Returns
The type of the variable

Referenced by Castor3D::MatrixFrameVariable< T, Rows, Columns >::GetType().

+ Here is the caller graph for this function:

◆ link()

template<typename T, uint32_t Rows, uint32_t Columns>
virtual void Castor3D::MatrixFrameVariable< T, Rows, Columns >::link ( uint8_t *  p_buffer)
virtual

Defines the buffer holding the frame variable.

Remarks
The variable no longer owns it's buffer
Parameters
[in]p_bufferThe buffer

Reimplemented from Castor3D::TFrameVariable< T >.

◆ operator=() [1/2]

template<typename T, uint32_t Rows, uint32_t Columns>
MatrixFrameVariable& Castor3D::MatrixFrameVariable< T, Rows, Columns >::operator= ( MatrixFrameVariable< T, Rows, Columns > const &  p_object)

Copy assignment operator.

Parameters
[in]p_objectThe object to copy
Returns
A reference to this object

◆ operator=() [2/2]

template<typename T, uint32_t Rows, uint32_t Columns>
MatrixFrameVariable& Castor3D::MatrixFrameVariable< T, Rows, Columns >::operator= ( MatrixFrameVariable< T, Rows, Columns > &&  p_object)

Move assignment operator.

Parameters
[in]p_objectThe object to move
Returns
A reference to this object

◆ operator[]() [1/2]

template<typename T, uint32_t Rows, uint32_t Columns>
Castor::Matrix< T, Rows, Columns >& Castor3D::MatrixFrameVariable< T, Rows, Columns >::operator[] ( uint32_t  p_index)
inline

Array subscript operator.

Remarks
Doesn't check the index bounds
Parameters
[in]p_indexThe index
Returns
A reference to the value at given index

References Castor3D::MatrixFrameVariable< T, Rows, Columns >::m_mtxValue.

◆ operator[]() [2/2]

template<typename T, uint32_t Rows, uint32_t Columns>
Castor::Matrix< T, Rows, Columns > const& Castor3D::MatrixFrameVariable< T, Rows, Columns >::operator[] ( uint32_t  p_index) const
inline

Array subscript operator.

Remarks
Doesn't check the index bounds
Parameters
[in]p_indexThe index
Returns
A constant reference to the value at given index

References Castor3D::MatrixFrameVariable< T, Rows, Columns >::m_mtxValue.

◆ SetValue() [1/2]

template<typename T, uint32_t Rows, uint32_t Columns>
void Castor3D::MatrixFrameVariable< T, Rows, Columns >::SetValue ( Castor::Matrix< T, Rows, Columns > const &  p_value)
inline

Defines the value of the variable.

Parameters
[in]p_valueThe new value

◆ SetValue() [2/2]

template<typename T, uint32_t Rows, uint32_t Columns>
void Castor3D::MatrixFrameVariable< T, Rows, Columns >::SetValue ( Castor::Matrix< T, Rows, Columns > const &  p_value,
uint32_t  p_index 
)
inline

Defines the value of the variable.

Parameters
[in]p_valueThe new value
[in]p_indexThe index of the value

◆ size()

template<typename T, uint32_t Rows, uint32_t Columns>
virtual uint32_t Castor3D::MatrixFrameVariable< T, Rows, Columns >::size ( ) const
virtual

Retrieves the byte size of the variable.

Returns
The size

Implements Castor3D::FrameVariable.

Member Data Documentation

◆ m_mtxValue

template<typename T, uint32_t Rows, uint32_t Columns>
Castor::Matrix< T, Rows, Columns >* Castor3D::MatrixFrameVariable< T, Rows, Columns >::m_mtxValue
protected

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