X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpPlugins%2FBaseObjects%2FParameters.cxx;h=4025461f345cc060d294880281c3c9f9b4d989f3;hb=80ac2c55630c2a345a2102f0be86843147a398cc;hp=88a82af798f2952b74d52c78149d198cfa1d236e;hpb=19cba47f3c180c79b04fb4db2784434bfe16d2b9;p=cpPlugins.git diff --git a/lib/cpPlugins/BaseObjects/Parameters.cxx b/lib/cpPlugins/BaseObjects/Parameters.cxx index 88a82af..4025461 100644 --- a/lib/cpPlugins/BaseObjects/Parameters.cxx +++ b/lib/cpPlugins/BaseObjects/Parameters.cxx @@ -1,10 +1,12 @@ #include -#include +#include +#include #include // ------------------------------------------------------------------------- cpPlugins::BaseObjects::Parameters:: Parameters( ) + : m_ProcessObject( NULL ) { this->Clear( ); } @@ -15,18 +17,34 @@ cpPlugins::BaseObjects::Parameters:: { } +// ------------------------------------------------------------------------- +cpPlugins::BaseObjects::ProcessObject* cpPlugins::BaseObjects::Parameters:: +GetProcessObject( ) +{ + return( this->m_ProcessObject ); +} + +// ------------------------------------------------------------------------- +const +cpPlugins::BaseObjects::ProcessObject* cpPlugins::BaseObjects::Parameters:: +GetProcessObject( ) const +{ + return( this->m_ProcessObject ); +} + // ------------------------------------------------------------------------- void cpPlugins::BaseObjects::Parameters:: -Modified( ) const +SetProcessObject( cpPlugins::BaseObjects::ProcessObject* po ) { - this->m_TimeStamp.Modified( ); + this->m_ProcessObject = po; } // ------------------------------------------------------------------------- -itk::ModifiedTimeType cpPlugins::BaseObjects::Parameters:: -GetMTime( ) const +void cpPlugins::BaseObjects::Parameters:: +Modified( ) const { - return( this->m_TimeStamp.GetMTime( ) ); + if( this->m_ProcessObject != NULL ) + this->m_ProcessObject->Modified( ); } // ------------------------------------------------------------------------- @@ -179,13 +197,10 @@ void cpPlugins::BaseObjects::Parameters:: ConfigureAsRealTypesChoices( const std::string& name ) { std::vector< std::string > choices; -#ifdef cpPlugins_CONFIG_REAL_TYPES_float choices.push_back( "float" ); -#endif // cpPlugins_CONFIG_REAL_TYPES_float -#ifdef cpPlugins_CONFIG_REAL_TYPES_double choices.push_back( "double" ); -#endif // cpPlugins_CONFIG_REAL_TYPES_double this->ConfigureAsChoices( name, choices ); + this->SetSelectedChoice( name, "float" ); } // ------------------------------------------------------------------------- @@ -193,29 +208,16 @@ void cpPlugins::BaseObjects::Parameters:: ConfigureAsIntTypesChoices( const std::string& name ) { std::vector< std::string > choices; -#ifdef cpPlugins_CONFIG_INTEGER_TYPES_char choices.push_back( "char" ); choices.push_back( "uchar" ); -#endif // cpPlugins_CONFIG_INTEGER_TYPES_char -#ifdef cpPlugins_CONFIG_INTEGER_TYPES_short choices.push_back( "short" ); choices.push_back( "ushort" ); -#endif // cpPlugins_CONFIG_INTEGER_TYPES_short -#ifdef cpPlugins_CONFIG_INTEGER_TYPES_int choices.push_back( "int" ); choices.push_back( "uint" ); -#endif // cpPlugins_CONFIG_INTEGER_TYPES_int -#ifdef cpPlugins_CONFIG_INTEGER_TYPES_long choices.push_back( "long" ); choices.push_back( "ulong" ); -#endif // cpPlugins_CONFIG_INTEGER_TYPES_long -#ifdef cpPlugins_CONFIG_REAL_TYPES_float - choices.push_back( "float" ); -#endif // cpPlugins_CONFIG_REAL_TYPES_float -#ifdef cpPlugins_CONFIG_REAL_TYPES_double - choices.push_back( "double" ); -#endif // cpPlugins_CONFIG_REAL_TYPES_double this->ConfigureAsChoices( name, choices ); + this->SetSelectedChoice( name, "char" ); } // ------------------------------------------------------------------------- @@ -223,23 +225,18 @@ void cpPlugins::BaseObjects::Parameters:: ConfigureAsScalarTypesChoices( const std::string& name ) { std::vector< std::string > choices; -#ifdef cpPlugins_CONFIG_INTEGER_TYPES_char choices.push_back( "char" ); choices.push_back( "uchar" ); -#endif // cpPlugins_CONFIG_INTEGER_TYPES_char -#ifdef cpPlugins_CONFIG_INTEGER_TYPES_short choices.push_back( "short" ); choices.push_back( "ushort" ); -#endif // cpPlugins_CONFIG_INTEGER_TYPES_short -#ifdef cpPlugins_CONFIG_INTEGER_TYPES_int choices.push_back( "int" ); choices.push_back( "uint" ); -#endif // cpPlugins_CONFIG_INTEGER_TYPES_int -#ifdef cpPlugins_CONFIG_INTEGER_TYPES_long choices.push_back( "long" ); choices.push_back( "ulong" ); -#endif // cpPlugins_CONFIG_INTEGER_TYPES_long + choices.push_back( "float" ); + choices.push_back( "double" ); this->ConfigureAsChoices( name, choices ); + this->SetSelectedChoice( name, "char" ); } // ------------------------------------------------------------------------- @@ -678,7 +675,7 @@ _GetList( const std::string& name ) const if( i->second.first == ( Self::Type )( _Enum ) ) { std::vector< std::string > tokens; - cpExtensions::Tokenize( tokens, i->second.second, "#" ); + cpPlugins::Tokenize( tokens, i->second.second, "#" ); for( auto t = tokens.begin( ); t != tokens.end( ); ++t ) { if( typeid( _Type ) != typeid( std::string ) )