comparison Applications/Samples/TestPatternApplication.h @ 235:ce4405d98b92 am

Added SimpleViewerApplication (working in SDL)
author am@osimis.io
date Tue, 19 Jun 2018 16:02:41 +0200
parents fccffbf99ba1
children b70e9be013e4
comparison
equal deleted inserted replaced
234:9afb50d1ac14 235:ce4405d98b92
32 namespace Samples 32 namespace Samples
33 { 33 {
34 class TestPatternApplication : public SampleApplicationBase 34 class TestPatternApplication : public SampleApplicationBase
35 { 35 {
36 public: 36 public:
37 virtual void DeclareCommandLineOptions(boost::program_options::options_description& options) 37 virtual void DeclareStartupOptions(boost::program_options::options_description& options)
38 { 38 {
39 boost::program_options::options_description generic("Sample options"); 39 boost::program_options::options_description generic("Sample options");
40 generic.add_options() 40 generic.add_options()
41 ("animate", boost::program_options::value<bool>()->default_value(true), "Animate the test pattern") 41 ("animate", boost::program_options::value<bool>()->default_value(true), "Animate the test pattern")
42 ; 42 ;
43 43
44 options.add(generic); 44 options.add(generic);
45 } 45 }
46 46
47 virtual void Initialize(BasicApplicationContext& context, 47 virtual void Initialize(IStatusBar& statusBar,
48 IStatusBar& statusBar,
49 const boost::program_options::variables_map& parameters) 48 const boost::program_options::variables_map& parameters)
50 { 49 {
51 using namespace OrthancStone; 50 using namespace OrthancStone;
52 51
53 std::auto_ptr<LayoutWidget> layout(new LayoutWidget); 52 std::auto_ptr<LayoutWidget> layout(new LayoutWidget);
54 layout->SetPadding(10); 53 layout->SetPadding(10);
55 layout->SetBackgroundCleared(true); 54 layout->SetBackgroundCleared(true);
56 layout->AddWidget(new TestCairoWidget(parameters["animate"].as<bool>())); 55 layout->AddWidget(new TestCairoWidget(parameters["animate"].as<bool>()));
57 layout->AddWidget(new TestWorldSceneWidget(parameters["animate"].as<bool>())); 56 layout->AddWidget(new TestWorldSceneWidget(parameters["animate"].as<bool>()));
58 57
59 context.SetCentralWidget(layout.release()); 58 context_->SetCentralWidget(layout.release());
60 context.SetUpdateDelay(25); // If animation, update the content each 25ms 59 context_->SetUpdateDelay(25); // If animation, update the content each 25ms
61 } 60 }
62 }; 61 };
63 } 62 }
64 } 63 }