+#include <cstdlib>
+#include <iostream>
+#include <string>
+
+#include <cpPlugins/Interface/Interface.h>
+#include <cpPlugins/Interface/ProcessObject.h>
+
+// -------------------------------------------------------------------------
+typedef cpPlugins::Interface::Interface TInterface;
+typedef cpPlugins::Interface::ProcessObject TFilter;
+
+// -------------------------------------------------------------------------
+int main( int argc, char* argv[] )
+{
+ if( argc < 6 )
+ {
+ std::cerr
+ << "Usage: " << argv[ 0 ]
+ << " plugins_dir"
+ << " radius phi_res theta_res output_mesh" << std::endl;
+ return( 1 );
+
+ } // fi
+
+ // Create interface and load plugins
+ TInterface interface;
+ if( interface.LoadFromFolder( argv[ 1 ], true ) )
+ {
+ TFilter::Pointer source =
+ interface.CreateObject( "cpPlugins::BasicFilters::SphereMeshSource" );
+ TFilter::Pointer writer =
+ interface.CreateObject( "cpPlugins::IO::MeshWriter" );
+
+ // Configure source
+ source->GetParameters( )->SetString( "Radius", argv[ 2 ], true );
+ source->GetParameters( )->SetString( "PhiResolution", argv[ 3 ], true );
+ source->GetParameters( )->SetString( "ThetaResolution", argv[ 4 ], true );
+
+ // Configure writer
+ writer->GetParameters( )->SetString( "FileName", argv[ 5 ], true );
+
+ // Connect filters
+ writer->SetInput( "Input", source->GetOutput( "Output" ) );
+
+ // Execute pipeline
+ std::cout << "Error: \"" << writer->Update( ) << "\"" << std::endl;
+ }
+ else
+ std::cerr << "No plugins found." << std::endl;
+
+ return( 0 );
+}
+
+// eof - $RCSfile$