25 #ifndef WGESHADERPROPERTYDEFINEOPTIONS_H
26 #define WGESHADERPROPERTYDEFINEOPTIONS_H
32 #include <boost/signals2.hpp>
34 #include "../../common/WProperties.h"
35 #include "../../common/WPropertyTypes.h"
36 #include "../../common/exceptions/WPreconditionNotMet.h"
37 #include "WGEShaderDefineOptions.h"
38 #include "boost/tuple/tuple.hpp"
40 template<
typename PropType >
53 template<
typename PropType = WPropSelection,
typename PropIndexAdapter = WGEShaderPropertyDefineOptionsIndexAdapter< PropType > >
60 typedef std::shared_ptr< WGEShaderPropertyDefineOptions >
SPtr;
65 typedef std::shared_ptr< const WGEShaderPropertyDefineOptions >
ConstSPtr;
84 std::string option2 =
"", std::string option3 =
"", std::string option4 =
"", std::string option5 =
"",
85 std::string option6 =
"", std::string option7 =
"", std::string option8 =
"", std::string option9 =
"",
86 std::string option10 =
"" );
149 std::vector< NameDescriptionDefineTuple > defines );
158 template<
typename PropType >
176 return IdxList( 1,
typename IdxList::value_type( in ) );
208 template<
typename PropType,
typename PropIndexAdapter >
210 std::string option2, std::string option3, std::string option4, std::string option5,
211 std::string option6, std::string option7, std::string option8, std::string option9,
212 std::string option10 ):
213 WGEShaderDefineOptions( first, option2, option3, option4, option5, option6, option7, option8, option9, option10 ),
223 template<
typename PropType,
typename PropIndexAdapter >
235 template<
typename PropType,
typename PropIndexAdapter >
239 m_connection.disconnect();
242 template<
typename PropType,
typename PropIndexAdapter >
245 PropIndexAdapter functor;
246 setActivationList( functor( m_property->get() ) );
249 template<
typename PropType,
typename PropIndexAdapter >
This GLSL preprocessor is able to set one define from a list of defines depending on the active optio...
std::vector< size_t > IdxList
The type of the index list.
IdxList operator()(const WPVBaseTypes::PV_SELECTION &in) const
Converts the specified property value to an index list.
WGEShaderPropertyDefineOptions< WPropSelection >::IdxList IdxList
The type of the index-list to create.
Class converts the specified property value to an index list.
IdxList operator()(const typename PropType::element_type::ValueType &in) const
Converts the specified property value to an index list.
WGEShaderPropertyDefineOptions< PropType >::IdxList IdxList
The type of the index-list to create.
This is a WGEShaderDefineOptions class which additionally uses a property to automatically control th...
std::shared_ptr< WGEShaderPropertyDefineOptions > SPtr
Convenience typedef for a boost_shared_ptr< WGEShaderPropertyDefineOptions >.
PropType m_property
The property controlling this instance and the active options list.
std::shared_ptr< const WGEShaderPropertyDefineOptions > ConstSPtr
Convenience typedef for a boost_shared_ptr< const WGEShaderPropertyDefineOptions >.
PropType getProperty() const
Returns the property associated with this instance.
virtual ~WGEShaderPropertyDefineOptions()
Destructor.
boost::signals2::connection m_connection
The connection associated with the properties update condition.
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.
void propUpdated()
Called by the property update mechanism.
This class represents a subset of a WItemSelection.
IndexList getIndexList() const
Casts the selector to a list of indices currently selected.
std::shared_ptr< WPropertyGroup > SPtr
shared pointer to object of this type