comparison Applications/Samples/SingleFrameEditorApplication.h @ 1066:b537002f83a9 broker

removing broker from deprecated classes
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 15 Oct 2019 15:39:39 +0200
parents efc5b62b9539
children d7887f88710f
comparison
equal deleted inserted replaced
1065:9d42f89b8c3c 1066:b537002f83a9
51 { 51 {
52 namespace Samples 52 namespace Samples
53 { 53 {
54 class RadiographyEditorInteractor : 54 class RadiographyEditorInteractor :
55 public Deprecated::IWorldSceneInteractor, 55 public Deprecated::IWorldSceneInteractor,
56 public IObserver 56 public ObserverBase<RadiographyEditorInteractor>
57 { 57 {
58 private: 58 private:
59 enum Tool 59 enum Tool
60 { 60 {
61 Tool_Move, 61 Tool_Move,
78 return 10.0; 78 return 10.0;
79 } 79 }
80 80
81 81
82 public: 82 public:
83 RadiographyEditorInteractor(MessageBroker& broker) : 83 RadiographyEditorInteractor() :
84 IObserver(broker),
85 context_(NULL), 84 context_(NULL),
86 tool_(Tool_Move), 85 tool_(Tool_Move),
87 maskLayer_(NULL) 86 maskLayer_(NULL)
88 { 87 {
89 } 88 }
308 writer.Write(snapshot, widget.GetScene()); 307 writer.Write(snapshot, widget.GetScene());
309 308
310 LOG(INFO) << "JSON export was successful: " 309 LOG(INFO) << "JSON export was successful: "
311 << snapshot.toStyledString(); 310 << snapshot.toStyledString();
312 311
313 boost::shared_ptr<RadiographyScene> scene(new RadiographyScene(GetBroker())); 312 boost::shared_ptr<RadiographyScene> scene(new RadiographyScene);
314 RadiographySceneReader reader(*scene, context_->GetOrthancApiClient()); 313 RadiographySceneReader reader(*scene, context_->GetOrthancApiClient());
315 314
316 Orthanc::FontRegistry fontRegistry; 315 Orthanc::FontRegistry fontRegistry;
317 fontRegistry.AddFromResource(Orthanc::EmbeddedResources::FONT_UBUNTU_MONO_BOLD_16); 316 fontRegistry.AddFromResource(Orthanc::EmbeddedResources::FONT_UBUNTU_MONO_BOLD_16);
318 317
428 RadiographyEditorInteractor interactor_; 427 RadiographyEditorInteractor interactor_;
429 Orthanc::FontRegistry fontRegistry_; 428 Orthanc::FontRegistry fontRegistry_;
430 RadiographyMaskLayer* maskLayer_; 429 RadiographyMaskLayer* maskLayer_;
431 430
432 public: 431 public:
433 SingleFrameEditorApplication(MessageBroker& broker) :
434 IObserver(broker),
435 interactor_(broker)
436 {
437 }
438
439 virtual ~SingleFrameEditorApplication() 432 virtual ~SingleFrameEditorApplication()
440 { 433 {
441 LOG(WARNING) << "Destroying the application"; 434 LOG(WARNING) << "Destroying the application";
442 } 435 }
443 436
487 std::string instance = parameters["instance"].as<std::string>(); 480 std::string instance = parameters["instance"].as<std::string>();
488 //int frame = parameters["frame"].as<unsigned int>(); 481 //int frame = parameters["frame"].as<unsigned int>();
489 482
490 fontRegistry_.AddFromResource(Orthanc::EmbeddedResources::FONT_UBUNTU_MONO_BOLD_16); 483 fontRegistry_.AddFromResource(Orthanc::EmbeddedResources::FONT_UBUNTU_MONO_BOLD_16);
491 484
492 scene_.reset(new RadiographyScene(GetBroker())); 485 scene_.reset(new RadiographyScene);
493 486
494 RadiographyLayer& dicomLayer = scene_->LoadDicomFrame(context->GetOrthancApiClient(), instance, 0, false, NULL); 487 RadiographyLayer& dicomLayer = scene_->LoadDicomFrame(context->GetOrthancApiClient(), instance, 0, false, NULL);
495 //scene_->LoadDicomFrame(instance, frame, false); //.SetPan(200, 0); 488 //scene_->LoadDicomFrame(instance, frame, false); //.SetPan(200, 0);
496 // = scene_->LoadDicomFrame(context->GetOrthancApiClient(), "61f3143e-96f34791-ad6bbb8d-62559e75-45943e1b", 0, false, NULL); 489 // = scene_->LoadDicomFrame(context->GetOrthancApiClient(), "61f3143e-96f34791-ad6bbb8d-62559e75-45943e1b", 0, false, NULL);
497 490
520 layer.SetResizeable(true); 513 layer.SetResizeable(true);
521 layer.SetPan(0, 200); 514 layer.SetPan(0, 200);
522 } 515 }
523 516
524 517
525 mainWidget_ = new RadiographyWidget(GetBroker(), scene_, "main-widget"); 518 mainWidget_ = new RadiographyWidget(scene_, "main-widget");
526 mainWidget_->SetTransmitMouseOver(true); 519 mainWidget_->SetTransmitMouseOver(true);
527 mainWidget_->SetInteractor(interactor_); 520 mainWidget_->SetInteractor(interactor_);
528 521
529 //scene_->SetWindowing(128, 256); 522 //scene_->SetWindowing(128, 256);
530 } 523 }