00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include "WGEShaderPropertyDefineOptions.h"
00026
00027 WGEShaderPropertyDefineOptions< WPropSelection >::SPtr WGEShaderPropertyDefineOptionsTools::createSelection(
00028 std::string propName, std::string propDescription,
00029 WProperties::SPtr propGroup,
00030 std::vector< WGEShaderPropertyDefineOptionsTools::NameDescriptionDefineTuple > defines )
00031 {
00032
00033 boost::shared_ptr< WItemSelection > selection( new WItemSelection() );
00034 std::vector< std::string > definesOnly;
00035
00036
00037 for( std::vector< WGEShaderPropertyDefineOptionsTools::NameDescriptionDefineTuple >::const_iterator i = defines.begin(); i != defines.end();
00038 ++i )
00039 {
00040 selection->addItem( ( *i ).get< 0 >(), ( *i ).get< 1 >() );
00041 definesOnly.push_back( ( *i ).get< 2 >() );
00042 }
00043
00044 WPropSelection prop = propGroup->addProperty( propName, propDescription, selection->getSelectorFirst() );
00045
00046 WGEShaderPropertyDefineOptions<>::SPtr defOptions( new WGEShaderPropertyDefineOptions<>( prop, definesOnly ) );
00047 return defOptions;
00048 }
00049