comparison Samples/Sdl/TrackerSample.cpp @ 660:cb3b76d16234

Added info display map to the app + global logging function + fixed bisecting algo to display angle measure text label
author Benjamin Golinvaux <bgo@osimis.io>
date Tue, 14 May 2019 19:38:51 +0200
parents 002d9562c8f5
children 07adcffba38c
comparison
equal deleted inserted replaced
659:68b5688241d5 660:cb3b76d16234
53 using namespace OrthancStone; 53 using namespace OrthancStone;
54 54
55 55
56 56
57 57
58 boost::weak_ptr<TrackerSampleApp> g_app;
58 59
60 void TrackerSample_SetInfoDisplayMessage(std::string key, std::string value)
61 {
62 boost::shared_ptr<TrackerSampleApp> app = g_app.lock();
63 if (app)
64 {
65 app->SetInfoDisplayMessage(key, value);
66 }
67 }
59 68
60 /** 69 /**
61 * IMPORTANT: The full arguments to "main()" are needed for SDL on 70 * IMPORTANT: The full arguments to "main()" are needed for SDL on
62 * Windows. Otherwise, one gets the linking error "undefined reference 71 * Windows. Otherwise, one gets the linking error "undefined reference
63 * to `SDL_main'". https://wiki.libsdl.org/FAQWindows 72 * to `SDL_main'". https://wiki.libsdl.org/FAQWindows
66 { 75 {
67 StoneInitialize(); 76 StoneInitialize();
68 Orthanc::Logging::EnableInfoLevel(true); 77 Orthanc::Logging::EnableInfoLevel(true);
69 Orthanc::Logging::EnableTraceLevel(true); 78 Orthanc::Logging::EnableTraceLevel(true);
70 79
71
72 try 80 try
73 { 81 {
74 MessageBroker broker; 82 MessageBroker broker;
75 TrackerSampleApp app(broker); 83 boost::shared_ptr<TrackerSampleApp> app(new TrackerSampleApp(broker));
76 app.PrepareScene(); 84 g_app = app;
77 app.Run(); 85 app->PrepareScene();
86 app->Run();
78 } 87 }
79 catch (Orthanc::OrthancException& e) 88 catch (Orthanc::OrthancException& e)
80 { 89 {
81 LOG(ERROR) << "EXCEPTION: " << e.What(); 90 LOG(ERROR) << "EXCEPTION: " << e.What();
82 } 91 }
83 92
84 StoneFinalize(); 93 StoneFinalize();
85 94
86 return 0; 95 return 0;
87 } 96 }
97
98