OpenWalnut  1.2.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Private Member Functions | Private Attributes
WGEShaderPropertyDefine< PropertyType > Class Template Reference

This class is able to provide arbitrary values as define statements in GLSL code. More...

#include <WGEShaderPropertyDefine.h>

+ Inheritance diagram for WGEShaderPropertyDefine< PropertyType >:

List of all members.

Public Types

typedef boost::shared_ptr
< WGEShaderPropertyDefine
< PropertyType > > 
SPtr
 Shared pointer for this class.
typedef boost::shared_ptr
< const
WGEShaderPropertyDefine
< PropertyType > > 
ConstSPtr
 A const shared pointer for this class.
- Public Types inherited from WGEShaderDefine< PropertyType::element_type::ValueType >
- Public Types inherited from WGEShaderPreprocessor

Public Member Functions

 WGEShaderPropertyDefine (std::string name, PropertyType prop)
 Constructs a define with a given name and initial value.
virtual ~WGEShaderPropertyDefine ()
 Destructor.
- Public Member Functions inherited from WGEShaderDefine< PropertyType::element_type::ValueType >
 WGEShaderDefine (std::string name, PropertyType::element_type::ValueTypevalue=PropertyType::element_type::ValueType(0))
 Constructs a define with a given name and initial value.
virtual ~WGEShaderDefine ()
 Destructor.
virtual std::string process (const std::string &file, const std::string &code) const
 Process the whole code.
std::string getName () const
 Returns the name of the define.
const
PropertyType::element_type::ValueType & 
getValue () const
 Returns the current value.
void setValue (const PropertyType::element_type::ValueType &value)
 Sets the new value for this define.
- Public Member Functions inherited from WGEShaderPreprocessor
 WGEShaderPreprocessor ()
 Default constructor.
virtual ~WGEShaderPreprocessor ()
 Destructor.
virtual WCondition::SPtr getChangeCondition () const
 Returns the condition denoting a change in this preprocessor filter.
void setActive (bool active=true)
 (De-)activates the preprocessor.
bool getActive () const
 If the preprocessor is active, this returns true.

Private Member Functions

void setNewValue ()
 Sets the value depending on the current value of the property.

Private Attributes

PropertyType m_property
 The associated property.
boost::signals2::connection m_connection
 The connection between the prop and the define.

Detailed Description

template<typename PropertyType = WPropBool>
class WGEShaderPropertyDefine< PropertyType >

This class is able to provide arbitrary values as define statements in GLSL code.

Unlike WGEShaderDefine, it is automatically controlled by a WPropertyVariable. You might hope that WPropBool define and undefine this thing. Thats not the case. A WPropBool causes this to be 0 or 1. If you need the first behavior, use WGEShaderDefineOptions or WGEShaderPropertyDefineOptions.

Definition at line 47 of file WGEShaderPropertyDefine.h.


Member Typedef Documentation

template<typename PropertyType = WPropBool>
typedef boost::shared_ptr< const WGEShaderPropertyDefine< PropertyType > > WGEShaderPropertyDefine< PropertyType >::ConstSPtr

A const shared pointer for this class.

Reimplemented from WGEShaderDefine< PropertyType::element_type::ValueType >.

Definition at line 58 of file WGEShaderPropertyDefine.h.

template<typename PropertyType = WPropBool>
typedef boost::shared_ptr< WGEShaderPropertyDefine< PropertyType > > WGEShaderPropertyDefine< PropertyType >::SPtr

Shared pointer for this class.

Reimplemented from WGEShaderDefine< PropertyType::element_type::ValueType >.

Definition at line 53 of file WGEShaderPropertyDefine.h.


Constructor & Destructor Documentation

template<typename PropertyType >
WGEShaderPropertyDefine< PropertyType >::WGEShaderPropertyDefine ( std::string  name,
PropertyType  prop 
)

Constructs a define with a given name and initial value.

Parameters:
namename of the define
propthe property controlling this define

Definition at line 94 of file WGEShaderPropertyDefine.h.

References WGEShaderPropertyDefine< PropertyType >::m_connection.

template<typename PropertyType >
WGEShaderPropertyDefine< PropertyType >::~WGEShaderPropertyDefine ( )
virtual

Destructor.

Definition at line 103 of file WGEShaderPropertyDefine.h.


Member Function Documentation

template<typename PropertyType >
void WGEShaderPropertyDefine< PropertyType >::setNewValue ( )
private

Sets the value depending on the current value of the property.

Definition at line 110 of file WGEShaderPropertyDefine.h.

References WGEShaderDefine< ValueType >::setValue().


Member Data Documentation

template<typename PropertyType = WPropBool>
boost::signals2::connection WGEShaderPropertyDefine< PropertyType >::m_connection
private

The connection between the prop and the define.

Definition at line 90 of file WGEShaderPropertyDefine.h.

Referenced by WGEShaderPropertyDefine< PropertyType >::WGEShaderPropertyDefine().

template<typename PropertyType = WPropBool>
PropertyType WGEShaderPropertyDefine< PropertyType >::m_property
private

The associated property.

Definition at line 80 of file WGEShaderPropertyDefine.h.


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