25 #ifndef WGESHADERPROPERTYDEFINEOPTIONS_H
26 #define WGESHADERPROPERTYDEFINEOPTIONS_H
31 #include <boost/shared_ptr.hpp>
32 #include "boost/tuple/tuple.hpp"
33 #include <boost/signals2.hpp>
35 #include "../../common/WProperties.h"
36 #include "../../common/WPropertyTypes.h"
37 #include "../../common/exceptions/WPreconditionNotMet.h"
39 #include "WGEShaderDefineOptions.h"
41 template<
typename PropType >
54 template<
typename PropType = WPropSelection,
typename PropIndexAdapter = WGEShaderPropertyDefineOptionsIndexAdapter< PropType > >
61 typedef boost::shared_ptr< WGEShaderPropertyDefineOptions >
SPtr;
66 typedef boost::shared_ptr< const WGEShaderPropertyDefineOptions >
ConstSPtr;
85 std::string option2 =
"", std::string option3 =
"", std::string option4 =
"", std::string option5 =
"",
86 std::string option6 =
"", std::string option7 =
"", std::string option8 =
"", std::string option9 =
"",
87 std::string option10 =
"" );
131 namespace WGEShaderPropertyDefineOptionsTools
150 std::vector< NameDescriptionDefineTuple > defines );
159 template<
typename PropType >
177 return IdxList( 1,
typename IdxList::value_type( in ) );
209 template<
typename PropType,
typename PropIndexAdapter >
211 std::string option2, std::string option3, std::string option4, std::string option5,
212 std::string option6, std::string option7, std::string option8, std::string option9,
213 std::string option10 ):
214 WGEShaderDefineOptions( first, option2, option3, option4, option5, option6, option7, option8, option9, option10 ),
224 template<
typename PropType,
typename PropIndexAdapter >
236 template<
typename PropType,
typename PropIndexAdapter >
240 m_connection.disconnect();
243 template<
typename PropType,
typename PropIndexAdapter >
246 PropIndexAdapter functor;
247 setActivationList( functor( m_property->get() ) );
250 template<
typename PropType,
typename PropIndexAdapter >
256 #endif // WGESHADERPROPERTYDEFINEOPTIONS_H
void propUpdated()
Called by the property update mechanism.
IndexList getIndexList() const
Casts the selector to a list of indices currently selected.
virtual ~WGEShaderPropertyDefineOptions()
Destructor.
This is a WGEShaderDefineOptions class which additionally uses a property to automatically control th...
boost::shared_ptr< const WGEShaderPropertyDefineOptions > ConstSPtr
Convenience typedef for a boost_shared_ptr< const WGEShaderPropertyDefineOptions >.
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.
IdxList operator()(const typename PropType::element_type::ValueType &in) const
Converts the specified property value to an index list.
IdxList operator()(const WPVBaseTypes::PV_SELECTION &in) const
Converts the specified property value to an index list.
PropType m_property
The property controlling this instance and the active options list.
WGEShaderPropertyDefineOptions< PropType >::IdxList IdxList
The type of the index-list to create.
WGEShaderPropertyDefineOptions< WPropSelection >::IdxList IdxList
The type of the index-list to create.
This class represents a subset of a WItemSelection.
boost::shared_ptr< WPropertyGroup > SPtr
shared pointer to object of this type
This GLSL preprocessor is able to set one define from a list of defines depending on the active optio...
Class converts the specified property value to an index list.
std::vector< size_t > IdxList
The type of the index list.
PropType getProperty() const
Returns the property associated with this instance.
boost::shared_ptr< WGEShaderPropertyDefineOptions > SPtr
Convenience typedef for a boost_shared_ptr< WGEShaderPropertyDefineOptions >.