1 // =========================================================================
2 // @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
3 // =========================================================================
6 #include <cpPlugins/Filter.h>
7 #include <cpPlugins/Pipeline.h>
9 int main( int argc, char* argv[] )
13 std::cerr << "Usage: " << argv[ 0 ] << " input output" << std::endl;
19 typedef cpPlugins::Pipeline TPipeline;
21 TPipeline::SharedPtr pipeline = TPipeline::New( );
23 cpPlugins::Filter* r1 =
24 pipeline->CreateNode( "cpPluginsBase::RawFileReader", "r1" )->
25 Cast< cpPlugins::Filter >( );
27 cpPlugins::Filter* r2 =
28 pipeline->CreateNode( "cpPluginsBase::RawFileReader", "r2" )->
29 Cast< cpPlugins::Filter >( );
31 cpPlugins::Filter* r3 =
32 pipeline->CreateNode( "cpPluginsBase::RawFileReader", "r3" )->
33 Cast< cpPlugins::Filter >( );
35 cpPlugins::Filter* r4 =
36 pipeline->CreateNode( "cpPluginsBase::RawFileReader", "r4" )->
37 Cast< cpPlugins::Filter >( );
39 cpPlugins::Filter* r5 =
40 pipeline->CreateNode( "cpPluginsBase::RawFileReader", "r5" )->
41 Cast< cpPlugins::Filter >( );
43 cpPlugins::Filter* a1 =
44 pipeline->CreateNode( "cpPluginsBase::AppendRawDataFilter", "a1" )->
45 Cast< cpPlugins::Filter >( );
47 cpPlugins::Filter* a2 =
48 pipeline->CreateNode( "cpPluginsBase::AppendRawDataFilter", "a2" )->
49 Cast< cpPlugins::Filter >( );
51 cpPlugins::Filter* a3 =
52 pipeline->CreateNode( "cpPluginsBase::AppendRawDataFilter", "a3" )->
53 Cast< cpPlugins::Filter >( );
55 cpPlugins::Filter* w =
56 pipeline->CreateNode( "cpPluginsBase::RawFileWriter", "w" )->
57 Cast< cpPlugins::Filter >( );
59 a1->SetInput( "Input", r1->GetOutput( "Output" ) );
60 a1->SetInput( "Input", r2->GetOutput( "Output" ) );
62 a2->SetInput( "Input", a1->GetOutput( "Output" ) );
63 a2->SetInput( "Input", r3->GetOutput( "Output" ) );
64 a2->SetInput( "Input", r4->GetOutput( "Output" ) );
66 a3->SetInput( "Input", a2->GetOutput( "Output" ) );
67 a3->SetInput( "Input", r5->GetOutput( "Output" ) );
69 w->SetInput( "Input", a3->GetOutput( "Output" ) );
71 r1->SetInValue( "FileName", std::string( argv[ 1 ] ) );
72 r2->SetInValue( "FileName", std::string( argv[ 2 ] ) );
73 r3->SetInValue( "FileName", std::string( argv[ 3 ] ) );
74 r4->SetInValue( "FileName", std::string( argv[ 4 ] ) );
75 r5->SetInValue( "FileName", std::string( argv[ 5 ] ) );
76 w->SetInValue( "FileName", std::string( argv[ 6 ] ) );
80 catch( std::exception& err )
82 std::cerr << "ERROR CAUGHT: " << err.what( ) << std::endl;