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 std::string dimensions = 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 TProcessObject::TParameters TParameters;
35 cpPlugins::Interface::ProcessObject* reader;
38 dynamic_cast< TProcessObject* >(
39 plugins.CreateObject( "cpPlugins::Plugins::MeshReader" )
43 std::cerr << "No suitable reader found in plugins." << std::endl;
49 TParameters reader_params = reader->GetDefaultParameters( );
50 reader_params[ "FileName" ].second = input_mesh_file;
51 reader_params[ "PixelType" ].second = pixel_type;
52 reader_params[ "MeshDimension" ].second = dimensions;
53 reader->SetParameters( reader_params );
56 std::string msg = reader->Update( );
59 std::cerr << "ERROR: " << msg << std::endl;