Mercurial > hg > orthanc-stone
diff Applications/Samples/SingleFrameApplication.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 | c35e98d22764 |
children | 04a95ee91327 |
line wrap: on
line diff
--- a/Applications/Samples/SingleFrameApplication.h Tue Oct 15 14:08:15 2019 +0200 +++ b/Applications/Samples/SingleFrameApplication.h Tue Oct 15 15:39:39 2019 +0200 @@ -38,7 +38,7 @@ { class SingleFrameApplication : public SampleSingleCanvasApplicationBase, - public IObserver + public ObserverBase<SingleFrameApplication> { private: class Interactor : public Deprecated::IWorldSceneInteractor @@ -202,8 +202,7 @@ unsigned int slice_; public: - SingleFrameApplication(MessageBroker& broker) : - IObserver(broker), + SingleFrameApplication() : source_(NULL), slice_(0) { @@ -243,12 +242,12 @@ std::string instance = parameters["instance"].as<std::string>(); int frame = parameters["frame"].as<unsigned int>(); - mainWidget_ = new Deprecated::SliceViewerWidget(GetBroker(), "main-widget"); + mainWidget_ = new Deprecated::SliceViewerWidget("main-widget"); - std::auto_ptr<Deprecated::DicomSeriesVolumeSlicer> layer(new Deprecated::DicomSeriesVolumeSlicer(GetBroker(), context->GetOrthancApiClient())); + std::auto_ptr<Deprecated::DicomSeriesVolumeSlicer> layer(new Deprecated::DicomSeriesVolumeSlicer(context->GetOrthancApiClient())); source_ = layer.get(); layer->LoadFrame(instance, frame); - layer->RegisterObserverCallback(new Callable<SingleFrameApplication, Deprecated::IVolumeSlicer::GeometryReadyMessage>(*this, &SingleFrameApplication::OnMainWidgetGeometryReady)); + Register<Deprecated::IVolumeSlicer::GeometryReadyMessage>(*layer, &SingleFrameApplication::OnMainWidgetGeometryReady); GetMainWidget().AddLayer(layer.release()); Deprecated::RenderStyle s;