MCPcopy Create free account
hub / github.com/ImageEngine/cortex / Parameter

Method Parameter

src/IECore/Parameter.cpp:53–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51//////////////////////////////////////////////////////////////////////////////////////////////////////////
52
53Parameter::Parameter( const std::string &name, const std::string &description, ObjectPtr defaultValue,
54 const PresetsContainer &presets, bool presetsOnly, ConstCompoundObjectPtr userData )
55 : m_name( name ), m_description( description ), m_defaultValue( defaultValue ), m_presetsOnly( presetsOnly ),
56 m_userData( userData ? userData->copy() : nullptr )
57{
58 if ( !defaultValue )
59 {
60 throw Exception( "Invalid NULL default value!" );
61 }
62
63 for( PresetsContainer::const_iterator it=presets.begin(); it!=presets.end(); it++ )
64 {
65 m_presets.push_back( PresetsContainer::value_type( it->first, it->second->copy() ) );
66 }
67
68 /// \todo If presetsOnly is true, doesn't this allow us to set a defaultValue that isn't in the presets list?
69 setValue( defaultValue->copy() );
70}
71
72Parameter::~Parameter()
73{

Callers 15

testShadersMethod · 0.45
testManyShadersMethod · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
testParameterMethod · 0.45
testParameterAsBoolMethod · 0.45
testConnectionMethod · 0.45
testConstructorMethod · 0.45
testOutputMethod · 0.45

Calls 4

setValueFunction · 0.50
copyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by 15

testShadersMethod · 0.36
testManyShadersMethod · 0.36
testParameterMethod · 0.36
testParameterAsBoolMethod · 0.36
testConnectionMethod · 0.36
testConstructorMethod · 0.36
testOutputMethod · 0.36
testHashMethod · 0.36