5 #include <cpPlugins/Interface/Interface.h>
6 #include <cpPlugins/Interface/ProcessObject.h>
8 int main( int argc, char* argv[] )
13 << "Usage: " << argv[ 0 ]
16 << " dimensions pixel_type" << std::endl;
20 std::string plugins_file = argv[ 1 ];
21 std::string input_mesh_file = argv[ 2 ];
22 unsigned int dimensions = std::atoi( argv[ 3 ] );
23 std::string pixel_type = argv[ 4 ];
26 typedef cpPlugins::Interface::Interface TInterface;
27 typedef TInterface::TClasses TClasses;
30 plugins.Load( plugins_file );
33 typedef cpPlugins::Interface::ProcessObject TProcessObject;
34 typedef cpPlugins::Interface::Parameters TParameters;
35 cpPlugins::Interface::ProcessObject::Pointer reader;
37 reader = plugins.CreateProcessObject( "cpPlugins::Plugins::MeshReader" );
38 if( reader.IsNull( ) )
40 std::cerr << "No suitable reader found in plugins." << std::endl;
46 TParameters reader_params = reader->GetDefaultParameters( );
47 reader_params.SetValueAsString( "FileName", input_mesh_file );
48 reader_params.SetValueAsString( "PixelType", pixel_type );
49 reader_params.SetValueAsUint( "MeshDimension", dimensions );
50 reader->SetParameters( reader_params );
53 std::string msg = reader->Update( );
56 std::cerr << "ERROR: " << msg << std::endl;