5 #include <cpPlugins/Interface/Interface.h>
6 #include <cpPlugins/Interface/ProcessObject.h>
8 // -------------------------------------------------------------------------
9 typedef cpPlugins::Interface::Interface TInterface;
10 typedef cpPlugins::Interface::ProcessObject TFilter;
12 // -------------------------------------------------------------------------
13 int main( int argc, char* argv[] )
18 << "Usage: " << argv[ 0 ]
20 << " radius phi_res theta_res output_mesh" << std::endl;
25 // Create interface and load plugins
27 if( interface.LoadFromFolder( argv[ 1 ], true ) )
29 TFilter::Pointer source =
30 interface.CreateObject( "cpPlugins::BasicFilters::SphereMeshSource" );
31 TFilter::Pointer writer =
32 interface.CreateObject( "cpPlugins::IO::MeshWriter" );
35 source->GetParameters( )->SetString( "Radius", argv[ 2 ], true );
36 source->GetParameters( )->SetString( "PhiResolution", argv[ 3 ], true );
37 source->GetParameters( )->SetString( "ThetaResolution", argv[ 4 ], true );
40 writer->GetParameters( )->SetString( "FileName", argv[ 5 ], true );
43 writer->SetInput( "Input", source->GetOutput( "Output" ) );
46 std::cout << "Error: \"" << writer->Update( ) << "\"" << std::endl;
49 std::cerr << "No plugins found." << std::endl;