2 #include <cpPlugins/Interface/Plugins.h>
4 int main( int argc, char* argv[] )
7 typedef cpPlugins::Interface::Plugins _TPlugins;
9 // Load an interface to the plugins system
10 _TPlugins::Pointer plugins = _TPlugins::New( );
14 // Guess reachable plugins
15 plugins->GuessPlugins( );
17 // Create cylinder source
18 auto source = plugins->CreateFilter( "MeshSources", "CylinderSource" );
19 source->GetParameters( )->SetReal( "Height", 10 );
20 source->GetParameters( )->SetReal( "Radius", 2 );
21 source->GetParameters( )->SetUint( "Resolution", 80 );
24 auto writer = plugins->CreateFilter( "IO", "MeshWriter" );
25 writer->SetInput( "Input", source->GetOutput( "Output" ) );
26 writer->GetParameters( )->SetSaveFileName( "FileName", "cylinder.vtk" );
31 catch( std::exception& err )
33 std::cerr << "Error: " << err.what( ) << std::endl;