comparison Applications/Samples/SimpleViewerApplicationSingleFile.h @ 365:ef31240a73f6 am-2

no automatic call to moc and uic, CircleMeasureTracker using Orthanc fonts
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 31 Oct 2018 18:10:29 +0100
parents 885f0a5eaa49
children a7de01c8fd29
comparison
equal deleted inserted replaced
364:aad2f9293089 365:ef31240a73f6
34 #if ORTHANC_ENABLE_WASM==1 34 #if ORTHANC_ENABLE_WASM==1
35 #include "../../Platforms/Wasm/WasmPlatformApplicationAdapter.h" 35 #include "../../Platforms/Wasm/WasmPlatformApplicationAdapter.h"
36 #include "../../Platforms/Wasm/Defaults.h" 36 #include "../../Platforms/Wasm/Defaults.h"
37 #endif 37 #endif
38 38
39 #include <Core/Images/Font.h>
39 #include <Core/Logging.h> 40 #include <Core/Logging.h>
40 41
41 namespace OrthancStone 42 namespace OrthancStone
42 { 43 {
43 namespace Samples 44 namespace Samples
125 { 126 {
126 return new LineMeasureTracker(statusBar, dynamic_cast<LayerWidget&>(widget).GetSlice(), x, y, 255, 0, 0, 10); 127 return new LineMeasureTracker(statusBar, dynamic_cast<LayerWidget&>(widget).GetSlice(), x, y, 255, 0, 0, 10);
127 } 128 }
128 else if (application_.currentTool_ == Tools_CircleMeasure) 129 else if (application_.currentTool_ == Tools_CircleMeasure)
129 { 130 {
130 return new CircleMeasureTracker(statusBar, dynamic_cast<LayerWidget&>(widget).GetSlice(), x, y, 255, 0, 0, 10); 131 return new CircleMeasureTracker(statusBar, dynamic_cast<LayerWidget&>(widget).GetSlice(),
132 x, y, 255, 0, 0, application_.GetFont());
131 } 133 }
132 } 134 }
133 return NULL; 135 return NULL;
134 } 136 }
135 137
231 OrthancStone::WidgetViewport* wasmViewport2_; 233 OrthancStone::WidgetViewport* wasmViewport2_;
232 234
233 IStatusBar* statusBar_; 235 IStatusBar* statusBar_;
234 std::auto_ptr<SmartLoader> smartLoader_; 236 std::auto_ptr<SmartLoader> smartLoader_;
235 std::auto_ptr<OrthancApiClient> orthancApiClient_; 237 std::auto_ptr<OrthancApiClient> orthancApiClient_;
238
239 Orthanc::Font font_;
236 240
237 public: 241 public:
238 SimpleViewerApplication(MessageBroker& broker) : 242 SimpleViewerApplication(MessageBroker& broker) :
239 IObserver(broker), 243 IObserver(broker),
240 currentTool_(Tools_LineMeasure), 244 currentTool_(Tools_LineMeasure),
241 mainLayout_(NULL), 245 mainLayout_(NULL),
242 currentInstanceIndex_(0), 246 currentInstanceIndex_(0),
243 wasmViewport1_(NULL), 247 wasmViewport1_(NULL),
244 wasmViewport2_(NULL) 248 wasmViewport2_(NULL)
245 { 249 {
250 font_.LoadFromResource(Orthanc::EmbeddedResources::FONT_UBUNTU_MONO_BOLD_16);
246 // DeclareIgnoredMessage(MessageType_Widget_ContentChanged); 251 // DeclareIgnoredMessage(MessageType_Widget_ContentChanged);
247 } 252 }
248 253
249 virtual void DeclareStartupOptions(boost::program_options::options_description& options) 254 virtual void DeclareStartupOptions(boost::program_options::options_description& options)
250 { 255 {
388 { 393 {
389 LayerWidget& widget = *dynamic_cast<LayerWidget*>(mainWidget_); 394 LayerWidget& widget = *dynamic_cast<LayerWidget*>(mainWidget_);
390 smartLoader_->SetFrameInWidget(widget, 0, instancesIdsPerSeriesId_[seriesId][0], 0); 395 smartLoader_->SetFrameInWidget(widget, 0, instancesIdsPerSeriesId_[seriesId][0], 0);
391 } 396 }
392 397
398 const Orthanc::Font& GetFont() const
399 {
400 return font_;
401 }
402
393 virtual void OnPushButton1Clicked() {} 403 virtual void OnPushButton1Clicked() {}
394 virtual void OnPushButton2Clicked() {} 404 virtual void OnPushButton2Clicked() {}
395 virtual void OnTool1Clicked() { currentTool_ = Tools_LineMeasure;} 405 virtual void OnTool1Clicked() { currentTool_ = Tools_LineMeasure;}
396 virtual void OnTool2Clicked() { currentTool_ = Tools_CircleMeasure;} 406 virtual void OnTool2Clicked() { currentTool_ = Tools_CircleMeasure;}
397 407