OpenWalnut  1.4.0
Public Types | Public Member Functions | Private Member Functions | Private Attributes
WGEShaderPropertyDefineOptions< PropType, PropIndexAdapter > Class Template Reference

This is a WGEShaderDefineOptions class which additionally uses a property to automatically control the active options. More...

#include <WGEShaderPropertyDefineOptions.h>

+ Inheritance diagram for WGEShaderPropertyDefineOptions< PropType, PropIndexAdapter >:

List of all members.

Public Types

typedef boost::shared_ptr
< WGEShaderPropertyDefineOptions
SPtr
 Convenience typedef for a boost_shared_ptr< WGEShaderPropertyDefineOptions >.
typedef boost::shared_ptr
< const
WGEShaderPropertyDefineOptions
ConstSPtr
 Convenience typedef for a boost_shared_ptr< const WGEShaderPropertyDefineOptions >.

Public Member Functions

 WGEShaderPropertyDefineOptions (PropType prop, std::string first, std::string option2="", std::string option3="", std::string option4="", std::string option5="", std::string option6="", std::string option7="", std::string option8="", std::string option9="", std::string option10="")
 Create a new instance of this class.
 WGEShaderPropertyDefineOptions (PropType prop, std::vector< std::string > options)
 Create a new instance of this class.
virtual ~WGEShaderPropertyDefineOptions ()
 Destructor.
PropType getProperty () const
 Returns the property associated with this instance.

Private Member Functions

void propUpdated ()
 Called by the property update mechanism.

Private Attributes

PropType m_property
 The property controlling this instance and the active options list.
boost::signals2::connection m_connection
 The connection associated with the properties update condition.

Detailed Description

template<typename PropType = WPropSelection, typename PropIndexAdapter = WGEShaderPropertyDefineOptionsIndexAdapter< PropType >>
class WGEShaderPropertyDefineOptions< PropType, PropIndexAdapter >

This is a WGEShaderDefineOptions class which additionally uses a property to automatically control the active options.

This is very useful if you have some WPropInt or WPropSelection which controls some features in your shader. Especially with WPropSelection Instances, you can even activate multiple options if your selection allows this ( see WPropertyVariable<>::PropertyConstraint for details ). If used with a WPropBool, it is useful to switch on/off an option for example.

Notes:
You can use inherited WGEShaderDefineOptions methods too. This might create some kind of inconsistency since they of course do not update the property.

Definition at line 55 of file WGEShaderPropertyDefineOptions.h.


Member Typedef Documentation

template<typename PropType = WPropSelection, typename PropIndexAdapter = WGEShaderPropertyDefineOptionsIndexAdapter< PropType >>
typedef boost::shared_ptr< const WGEShaderPropertyDefineOptions > WGEShaderPropertyDefineOptions< PropType, PropIndexAdapter >::ConstSPtr

Convenience typedef for a boost_shared_ptr< const WGEShaderPropertyDefineOptions >.

Reimplemented from WGEShaderDefineOptions.

Definition at line 66 of file WGEShaderPropertyDefineOptions.h.

template<typename PropType = WPropSelection, typename PropIndexAdapter = WGEShaderPropertyDefineOptionsIndexAdapter< PropType >>
typedef boost::shared_ptr< WGEShaderPropertyDefineOptions > WGEShaderPropertyDefineOptions< PropType, PropIndexAdapter >::SPtr

Convenience typedef for a boost_shared_ptr< WGEShaderPropertyDefineOptions >.

Reimplemented from WGEShaderDefineOptions.

Definition at line 61 of file WGEShaderPropertyDefineOptions.h.


Constructor & Destructor Documentation

template<typename PropType, typename PropIndexAdapter >
WGEShaderPropertyDefineOptions< PropType, PropIndexAdapter >::WGEShaderPropertyDefineOptions ( PropType  prop,
std::string  first,
std::string  option2 = "",
std::string  option3 = "",
std::string  option4 = "",
std::string  option5 = "",
std::string  option6 = "",
std::string  option7 = "",
std::string  option8 = "",
std::string  option9 = "",
std::string  option10 = "" 
)

Create a new instance of this class.

The first option is mandatory and is set as default. The specified property controls the activations.

Parameters:
propthe property controlling this thing.
firstfist option. Is default.
option2another option
option3another option
option4another option
option5another option
option6another option
option7another option
option8another option
option9another option
option10another option

Definition at line 210 of file WGEShaderPropertyDefineOptions.h.

References WGEShaderPropertyDefineOptions< PropType, PropIndexAdapter >::m_connection, WGEShaderPropertyDefineOptions< PropType, PropIndexAdapter >::m_property, and WGEShaderPropertyDefineOptions< PropType, PropIndexAdapter >::propUpdated().

template<typename PropType, typename PropIndexAdapter >
WGEShaderPropertyDefineOptions< PropType, PropIndexAdapter >::WGEShaderPropertyDefineOptions ( PropType  prop,
std::vector< std::string >  options 
)

Create a new instance of this class.

The first option is mandatory and is set as default. The specified property controls the activations.

Parameters:
propthe property controlling this thing.
optionsthe list of options. Must have a size greater 0.

Definition at line 225 of file WGEShaderPropertyDefineOptions.h.

References WGEShaderPropertyDefineOptions< PropType, PropIndexAdapter >::m_connection, WGEShaderPropertyDefineOptions< PropType, PropIndexAdapter >::m_property, and WGEShaderPropertyDefineOptions< PropType, PropIndexAdapter >::propUpdated().

template<typename PropType , typename PropIndexAdapter >
WGEShaderPropertyDefineOptions< PropType, PropIndexAdapter >::~WGEShaderPropertyDefineOptions ( ) [virtual]

Destructor.

Definition at line 237 of file WGEShaderPropertyDefineOptions.h.


Member Function Documentation

template<typename PropType , typename PropIndexAdapter >
PropType WGEShaderPropertyDefineOptions< PropType, PropIndexAdapter >::getProperty ( ) const

Returns the property associated with this instance.

Returns:

Definition at line 251 of file WGEShaderPropertyDefineOptions.h.

template<typename PropType , typename PropIndexAdapter >
void WGEShaderPropertyDefineOptions< PropType, PropIndexAdapter >::propUpdated ( ) [private]

Called by the property update mechanism.

This handles the new value in the property.

Definition at line 244 of file WGEShaderPropertyDefineOptions.h.

Referenced by WGEShaderPropertyDefineOptions< PropType, PropIndexAdapter >::WGEShaderPropertyDefineOptions().


Member Data Documentation

template<typename PropType = WPropSelection, typename PropIndexAdapter = WGEShaderPropertyDefineOptionsIndexAdapter< PropType >>
boost::signals2::connection WGEShaderPropertyDefineOptions< PropType, PropIndexAdapter >::m_connection [private]

The connection associated with the properties update condition.

Definition at line 120 of file WGEShaderPropertyDefineOptions.h.

Referenced by WGEShaderPropertyDefineOptions< PropType, PropIndexAdapter >::WGEShaderPropertyDefineOptions().

template<typename PropType = WPropSelection, typename PropIndexAdapter = WGEShaderPropertyDefineOptionsIndexAdapter< PropType >>
PropType WGEShaderPropertyDefineOptions< PropType, PropIndexAdapter >::m_property [private]

The property controlling this instance and the active options list.

Definition at line 115 of file WGEShaderPropertyDefineOptions.h.

Referenced by WGEShaderPropertyDefineOptions< PropType, PropIndexAdapter >::WGEShaderPropertyDefineOptions().


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