+ while( std::getline( str, token, '#' ) )
+ {
+ std::istringstream tok_str( token );
+ float v;
+ tok_str >> v;
+ lst.push_back( TReal( v ) );
+
+ } // elihw
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::Interface::Parameters::
+GetChoices( std::vector< TString >& choices, const TString& name ) const
+{
+ 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( i->second.second.first );
+ std::string token;
+ while( std::getline( str, token, '#' ) )
+ choices.push_back( token );
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Interface::Parameters::
+TString cpPlugins::Interface::Parameters::
+GetSelectedChoice( const TString& name ) const
+{
+ TParameters::const_iterator i = this->m_Parameters.find( name );
+ if( i == this->m_Parameters.end( ) )
+ return( "" );
+ if( i->second.first != Self::Choices )
+ return( "" );
+ return( i->second.second.second );
+}
+
+// -------------------------------------------------------------------------
+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.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.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.second == "" ) \
+ str << v; \
+ else \
+ str << "#" << v; \
+ i->second.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.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 )
+{
+ TParameters::iterator i = this->m_Parameters.find( name );
+ if( i == this->m_Parameters.end( ) )
+ return( false );
+ if( i->second.first != Self::Choices )
+ return( false );
+ if( i->second.second.first.find( choice ) != std::string::npos )
+ {
+ i->second.second.second = choice;
+ this->Modified( );
+ return( true );
+ }
+ else
+ return( false );
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Interface::Parameters::
+Parameters( )
+ : Superclass( ),
+ m_Process( NULL )
+{
+ this->Clear( );
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Interface::Parameters::
+~Parameters( )
+{
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::Interface::Parameters::
+PrintSelf( std::ostream& os, itk::Indent indent ) const
+{
+ TParameters::const_iterator i = this->m_Parameters.begin( );
+ for( ; i != this->m_Parameters.end( ); ++i )
+ os << indent
+ << i->first << ": ("
+ << i->second.first << " | "
+ << i->second.second.first << " | "
+ << i->second.second.second << ")"
+ << std::endl;