X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpPlugins%2FInterface%2FParameters.cxx;h=2e6d36c88b8aba369d36421c22907b47baf296f2;hb=6ffc11d77924d6ab7e94db95d41105982ac73e00;hp=1b239725411c8b5cc87e947b3c6ce6db21db0f7f;hpb=46f2cf7aa39bda8301b22fcfddd43daf0dc13770;p=cpPlugins.git diff --git a/lib/cpPlugins/Interface/Parameters.cxx b/lib/cpPlugins/Interface/Parameters.cxx index 1b23972..2e6d36c 100644 --- a/lib/cpPlugins/Interface/Parameters.cxx +++ b/lib/cpPlugins/Interface/Parameters.cxx @@ -2,8 +2,6 @@ #include #include -#include - // ------------------------------------------------------------------------- cpPlugins::Interface:: ProcessObject* cpPlugins::Interface::Parameters:: @@ -24,7 +22,12 @@ GetProcessObject( ) const void cpPlugins::Interface::Parameters:: SetProcessObject( ProcessObject* v ) { - this->m_Process = v; + if( this->m_Process != v ) + { + this->m_Process = v; + this->Modified( ); + + } // fi } // ------------------------------------------------------------------------- @@ -44,56 +47,9 @@ Clear( ) this->Modified( ); } -// ------------------------------------------------------------------------- -#define cpPlugins_Parameters_Configure( Y ) \ - void cpPlugins::Interface::Parameters:: \ - ConfigureAs##Y( const TString& name ) \ - { \ - this->m_Parameters[ name ] = TParameter( Self::Y, "" ); \ - this->Modified( ); \ - } - -cpPlugins_Parameters_Configure( String ); -cpPlugins_Parameters_Configure( Bool ); -cpPlugins_Parameters_Configure( Int ); -cpPlugins_Parameters_Configure( Uint ); -cpPlugins_Parameters_Configure( Real ); -cpPlugins_Parameters_Configure( Index ); -cpPlugins_Parameters_Configure( Point ); -cpPlugins_Parameters_Configure( Vector ); -cpPlugins_Parameters_Configure( StringList ); -cpPlugins_Parameters_Configure( BoolList ); -cpPlugins_Parameters_Configure( IntList ); -cpPlugins_Parameters_Configure( UintList ); -cpPlugins_Parameters_Configure( RealList ); -cpPlugins_Parameters_Configure( IndexList ); -cpPlugins_Parameters_Configure( PointList ); -cpPlugins_Parameters_Configure( VectorList ); -cpPlugins_Parameters_Configure( Choices ); - // ------------------------------------------------------------------------- void cpPlugins::Interface::Parameters:: -ConfigureAsChoices( - const TString& name, const std::vector< TString >& choices - ) -{ - // It is invalid not to give choices when configuring - if( choices.size( ) == 0 ) - return; - - std::stringstream str_choices; - str_choices << choices[ 0 ]; - for( unsigned int i = 1; i < choices.size( ); ++i ) - str_choices << "#" << choices[ i ]; - str_choices << "@"; - this->m_Parameters[ name ] = - TParameter( Self::Choices, str_choices.str( ) ); - this->Modified( ); -} - -// ------------------------------------------------------------------------- -void cpPlugins::Interface::Parameters:: -GetNames( std::vector< TString >& container ) const +GetNames( std::vector< std::string >& container ) const { container.clear( ); TParameters::const_iterator i = this->m_Parameters.begin( ); @@ -104,9 +60,9 @@ GetNames( std::vector< TString >& container ) const // ------------------------------------------------------------------------- cpPlugins::Interface::Parameters:: Type cpPlugins::Interface::Parameters:: -GetType( const TString& name ) const +GetType( const std::string& name ) const { - TParameters::const_iterator i = this->m_Parameters.find( name ); + auto i = this->m_Parameters.find( name ); if( i != this->m_Parameters.end( ) ) return( i->second.first ); else @@ -114,351 +70,225 @@ GetType( const TString& name ) const } // ------------------------------------------------------------------------- -#define cpPlugins_Parameters_Has( Y ) \ - bool cpPlugins::Interface::Parameters:: \ - Has##Y( const TString& name ) const \ - { \ - TParameters::const_iterator i = this->m_Parameters.find( name ); \ - if( i != this->m_Parameters.end( ) ) \ - return( i->second.first == Self::Y ); \ - else \ - return( false ); \ - } +#define cpPlugins_Parameters_TypeAsString( Y ) \ + if( i->second.first == Self::Y ) \ + return( #Y ) -cpPlugins_Parameters_Has( String ); -cpPlugins_Parameters_Has( Bool ); -cpPlugins_Parameters_Has( Int ); -cpPlugins_Parameters_Has( Uint ); -cpPlugins_Parameters_Has( Real ); -cpPlugins_Parameters_Has( Index ); -cpPlugins_Parameters_Has( Point ); -cpPlugins_Parameters_Has( Vector ); -cpPlugins_Parameters_Has( StringList ); -cpPlugins_Parameters_Has( BoolList ); -cpPlugins_Parameters_Has( IntList ); -cpPlugins_Parameters_Has( UintList ); -cpPlugins_Parameters_Has( RealList ); -cpPlugins_Parameters_Has( IndexList ); -cpPlugins_Parameters_Has( PointList ); -cpPlugins_Parameters_Has( VectorList ); -cpPlugins_Parameters_Has( Choices ); - -// ------------------------------------------------------------------------- -cpPlugins::Interface::Parameters:: -TString cpPlugins::Interface::Parameters:: -GetString( const TString& name, bool force ) const +std::string cpPlugins::Interface::Parameters:: +GetTypeAsString( const std::string& name ) const { - TParameters::const_iterator i = this->m_Parameters.find( name ); - if( i != this->m_Parameters.end( ) ) - { - if( i->second.first == Self::String || !force ) - return( i->second.second ); - - } // fi - return( "" ); + auto i = this->m_Parameters.find( name ); + cpPlugins_Parameters_TypeAsString( String ); + else cpPlugins_Parameters_TypeAsString( Bool ); + else cpPlugins_Parameters_TypeAsString( Int ); + else cpPlugins_Parameters_TypeAsString( Uint ); + else cpPlugins_Parameters_TypeAsString( Real ); + else cpPlugins_Parameters_TypeAsString( OpenFileName ); + else cpPlugins_Parameters_TypeAsString( SaveFileName ); + else cpPlugins_Parameters_TypeAsString( PathName ); + else cpPlugins_Parameters_TypeAsString( StringList ); + else cpPlugins_Parameters_TypeAsString( BoolList ); + else cpPlugins_Parameters_TypeAsString( IntList ); + else cpPlugins_Parameters_TypeAsString( UintList ); + else cpPlugins_Parameters_TypeAsString( RealList ); + else cpPlugins_Parameters_TypeAsString( OpenFileNameList ); + else cpPlugins_Parameters_TypeAsString( SaveFileNameList ); + else cpPlugins_Parameters_TypeAsString( PathNameList ); + else cpPlugins_Parameters_TypeAsString( Choices ); + else return( "NoType" ); } // ------------------------------------------------------------------------- -cpPlugins::Interface::Parameters:: -TBool cpPlugins::Interface::Parameters:: -GetBool( const TString& name ) const -{ - TParameters::const_iterator i = this->m_Parameters.find( name ); - if( i != this->m_Parameters.end( ) ) - { - if( i->second.first == Self::Bool ) - return( std::atoi( i->second.second.c_str( ) ) == 1 ); +#define cpPlugins_Parameters_TypeFromString( Y, str ) \ + if( str == std::string( #Y ) ) \ + return( Self::Y ) - } // fi - return( false ); -} - -// ------------------------------------------------------------------------- cpPlugins::Interface::Parameters:: -TInt cpPlugins::Interface::Parameters:: -GetInt( const TString& name ) const +Type cpPlugins::Interface::Parameters:: +GetTypeFromString( const std::string& t ) { - TParameters::const_iterator i = this->m_Parameters.find( name ); - if( i != this->m_Parameters.end( ) ) - { - if( i->second.first == Self::Int ) - return( TInt( std::atoi( i->second.second.c_str( ) ) ) ); - - } // fi - return( TInt( 0 ) ); + cpPlugins_Parameters_TypeFromString( String, t ); + else cpPlugins_Parameters_TypeFromString( Bool, t ); + else cpPlugins_Parameters_TypeFromString( Int, t ); + else cpPlugins_Parameters_TypeFromString( Uint, t ); + else cpPlugins_Parameters_TypeFromString( Real, t ); + else cpPlugins_Parameters_TypeFromString( OpenFileName, t ); + else cpPlugins_Parameters_TypeFromString( SaveFileName, t ); + else cpPlugins_Parameters_TypeFromString( PathName, t ); + else cpPlugins_Parameters_TypeFromString( StringList, t ); + else cpPlugins_Parameters_TypeFromString( BoolList, t ); + else cpPlugins_Parameters_TypeFromString( IntList, t ); + else cpPlugins_Parameters_TypeFromString( UintList, t ); + else cpPlugins_Parameters_TypeFromString( RealList, t ); + else cpPlugins_Parameters_TypeFromString( OpenFileNameList, t ); + else cpPlugins_Parameters_TypeFromString( SaveFileNameList, t ); + else cpPlugins_Parameters_TypeFromString( PathNameList, t ); + else cpPlugins_Parameters_TypeFromString( Choices, t ); + else return( Self::NoType ); } // ------------------------------------------------------------------------- -cpPlugins::Interface::Parameters:: -TUint cpPlugins::Interface::Parameters:: -GetUint( const TString& name ) const +std::string cpPlugins::Interface::Parameters:: +GetString( const std::string& name, bool force ) const { - TParameters::const_iterator i = this->m_Parameters.find( name ); + auto i = this->m_Parameters.find( name ); if( i != this->m_Parameters.end( ) ) { - if( i->second.first == Self::Uint ) - return( TUint( std::atoi( i->second.second.c_str( ) ) ) ); - - } // fi - return( TUint( 0 ) ); + if( i->second.first == Self::String || force ) + return( i->second.second ); + else + return( "" ); + } + else + return( "" ); } // ------------------------------------------------------------------------- -cpPlugins::Interface::Parameters:: -TReal cpPlugins::Interface::Parameters:: -GetReal( const TString& name ) const +void cpPlugins::Interface::Parameters:: +SetString( const std::string& name, const std::string& v, bool force ) { - TParameters::const_iterator i = this->m_Parameters.find( name ); + auto i = this->m_Parameters.find( name ); if( i != this->m_Parameters.end( ) ) { - if( i->second.first == Self::Real ) + if( i->second.first == Self::String || force ) { - std::istringstream tok_str( i->second.second ); - float v; - tok_str >> v; - return( TReal( v ) ); + if( i->second.second != v ) + { + i->second.second = v; + this->Modified( ); + + } // fi } // fi } // fi - return( TReal( 0 ) ); } // ------------------------------------------------------------------------- void cpPlugins::Interface::Parameters:: -GetStringList( std::vector< TString >& lst, const TString& name ) const +ConfigureAsChoices( + const std::string& name, const std::vector< std::string >& choices + ) { - lst.clear( ); - TParameters::const_iterator i = this->m_Parameters.find( name ); - if( i == this->m_Parameters.end( ) ) - return; - if( i->second.first != Self::StringList ) + // It is invalid not to give choices when configuring + if( choices.size( ) == 0 ) return; - std::istringstream str( i->second.second ); - std::string token; - while( std::getline( str, token, '#' ) ) - lst.push_back( token ); + std::stringstream str_choices; + str_choices << choices[ 0 ]; + for( unsigned int i = 1; i < choices.size( ); ++i ) + str_choices << "#" << choices[ i ]; + str_choices << "@"; + this->m_Parameters[ name ] = + TParameter( Self::Choices, str_choices.str( ) ); + this->Modified( ); } // ------------------------------------------------------------------------- -void cpPlugins::Interface::Parameters:: -GetBoolList( std::vector< TBool >& lst, const TString& name ) const +std::vector< std::string > cpPlugins::Interface::Parameters:: +GetChoices( const std::string& name ) const { - lst.clear( ); - TParameters::const_iterator i = this->m_Parameters.find( name ); - if( i == this->m_Parameters.end( ) ) - return; - if( i->second.first != Self::BoolList ) - return; + std::vector< std::string > choices; - std::istringstream str( i->second.second ); - std::string token; - while( std::getline( str, token, '#' ) ) - lst.push_back( std::atoi( token.c_str( ) ) == 1 ); -} - -// ------------------------------------------------------------------------- -void cpPlugins::Interface::Parameters:: -GetIntList( std::vector< TInt >& lst, const TString& name ) const -{ - lst.clear( ); TParameters::const_iterator i = this->m_Parameters.find( name ); - if( i == this->m_Parameters.end( ) ) - return; - if( i->second.first != Self::IntList ) - return; - - std::istringstream str( i->second.second ); - std::string token; - while( std::getline( str, token, '#' ) ) - lst.push_back( TInt( std::atoi( token.c_str( ) ) ) ); -} + if( i != this->m_Parameters.end( ) ) + { + if( i->second.first == Self::Choices ) + { + std::istringstream str_choices( i->second.second ); + std::string real_choices; + std::getline( str_choices, real_choices, '@' ); + std::istringstream str( real_choices ); + std::string token; + while( std::getline( str, token, '#' ) ) + choices.push_back( token ); -// ------------------------------------------------------------------------- -void cpPlugins::Interface::Parameters:: -GetUintList( std::vector< TUint >& lst, const TString& name ) const -{ - lst.clear( ); - TParameters::const_iterator i = this->m_Parameters.find( name ); - if( i == this->m_Parameters.end( ) ) - return; - if( i->second.first != Self::UintList ) - return; + } // fi - std::istringstream str( i->second.second ); - std::string token; - while( std::getline( str, token, '#' ) ) - lst.push_back( TUint( std::atoi( token.c_str( ) ) ) ); + } // fi + return( choices ); } // ------------------------------------------------------------------------- -void cpPlugins::Interface::Parameters:: -GetRealList( std::vector< TReal >& lst, const TString& name ) const +std::string cpPlugins::Interface::Parameters:: +GetSelectedChoice( const std::string& name ) const { - lst.clear( ); - TParameters::const_iterator i = this->m_Parameters.find( name ); - if( i == this->m_Parameters.end( ) ) - return; - if( i->second.first != Self::RealList ) - return; - - std::istringstream str( i->second.second ); - std::string token; - while( std::getline( str, token, '#' ) ) + auto i = this->m_Parameters.find( name ); + if( i != this->m_Parameters.end( ) ) { - std::istringstream tok_str( token ); - float v; - tok_str >> v; - lst.push_back( TReal( v ) ); - - } // elihw + if( i->second.first == Self::Choices ) + { + std::istringstream str_choices( i->second.second ); + std::string real_choice; + std::getline( str_choices, real_choice, '@' ); + std::getline( str_choices, real_choice, '@' ); + return( real_choice ); + } + else + return( "" ); + } + else + return( "" ); } // ------------------------------------------------------------------------- -void cpPlugins::Interface::Parameters:: -GetChoices( std::vector< TString >& choices, const TString& name ) const +bool cpPlugins::Interface::Parameters:: +SetSelectedChoice( const std::string& name, const std::string& choice ) { - choices.clear( ); - TParameters::const_iterator i = this->m_Parameters.find( name ); - if( i == this->m_Parameters.end( ) ) - return; - if( i->second.first != Self::Choices ) - return; - - std::istringstream str_choices( i->second.second ); - std::string real_choices; - std::getline( str_choices, real_choices, '@' ); - std::istringstream str( real_choices ); - std::string token; - while( std::getline( str, token, '#' ) ) - choices.push_back( token ); + auto i = this->m_Parameters.find( name ); + if( i != this->m_Parameters.end( ) ) + { + if( i->second.first == Self::Choices ) + { + std::istringstream str_choices( i->second.second ); + std::string choices; + std::getline( str_choices, choices, '@' ); + if( choices.find( choice ) != std::string::npos ) + { + std::stringstream new_choices; + new_choices << choices << "@" << choice; + i->second.second = new_choices.str( ); + this->Modified( ); + return( true ); + } + else + return( false ); + } + else + return( false ); + } + else + return( false ); } // ------------------------------------------------------------------------- -cpPlugins::Interface::Parameters:: -TString cpPlugins::Interface::Parameters:: -GetSelectedChoice( const TString& name ) const +std::string cpPlugins::Interface::Parameters:: +GetAcceptedFileExtensions( const std::string& name ) const { - TParameters::const_iterator i = this->m_Parameters.find( name ); - if( i == this->m_Parameters.end( ) ) - return( "" ); - if( i->second.first != Self::Choices ) + auto i = this->m_AcceptedFileExtensions.find( name ); + if( i != this->m_AcceptedFileExtensions.end( ) ) + return( i->second ); + else return( "" ); - - std::istringstream str_choices( i->second.second ); - std::string real_choice; - std::getline( str_choices, real_choice, '@' ); - std::getline( str_choices, real_choice, '@' ); - return( real_choice ); } // ------------------------------------------------------------------------- void cpPlugins::Interface::Parameters:: -SetString( const TString& name, const TString& v, bool force ) -{ - TParameters::iterator i = this->m_Parameters.find( name ); - if( i == this->m_Parameters.end( ) ) - return; - if( i->second.first != Self::String && force ) - return; - i->second.second = v; - this->Modified( ); -} - -// ------------------------------------------------------------------------- -#define cpPlugins_Parameters_Set( Y ) \ - void cpPlugins::Interface::Parameters:: \ - Set##Y( const TString& name, const T##Y& v ) \ - { \ - TParameters::iterator i = this->m_Parameters.find( name ); \ - if( i == this->m_Parameters.end( ) ) \ - return; \ - if( i->second.first != Self::Y ) \ - return; \ - std::stringstream str; \ - str << v; \ - i->second.second = str.str( ); \ - this->Modified( ); \ - } - -cpPlugins_Parameters_Set( Bool ); -cpPlugins_Parameters_Set( Int ); -cpPlugins_Parameters_Set( Uint ); -cpPlugins_Parameters_Set( Real ); - -// ------------------------------------------------------------------------- -#define cpPlugins_Parameters_Add( Y ) \ - void cpPlugins::Interface::Parameters:: \ - AddTo##Y##List( const TString& name, const T##Y& v ) \ - { \ - TParameters::iterator i = this->m_Parameters.find( name ); \ - if( i == this->m_Parameters.end( ) ) \ - return; \ - if( i->second.first != Self::Y##List ) \ - return; \ - std::stringstream str; \ - if( i->second.second == "" ) \ - str << v; \ - else \ - str << "#" << v; \ - i->second.second += str.str( ); \ - this->Modified( ); \ - } - -cpPlugins_Parameters_Add( String ); -cpPlugins_Parameters_Add( Bool ); -cpPlugins_Parameters_Add( Int ); -cpPlugins_Parameters_Add( Uint ); -cpPlugins_Parameters_Add( Real ); - -// ------------------------------------------------------------------------- -#define cpPlugins_Parameters_Clear( Y ) \ - void cpPlugins::Interface::Parameters:: \ - Clear##Y##List( const TString& name ) \ - { \ - TParameters::iterator i = this->m_Parameters.find( name ); \ - if( i == this->m_Parameters.end( ) ) \ - return; \ - if( i->second.first != Self::Y##List ) \ - return; \ - i->second.second = ""; \ - this->Modified( ); \ - } - -cpPlugins_Parameters_Clear( String ); -cpPlugins_Parameters_Clear( Bool ); -cpPlugins_Parameters_Clear( Int ); -cpPlugins_Parameters_Clear( Uint ); -cpPlugins_Parameters_Clear( Real ); -cpPlugins_Parameters_Clear( Index ); -cpPlugins_Parameters_Clear( Point ); -cpPlugins_Parameters_Clear( Vector ); - -// ------------------------------------------------------------------------- -bool cpPlugins::Interface::Parameters:: -SetSelectedChoice( const TString& name, const TString& choice ) +SetAcceptedFileExtensions( + const std::string& name, const std::string& extensions + ) { - TParameters::iterator i = this->m_Parameters.find( name ); - if( i == this->m_Parameters.end( ) ) - return( false ); - if( i->second.first != Self::Choices ) - return( false ); - - std::vector< TString > c; - this->GetChoices( c, name ); - if( std::find( c.begin( ), c.end( ), choice ) != c.end( ) ) + auto i = this->m_Parameters.find( name ); + if( i != this->m_Parameters.end( ) ) { - std::istringstream str_choices( i->second.second ); - std::string choices; - std::getline( str_choices, choices, '@' ); - std::stringstream new_choices; - new_choices << choices << "@" << choice; - i->second.second = new_choices.str( ); - return( true ); - } - else - return( false ); + bool is_valid = ( i->second.first == Self::OpenFileName ); + is_valid |= ( i->second.first == Self::SaveFileName ); + is_valid |= ( i->second.first == Self::OpenFileNameList ); + is_valid |= ( i->second.first == Self::SaveFileNameList ); + if( is_valid ) + this->m_AcceptedFileExtensions[ name ] = extensions; + + } // fi } // ------------------------------------------------------------------------- @@ -474,40 +304,7 @@ ToXML( TiXmlElement* parent_elem ) const TiXmlElement* p = new TiXmlElement( "parameter" ); p->SetAttribute( "name", pIt->first.c_str( ) ); p->SetAttribute( "value", pIt->second.second.c_str( ) ); - if( pIt->second.first == Self::String ) - p->SetAttribute( "type", "String" ); - else if( pIt->second.first == Self::Bool ) - p->SetAttribute( "type", "Bool" ); - else if( pIt->second.first == Self::Int ) - p->SetAttribute( "type", "Int" ); - else if( pIt->second.first == Self::Uint ) - p->SetAttribute( "type", "Uint" ); - else if( pIt->second.first == Self::Real ) - p->SetAttribute( "type", "Real" ); - else if( pIt->second.first == Self::Index ) - p->SetAttribute( "type", "Index" ); - else if( pIt->second.first == Self::Point ) - p->SetAttribute( "type", "Point" ); - else if( pIt->second.first == Self::Vector ) - p->SetAttribute( "type", "Vector" ); - else if( pIt->second.first == Self::StringList ) - p->SetAttribute( "type", "StringList" ); - else if( pIt->second.first == Self::BoolList ) - p->SetAttribute( "type", "BoolList" ); - else if( pIt->second.first == Self::IntList ) - p->SetAttribute( "type", "IntList" ); - else if( pIt->second.first == Self::UintList ) - p->SetAttribute( "type", "UintList" ); - else if( pIt->second.first == Self::RealList ) - p->SetAttribute( "type", "RealList" ); - else if( pIt->second.first == Self::IndexList ) - p->SetAttribute( "type", "IndexList" ); - else if( pIt->second.first == Self::PointList ) - p->SetAttribute( "type", "PointList" ); - else if( pIt->second.first == Self::VectorList ) - p->SetAttribute( "type", "VectorList" ); - else if( pIt->second.first == Self::Choices ) - p->SetAttribute( "type", "Choices" ); + p->SetAttribute( "type", this->GetTypeAsString( pIt->first ).c_str( ) ); parent_elem->LinkEndChild( p ); } // rof @@ -518,8 +315,6 @@ ToXML( TiXmlElement* parent_elem ) const bool cpPlugins::Interface::Parameters:: FromXML( const TiXmlElement* filter_elem ) { - this->m_Parameters.clear( ); - const TiXmlElement* param = filter_elem->FirstChildElement( "parameter" ); bool ret = false; while( param != NULL ) @@ -530,43 +325,7 @@ FromXML( const TiXmlElement* filter_elem ) { TParameter value; value.second = param->Attribute( "value" ); - - std::string param_type_str( param_type ); - if( param_type_str == "Bool" ) - value.first = Self::Bool; - else if( param_type_str == "Int" ) - value.first = Self::Int; - else if( param_type_str == "Uint" ) - value.first = Self::Uint; - else if( param_type_str == "Real" ) - value.first = Self::Real; - else if( param_type_str == "Index" ) - value.first = Self::Index; - else if( param_type_str == "Point" ) - value.first = Self::Point; - else if( param_type_str == "Vector" ) - value.first = Self::Vector; - else if( param_type_str == "StringList" ) - value.first = Self::StringList; - else if( param_type_str == "BoolList" ) - value.first = Self::BoolList; - else if( param_type_str == "IntList" ) - value.first = Self::IntList; - else if( param_type_str == "UintList" ) - value.first = Self::UintList; - else if( param_type_str == "RealList" ) - value.first = Self::RealList; - else if( param_type_str == "IndexList" ) - value.first = Self::IndexList; - else if( param_type_str == "PointList" ) - value.first = Self::PointList; - else if( param_type_str == "VectorList" ) - value.first = Self::VectorList; - else if( param_type_str == "Choices" ) - value.first = Self::Choices; - else - value.first = Self::String; - + value.first = Self::GetTypeFromString( param_type ); this->m_Parameters[ param_name ] = value; } // fi @@ -574,6 +333,7 @@ FromXML( const TiXmlElement* filter_elem ) ret = true; } // elihw + this->Modified( ); return( ret ); } @@ -605,4 +365,20 @@ PrintSelf( std::ostream& os, itk::Indent indent ) const << std::endl; } +// ------------------------------------------------------------------------- +cpPlugins::Interface::Parameters:: +TParameters& cpPlugins::Interface::Parameters:: +GetRawParameters( ) +{ + return( this->m_Parameters ); +} + +// ------------------------------------------------------------------------- +const cpPlugins::Interface::Parameters:: +TParameters& cpPlugins::Interface::Parameters:: +GetRawParameters( ) const +{ + return( this->m_Parameters ); +} + // eof - $RCSfile$