Mercurial > hg > orthanc-stone
changeset 726:4f2416d519b4
moving layers, widgets and loaders to Deprecated namespace
line wrap: on
line diff
--- a/Applications/Generic/NativeStoneApplicationContext.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Applications/Generic/NativeStoneApplicationContext.cpp Tue May 21 11:43:25 2019 +0200 @@ -24,7 +24,7 @@ namespace OrthancStone { - IWidget& NativeStoneApplicationContext::GlobalMutexLocker::SetCentralWidget(IWidget* widget) + Deprecated::IWidget& NativeStoneApplicationContext::GlobalMutexLocker::SetCentralWidget(Deprecated::IWidget* widget) { that_.centralViewport_.SetCentralWidget(widget); return *widget;
--- a/Applications/Generic/NativeStoneApplicationContext.h Mon May 20 16:26:34 2019 +0200 +++ b/Applications/Generic/NativeStoneApplicationContext.h Tue May 21 11:43:25 2019 +0200 @@ -37,7 +37,7 @@ static void UpdateThread(NativeStoneApplicationContext* that); boost::recursive_mutex globalMutex_; - WidgetViewport centralViewport_; + Deprecated::WidgetViewport centralViewport_; boost::thread updateThread_; bool stopped_; unsigned int updateDelayInMs_; @@ -56,9 +56,9 @@ { } - IWidget& SetCentralWidget(IWidget* widget); // Takes ownership + Deprecated::IWidget& SetCentralWidget(Deprecated::IWidget* widget); // Takes ownership - IViewport& GetCentralViewport() + Deprecated::IViewport& GetCentralViewport() { return that_.centralViewport_; }
--- a/Applications/Generic/NativeStoneApplicationRunner.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Applications/Generic/NativeStoneApplicationRunner.cpp Tue May 21 11:43:25 2019 +0200 @@ -43,7 +43,7 @@ // Anonymous namespace to avoid clashes against other compilation modules namespace { - class LogStatusBar : public IStatusBar + class LogStatusBar : public Deprecated::IStatusBar { public: virtual void ClearMessage() @@ -202,17 +202,17 @@ { // use multiple threads to execute asynchronous tasks like // download content - Oracle oracle(6); + Deprecated::Oracle oracle(6); oracle.Start(); { - OracleWebService webService( + Deprecated::OracleWebService webService( broker_, oracle, webServiceParameters, context); context.SetWebService(webService); context.SetOrthancBaseUrl(webServiceParameters.GetUrl()); - OracleDelayedCallExecutor delayedExecutor(broker_, oracle, context); + Deprecated::OracleDelayedCallExecutor delayedExecutor(broker_, oracle, context); context.SetDelayedCallExecutor(delayedExecutor); application_.Initialize(&context, statusBar, parameters);
--- a/Applications/IStoneApplication.h Mon May 20 16:26:34 2019 +0200 +++ b/Applications/IStoneApplication.h Tue May 21 11:43:25 2019 +0200 @@ -47,7 +47,7 @@ virtual void DeclareStartupOptions(boost::program_options::options_description& options) = 0; virtual void Initialize(StoneApplicationContext* context, - IStatusBar& statusBar, + Deprecated::IStatusBar& statusBar, const boost::program_options::variables_map& parameters) = 0; /** @@ -63,7 +63,7 @@ #endif virtual std::string GetTitle() const = 0; - virtual IWidget* GetCentralWidget() = 0; + virtual Deprecated::IWidget* GetCentralWidget() = 0; virtual void Finalize() = 0; }; }
--- a/Applications/Samples/SampleApplicationBase.h Mon May 20 16:26:34 2019 +0200 +++ b/Applications/Samples/SampleApplicationBase.h Tue May 21 11:43:25 2019 +0200 @@ -42,11 +42,11 @@ { protected: // ownership is transferred to the application context - WorldSceneWidget* mainWidget_; + Deprecated::WorldSceneWidget* mainWidget_; public: virtual void Initialize(StoneApplicationContext* context, - IStatusBar& statusBar, + Deprecated::IStatusBar& statusBar, const boost::program_options::variables_map& parameters) ORTHANC_OVERRIDE { } @@ -64,7 +64,7 @@ virtual void Finalize() ORTHANC_OVERRIDE {} - virtual IWidget* GetCentralWidget() ORTHANC_OVERRIDE {return mainWidget_;} + virtual Deprecated::IWidget* GetCentralWidget() ORTHANC_OVERRIDE {return mainWidget_;} #if ORTHANC_ENABLE_WASM==1 // default implementations for a single canvas named "canvas" in the HTML and an emtpy WasmApplicationAdapter
--- a/Applications/Samples/SimpleViewer/MainWidgetInteractor.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Applications/Samples/SimpleViewer/MainWidgetInteractor.cpp Tue May 21 11:43:25 2019 +0200 @@ -24,27 +24,27 @@ namespace SimpleViewer { - IWorldSceneMouseTracker* MainWidgetInteractor::CreateMouseTracker(WorldSceneWidget& widget, - const ViewportGeometry& view, + Deprecated::IWorldSceneMouseTracker* MainWidgetInteractor::CreateMouseTracker(Deprecated::WorldSceneWidget& widget, + const Deprecated::ViewportGeometry& view, MouseButton button, KeyboardModifiers modifiers, int viewportX, int viewportY, double x, double y, - IStatusBar* statusBar, - const std::vector<Touch>& displayTouches) + Deprecated::IStatusBar* statusBar, + const std::vector<Deprecated::Touch>& displayTouches) { if (button == MouseButton_Left) { if (application_.GetCurrentTool() == Tool_LineMeasure) { - return new LineMeasureTracker(statusBar, dynamic_cast<SliceViewerWidget&>(widget).GetSlice(), + return new Deprecated::LineMeasureTracker(statusBar, dynamic_cast<Deprecated::SliceViewerWidget&>(widget).GetSlice(), x, y, 255, 0, 0, application_.GetFont()); } else if (application_.GetCurrentTool() == Tool_CircleMeasure) { - return new CircleMeasureTracker(statusBar, dynamic_cast<SliceViewerWidget&>(widget).GetSlice(), + return new Deprecated::CircleMeasureTracker(statusBar, dynamic_cast<Deprecated::SliceViewerWidget&>(widget).GetSlice(), x, y, 255, 0, 0, application_.GetFont()); } else if (application_.GetCurrentTool() == Tool_Crop) @@ -68,15 +68,15 @@ } void MainWidgetInteractor::MouseOver(CairoContext& context, - WorldSceneWidget& widget, - const ViewportGeometry& view, + Deprecated::WorldSceneWidget& widget, + const Deprecated::ViewportGeometry& view, double x, double y, - IStatusBar* statusBar) + Deprecated::IStatusBar* statusBar) { if (statusBar != NULL) { - Vector p = dynamic_cast<SliceViewerWidget&>(widget).GetSlice().MapSliceToWorldCoordinates(x, y); + Vector p = dynamic_cast<Deprecated::SliceViewerWidget&>(widget).GetSlice().MapSliceToWorldCoordinates(x, y); char buf[64]; sprintf(buf, "X = %.02f Y = %.02f Z = %.02f (in cm)", @@ -85,18 +85,18 @@ } } - void MainWidgetInteractor::MouseWheel(WorldSceneWidget& widget, + void MainWidgetInteractor::MouseWheel(Deprecated::WorldSceneWidget& widget, MouseWheelDirection direction, KeyboardModifiers modifiers, - IStatusBar* statusBar) + Deprecated::IStatusBar* statusBar) { } - void MainWidgetInteractor::KeyPressed(WorldSceneWidget& widget, + void MainWidgetInteractor::KeyPressed(Deprecated::WorldSceneWidget& widget, KeyboardKeys key, char keyChar, KeyboardModifiers modifiers, - IStatusBar* statusBar) + Deprecated::IStatusBar* statusBar) { switch (keyChar) {
--- a/Applications/Samples/SimpleViewer/MainWidgetInteractor.h Mon May 20 16:26:34 2019 +0200 +++ b/Applications/Samples/SimpleViewer/MainWidgetInteractor.h Tue May 21 11:43:25 2019 +0200 @@ -28,7 +28,7 @@ class SimpleViewerApplication; - class MainWidgetInteractor : public IWorldSceneInteractor + class MainWidgetInteractor : public Deprecated::IWorldSceneInteractor { private: SimpleViewerApplication& application_; @@ -42,34 +42,34 @@ /** WorldSceneWidget: */ - virtual IWorldSceneMouseTracker* CreateMouseTracker(WorldSceneWidget& widget, - const ViewportGeometry& view, - MouseButton button, - KeyboardModifiers modifiers, - int viewportX, - int viewportY, - double x, - double y, - IStatusBar* statusBar, - const std::vector<Touch>& displayTouches); + virtual Deprecated::IWorldSceneMouseTracker* CreateMouseTracker(Deprecated::WorldSceneWidget& widget, + const Deprecated::ViewportGeometry& view, + MouseButton button, + KeyboardModifiers modifiers, + int viewportX, + int viewportY, + double x, + double y, + Deprecated::IStatusBar* statusBar, + const std::vector<Deprecated::Touch>& displayTouches); virtual void MouseOver(CairoContext& context, - WorldSceneWidget& widget, - const ViewportGeometry& view, + Deprecated::WorldSceneWidget& widget, + const Deprecated::ViewportGeometry& view, double x, double y, - IStatusBar* statusBar); + Deprecated::IStatusBar* statusBar); - virtual void MouseWheel(WorldSceneWidget& widget, + virtual void MouseWheel(Deprecated::WorldSceneWidget& widget, MouseWheelDirection direction, KeyboardModifiers modifiers, - IStatusBar* statusBar); + Deprecated::IStatusBar* statusBar); - virtual void KeyPressed(WorldSceneWidget& widget, + virtual void KeyPressed(Deprecated::WorldSceneWidget& widget, KeyboardKeys key, char keyChar, KeyboardModifiers modifiers, - IStatusBar* statusBar); + Deprecated::IStatusBar* statusBar); };
--- a/Applications/Samples/SimpleViewer/SimpleViewerApplication.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Applications/Samples/SimpleViewer/SimpleViewerApplication.cpp Tue May 21 11:43:25 2019 +0200 @@ -33,28 +33,26 @@ { void SimpleViewerApplication::Initialize(StoneApplicationContext* context, - IStatusBar& statusBar, + Deprecated::IStatusBar& statusBar, const boost::program_options::variables_map& parameters) { - using namespace OrthancStone; - context_ = context; statusBar_ = &statusBar; {// initialize viewports and layout - mainLayout_ = new LayoutWidget("main-layout"); + mainLayout_ = new Deprecated::LayoutWidget("main-layout"); mainLayout_->SetPadding(10); mainLayout_->SetBackgroundCleared(true); mainLayout_->SetBackgroundColor(0, 0, 0); mainLayout_->SetHorizontal(); - thumbnailsLayout_ = new LayoutWidget("thumbnail-layout"); + thumbnailsLayout_ = new Deprecated::LayoutWidget("thumbnail-layout"); thumbnailsLayout_->SetPadding(10); thumbnailsLayout_->SetBackgroundCleared(true); thumbnailsLayout_->SetBackgroundColor(50, 50, 50); thumbnailsLayout_->SetVertical(); - mainWidget_ = new SliceViewerWidget(IObserver::GetBroker(), "main-viewport"); + mainWidget_ = new Deprecated::SliceViewerWidget(IObserver::GetBroker(), "main-viewport"); //mainWidget_->RegisterObserver(*this); // hierarchy @@ -62,7 +60,7 @@ mainLayout_->AddWidget(mainWidget_); // sources - smartLoader_.reset(new SmartLoader(IObserver::GetBroker(), context->GetOrthancApiClient())); + smartLoader_.reset(new Deprecated::SmartLoader(IObserver::GetBroker(), context->GetOrthancApiClient())); smartLoader_->SetImageQuality(SliceImageQuality_FullPam); mainLayout_->SetTransmitMouseOver(true); @@ -78,7 +76,7 @@ if (parameters.count("studyId") < 1) { LOG(WARNING) << "The study ID is missing, will take the first studyId found in Orthanc"; - context->GetOrthancApiClient().GetJsonAsync("/studies", new Callable<SimpleViewerApplication, OrthancApiClient::JsonResponseReadyMessage>(*this, &SimpleViewerApplication::OnStudyListReceived)); + context->GetOrthancApiClient().GetJsonAsync("/studies", new Callable<SimpleViewerApplication, Deprecated::OrthancApiClient::JsonResponseReadyMessage>(*this, &SimpleViewerApplication::OnStudyListReceived)); } else { @@ -98,7 +96,7 @@ options.add(generic); } - void SimpleViewerApplication::OnStudyListReceived(const OrthancApiClient::JsonResponseReadyMessage& message) + void SimpleViewerApplication::OnStudyListReceived(const Deprecated::OrthancApiClient::JsonResponseReadyMessage& message) { const Json::Value& response = message.GetJson(); @@ -108,7 +106,7 @@ SelectStudy(response[0].asString()); } } - void SimpleViewerApplication::OnStudyReceived(const OrthancApiClient::JsonResponseReadyMessage& message) + void SimpleViewerApplication::OnStudyReceived(const Deprecated::OrthancApiClient::JsonResponseReadyMessage& message) { const Json::Value& response = message.GetJson(); @@ -116,12 +114,12 @@ { for (size_t i=0; i < response["Series"].size(); i++) { - context_->GetOrthancApiClient().GetJsonAsync("/series/" + response["Series"][(int)i].asString(), new Callable<SimpleViewerApplication, OrthancApiClient::JsonResponseReadyMessage>(*this, &SimpleViewerApplication::OnSeriesReceived)); + context_->GetOrthancApiClient().GetJsonAsync("/series/" + response["Series"][(int)i].asString(), new Callable<SimpleViewerApplication, Deprecated::OrthancApiClient::JsonResponseReadyMessage>(*this, &SimpleViewerApplication::OnSeriesReceived)); } } } - void SimpleViewerApplication::OnSeriesReceived(const OrthancApiClient::JsonResponseReadyMessage& message) + void SimpleViewerApplication::OnSeriesReceived(const Deprecated::OrthancApiClient::JsonResponseReadyMessage& message) { const Json::Value& response = message.GetJson(); @@ -154,13 +152,13 @@ { LOG(INFO) << "Loading thumbnail for series " << seriesId; - SliceViewerWidget* thumbnailWidget = - new SliceViewerWidget(IObserver::GetBroker(), "thumbnail-series-" + seriesId); + Deprecated::SliceViewerWidget* thumbnailWidget = + new Deprecated::SliceViewerWidget(IObserver::GetBroker(), "thumbnail-series-" + seriesId); thumbnails_.push_back(thumbnailWidget); thumbnailsLayout_->AddWidget(thumbnailWidget); thumbnailWidget->RegisterObserverCallback( - new Callable<SimpleViewerApplication, SliceViewerWidget::GeometryChangedMessage> + new Callable<SimpleViewerApplication, Deprecated::SliceViewerWidget::GeometryChangedMessage> (*this, &SimpleViewerApplication::OnWidgetGeometryChanged)); smartLoader_->SetFrameInWidget(*thumbnailWidget, 0, instanceId, 0); @@ -169,13 +167,13 @@ void SimpleViewerApplication::SelectStudy(const std::string& studyId) { - context_->GetOrthancApiClient().GetJsonAsync("/studies/" + studyId, new Callable<SimpleViewerApplication, OrthancApiClient::JsonResponseReadyMessage>(*this, &SimpleViewerApplication::OnStudyReceived)); + context_->GetOrthancApiClient().GetJsonAsync("/studies/" + studyId, new Callable<SimpleViewerApplication, Deprecated::OrthancApiClient::JsonResponseReadyMessage>(*this, &SimpleViewerApplication::OnStudyReceived)); } - void SimpleViewerApplication::OnWidgetGeometryChanged(const SliceViewerWidget::GeometryChangedMessage& message) + void SimpleViewerApplication::OnWidgetGeometryChanged(const Deprecated::SliceViewerWidget::GeometryChangedMessage& message) { // TODO: The "const_cast" could probably be replaced by "mainWidget_" - const_cast<SliceViewerWidget&>(message.GetOrigin()).FitContent(); + const_cast<Deprecated::SliceViewerWidget&>(message.GetOrigin()).FitContent(); } void SimpleViewerApplication::SelectSeriesInMainViewport(const std::string& seriesId)
--- a/Applications/Samples/SimpleViewer/SimpleViewerApplication.h Mon May 20 16:26:34 2019 +0200 +++ b/Applications/Samples/SimpleViewer/SimpleViewerApplication.h Tue May 21 11:43:25 2019 +0200 @@ -83,18 +83,18 @@ std::auto_ptr<MainWidgetInteractor> mainWidgetInteractor_; std::auto_ptr<ThumbnailInteractor> thumbnailInteractor_; - LayoutWidget* mainLayout_; - LayoutWidget* thumbnailsLayout_; - SliceViewerWidget* mainWidget_; - std::vector<SliceViewerWidget*> thumbnails_; + Deprecated::LayoutWidget* mainLayout_; + Deprecated::LayoutWidget* thumbnailsLayout_; + Deprecated::SliceViewerWidget* mainWidget_; + std::vector<Deprecated::SliceViewerWidget*> thumbnails_; std::map<std::string, std::vector<std::string> > instancesIdsPerSeriesId_; std::map<std::string, Json::Value> seriesTags_; unsigned int currentInstanceIndex_; - OrthancStone::WidgetViewport* wasmViewport1_; - OrthancStone::WidgetViewport* wasmViewport2_; + Deprecated::WidgetViewport* wasmViewport1_; + Deprecated::WidgetViewport* wasmViewport2_; - IStatusBar* statusBar_; - std::auto_ptr<SmartLoader> smartLoader_; + Deprecated::IStatusBar* statusBar_; + std::auto_ptr<Deprecated::SmartLoader> smartLoader_; Orthanc::Font font_; @@ -112,24 +112,24 @@ } virtual void Finalize() ORTHANC_OVERRIDE {} - virtual IWidget* GetCentralWidget() ORTHANC_OVERRIDE {return mainLayout_;} + virtual Deprecated::IWidget* GetCentralWidget() ORTHANC_OVERRIDE {return mainLayout_;} virtual void DeclareStartupOptions(boost::program_options::options_description& options) ORTHANC_OVERRIDE; virtual void Initialize(StoneApplicationContext* context, - IStatusBar& statusBar, + Deprecated::IStatusBar& statusBar, const boost::program_options::variables_map& parameters) ORTHANC_OVERRIDE; - void OnStudyListReceived(const OrthancApiClient::JsonResponseReadyMessage& message); + void OnStudyListReceived(const Deprecated::OrthancApiClient::JsonResponseReadyMessage& message); - void OnStudyReceived(const OrthancApiClient::JsonResponseReadyMessage& message); + void OnStudyReceived(const Deprecated::OrthancApiClient::JsonResponseReadyMessage& message); - void OnSeriesReceived(const OrthancApiClient::JsonResponseReadyMessage& message); + void OnSeriesReceived(const Deprecated::OrthancApiClient::JsonResponseReadyMessage& message); void LoadThumbnailForSeries(const std::string& seriesId, const std::string& instanceId); void SelectStudy(const std::string& studyId); - void OnWidgetGeometryChanged(const SliceViewerWidget::GeometryChangedMessage& message); + void OnWidgetGeometryChanged(const Deprecated::SliceViewerWidget::GeometryChangedMessage& message); void SelectSeriesInMainViewport(const std::string& seriesId);
--- a/Applications/Samples/SimpleViewer/ThumbnailInteractor.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Applications/Samples/SimpleViewer/ThumbnailInteractor.cpp Tue May 21 11:43:25 2019 +0200 @@ -24,16 +24,16 @@ namespace SimpleViewer { - IWorldSceneMouseTracker* ThumbnailInteractor::CreateMouseTracker(WorldSceneWidget& widget, - const ViewportGeometry& view, + Deprecated::IWorldSceneMouseTracker* ThumbnailInteractor::CreateMouseTracker(Deprecated::WorldSceneWidget& widget, + const Deprecated::ViewportGeometry& view, MouseButton button, KeyboardModifiers modifiers, int viewportX, int viewportY, double x, double y, - IStatusBar* statusBar, - const std::vector<Touch>& displayTouches) + Deprecated::IStatusBar* statusBar, + const std::vector<Deprecated::Touch>& displayTouches) { if (button == MouseButton_Left) {
--- a/Applications/Samples/SimpleViewer/ThumbnailInteractor.h Mon May 20 16:26:34 2019 +0200 +++ b/Applications/Samples/SimpleViewer/ThumbnailInteractor.h Tue May 21 11:43:25 2019 +0200 @@ -29,7 +29,7 @@ class SimpleViewerApplication; - class ThumbnailInteractor : public IWorldSceneInteractor + class ThumbnailInteractor : public Deprecated::IWorldSceneInteractor { private: SimpleViewerApplication& application_; @@ -39,36 +39,36 @@ { } - virtual IWorldSceneMouseTracker* CreateMouseTracker(WorldSceneWidget& widget, - const ViewportGeometry& view, - MouseButton button, - KeyboardModifiers modifiers, - int viewportX, - int viewportY, - double x, - double y, - IStatusBar* statusBar, - const std::vector<Touch>& displayTouches); + virtual Deprecated::IWorldSceneMouseTracker* CreateMouseTracker(Deprecated::WorldSceneWidget& widget, + const Deprecated::ViewportGeometry& view, + MouseButton button, + KeyboardModifiers modifiers, + int viewportX, + int viewportY, + double x, + double y, + Deprecated::IStatusBar* statusBar, + const std::vector<Deprecated::Touch>& displayTouches); virtual void MouseOver(CairoContext& context, - WorldSceneWidget& widget, - const ViewportGeometry& view, + Deprecated::WorldSceneWidget& widget, + const Deprecated::ViewportGeometry& view, double x, double y, - IStatusBar* statusBar) + Deprecated::IStatusBar* statusBar) {} - virtual void MouseWheel(WorldSceneWidget& widget, + virtual void MouseWheel(Deprecated::WorldSceneWidget& widget, MouseWheelDirection direction, KeyboardModifiers modifiers, - IStatusBar* statusBar) + Deprecated::IStatusBar* statusBar) {} - virtual void KeyPressed(WorldSceneWidget& widget, + virtual void KeyPressed(Deprecated::WorldSceneWidget& widget, KeyboardKeys key, char keyChar, KeyboardModifiers modifiers, - IStatusBar* statusBar) + Deprecated::IStatusBar* statusBar) {} };
--- a/Applications/Samples/SimpleViewerApplicationSingleFile.h Mon May 20 16:26:34 2019 +0200 +++ b/Applications/Samples/SimpleViewerApplicationSingleFile.h Tue May 21 11:43:25 2019 +0200 @@ -47,7 +47,7 @@ public IObserver { private: - class ThumbnailInteractor : public IWorldSceneInteractor + class ThumbnailInteractor : public Deprecated::IWorldSceneInteractor { private: SimpleViewerApplication& application_; @@ -58,16 +58,16 @@ { } - virtual IWorldSceneMouseTracker* CreateMouseTracker(WorldSceneWidget& widget, - const ViewportGeometry& view, + virtual Deprecated::IWorldSceneMouseTracker* CreateMouseTracker(Deprecated::WorldSceneWidget& widget, + const Deprecated::ViewportGeometry& view, MouseButton button, KeyboardModifiers modifiers, int viewportX, int viewportY, double x, double y, - IStatusBar* statusBar, - const std::vector<Touch>& displayTouches) + Deprecated::IStatusBar* statusBar, + const std::vector<Deprecated::Touch>& displayTouches) { if (button == MouseButton_Left) { @@ -79,31 +79,31 @@ } virtual void MouseOver(CairoContext& context, - WorldSceneWidget& widget, - const ViewportGeometry& view, + Deprecated::WorldSceneWidget& widget, + const Deprecated::ViewportGeometry& view, double x, double y, - IStatusBar* statusBar) + Deprecated::IStatusBar* statusBar) { } - virtual void MouseWheel(WorldSceneWidget& widget, + virtual void MouseWheel(Deprecated::WorldSceneWidget& widget, MouseWheelDirection direction, KeyboardModifiers modifiers, - IStatusBar* statusBar) + Deprecated::IStatusBar* statusBar) { } - virtual void KeyPressed(WorldSceneWidget& widget, + virtual void KeyPressed(Deprecated::WorldSceneWidget& widget, KeyboardKeys key, char keyChar, KeyboardModifiers modifiers, - IStatusBar* statusBar) + Deprecated::IStatusBar* statusBar) { } }; - class MainWidgetInteractor : public IWorldSceneInteractor + class MainWidgetInteractor : public Deprecated::IWorldSceneInteractor { private: SimpleViewerApplication& application_; @@ -114,27 +114,27 @@ { } - virtual IWorldSceneMouseTracker* CreateMouseTracker(WorldSceneWidget& widget, - const ViewportGeometry& view, + virtual Deprecated::IWorldSceneMouseTracker* CreateMouseTracker(Deprecated::WorldSceneWidget& widget, + const Deprecated::ViewportGeometry& view, MouseButton button, KeyboardModifiers modifiers, int viewportX, int viewportY, double x, double y, - IStatusBar* statusBar, - const std::vector<Touch>& displayTouches) + Deprecated::IStatusBar* statusBar, + const std::vector<Deprecated::Touch>& displayTouches) { if (button == MouseButton_Left) { if (application_.currentTool_ == Tool_LineMeasure) { - return new LineMeasureTracker(statusBar, dynamic_cast<SliceViewerWidget&>(widget).GetSlice(), + return new Deprecated::LineMeasureTracker(statusBar, dynamic_cast<Deprecated::SliceViewerWidget&>(widget).GetSlice(), x, y, 255, 0, 0, application_.GetFont()); } else if (application_.currentTool_ == Tool_CircleMeasure) { - return new CircleMeasureTracker(statusBar, dynamic_cast<SliceViewerWidget&>(widget).GetSlice(), + return new Deprecated::CircleMeasureTracker(statusBar, dynamic_cast<Deprecated::SliceViewerWidget&>(widget).GetSlice(), x, y, 255, 0, 0, application_.GetFont()); } } @@ -142,15 +142,15 @@ } virtual void MouseOver(CairoContext& context, - WorldSceneWidget& widget, - const ViewportGeometry& view, + Deprecated::WorldSceneWidget& widget, + const Deprecated::ViewportGeometry& view, double x, double y, - IStatusBar* statusBar) + Deprecated::IStatusBar* statusBar) { if (statusBar != NULL) { - Vector p = dynamic_cast<SliceViewerWidget&>(widget).GetSlice().MapSliceToWorldCoordinates(x, y); + Vector p = dynamic_cast<Deprecated::SliceViewerWidget&>(widget).GetSlice().MapSliceToWorldCoordinates(x, y); char buf[64]; sprintf(buf, "X = %.02f Y = %.02f Z = %.02f (in cm)", @@ -159,18 +159,18 @@ } } - virtual void MouseWheel(WorldSceneWidget& widget, + virtual void MouseWheel(Deprecated::WorldSceneWidget& widget, MouseWheelDirection direction, KeyboardModifiers modifiers, - IStatusBar* statusBar) + Deprecated::IStatusBar* statusBar) { } - virtual void KeyPressed(WorldSceneWidget& widget, + virtual void KeyPressed(Deprecated::WorldSceneWidget& widget, KeyboardKeys key, char keyChar, KeyboardModifiers modifiers, - IStatusBar* statusBar) + Deprecated::IStatusBar* statusBar) { switch (keyChar) { @@ -241,19 +241,19 @@ Tool currentTool_; std::auto_ptr<MainWidgetInteractor> mainWidgetInteractor_; std::auto_ptr<ThumbnailInteractor> thumbnailInteractor_; - LayoutWidget* mainLayout_; - LayoutWidget* thumbnailsLayout_; - std::vector<SliceViewerWidget*> thumbnails_; + Deprecated::LayoutWidget* mainLayout_; + Deprecated::LayoutWidget* thumbnailsLayout_; + std::vector<Deprecated::SliceViewerWidget*> thumbnails_; std::map<std::string, std::vector<std::string> > instancesIdsPerSeriesId_; std::map<std::string, Json::Value> seriesTags_; unsigned int currentInstanceIndex_; - OrthancStone::WidgetViewport* wasmViewport1_; - OrthancStone::WidgetViewport* wasmViewport2_; + Deprecated::WidgetViewport* wasmViewport1_; + Deprecated::WidgetViewport* wasmViewport2_; - IStatusBar* statusBar_; - std::auto_ptr<SmartLoader> smartLoader_; + Deprecated::IStatusBar* statusBar_; + std::auto_ptr<Deprecated::SmartLoader> smartLoader_; Orthanc::Font font_; @@ -282,7 +282,7 @@ } virtual void Initialize(StoneApplicationContext* context, - IStatusBar& statusBar, + Deprecated::IStatusBar& statusBar, const boost::program_options::variables_map& parameters) { using namespace OrthancStone; @@ -291,19 +291,19 @@ statusBar_ = &statusBar; {// initialize viewports and layout - mainLayout_ = new LayoutWidget("main-layout"); + mainLayout_ = new Deprecated::LayoutWidget("main-layout"); mainLayout_->SetPadding(10); mainLayout_->SetBackgroundCleared(true); mainLayout_->SetBackgroundColor(0, 0, 0); mainLayout_->SetHorizontal(); - thumbnailsLayout_ = new LayoutWidget("thumbnail-layout"); + thumbnailsLayout_ = new Deprecated::LayoutWidget("thumbnail-layout"); thumbnailsLayout_->SetPadding(10); thumbnailsLayout_->SetBackgroundCleared(true); thumbnailsLayout_->SetBackgroundColor(50, 50, 50); thumbnailsLayout_->SetVertical(); - mainWidget_ = new SliceViewerWidget(GetBroker(), "main-viewport"); + mainWidget_ = new Deprecated::SliceViewerWidget(GetBroker(), "main-viewport"); //mainWidget_->RegisterObserver(*this); // hierarchy @@ -311,7 +311,7 @@ mainLayout_->AddWidget(mainWidget_); // sources - smartLoader_.reset(new SmartLoader(GetBroker(), context->GetOrthancApiClient())); + smartLoader_.reset(new Deprecated::SmartLoader(GetBroker(), context->GetOrthancApiClient())); smartLoader_->SetImageQuality(SliceImageQuality_FullPam); mainLayout_->SetTransmitMouseOver(true); @@ -329,7 +329,7 @@ LOG(WARNING) << "The study ID is missing, will take the first studyId found in Orthanc"; context->GetOrthancApiClient().GetJsonAsync( "/studies", - new Callable<SimpleViewerApplication, OrthancApiClient::JsonResponseReadyMessage> + new Callable<SimpleViewerApplication, Deprecated::OrthancApiClient::JsonResponseReadyMessage> (*this, &SimpleViewerApplication::OnStudyListReceived)); } else @@ -338,7 +338,7 @@ } } - void OnStudyListReceived(const OrthancApiClient::JsonResponseReadyMessage& message) + void OnStudyListReceived(const Deprecated::OrthancApiClient::JsonResponseReadyMessage& message) { const Json::Value& response = message.GetJson(); @@ -349,7 +349,7 @@ } } - void OnStudyReceived(const OrthancApiClient::JsonResponseReadyMessage& message) + void OnStudyReceived(const Deprecated::OrthancApiClient::JsonResponseReadyMessage& message) { const Json::Value& response = message.GetJson(); @@ -359,13 +359,13 @@ { context_->GetOrthancApiClient().GetJsonAsync( "/series/" + response["Series"][(int)i].asString(), - new Callable<SimpleViewerApplication, OrthancApiClient::JsonResponseReadyMessage> + new Callable<SimpleViewerApplication, Deprecated::OrthancApiClient::JsonResponseReadyMessage> (*this, &SimpleViewerApplication::OnSeriesReceived)); } } } - void OnSeriesReceived(const OrthancApiClient::JsonResponseReadyMessage& message) + void OnSeriesReceived(const Deprecated::OrthancApiClient::JsonResponseReadyMessage& message) { const Json::Value& response = message.GetJson(); @@ -387,7 +387,7 @@ LoadThumbnailForSeries(seriesId, instancesIdsPerSeriesId_[seriesId][0]); // if this is the first thumbnail loaded, load the first instance in the mainWidget - SliceViewerWidget& widget = *dynamic_cast<SliceViewerWidget*>(mainWidget_); + Deprecated::SliceViewerWidget& widget = *dynamic_cast<Deprecated::SliceViewerWidget*>(mainWidget_); if (widget.GetLayerCount() == 0) { smartLoader_->SetFrameInWidget(widget, 0, instancesIdsPerSeriesId_[seriesId][0], 0); @@ -398,10 +398,10 @@ void LoadThumbnailForSeries(const std::string& seriesId, const std::string& instanceId) { LOG(INFO) << "Loading thumbnail for series " << seriesId; - SliceViewerWidget* thumbnailWidget = new SliceViewerWidget(GetBroker(), "thumbnail-series-" + seriesId); + Deprecated::SliceViewerWidget* thumbnailWidget = new Deprecated::SliceViewerWidget(GetBroker(), "thumbnail-series-" + seriesId); thumbnails_.push_back(thumbnailWidget); thumbnailsLayout_->AddWidget(thumbnailWidget); - thumbnailWidget->RegisterObserverCallback(new Callable<SimpleViewerApplication, SliceViewerWidget::GeometryChangedMessage>(*this, &SimpleViewerApplication::OnWidgetGeometryChanged)); + thumbnailWidget->RegisterObserverCallback(new Callable<SimpleViewerApplication, Deprecated::SliceViewerWidget::GeometryChangedMessage>(*this, &SimpleViewerApplication::OnWidgetGeometryChanged)); smartLoader_->SetFrameInWidget(*thumbnailWidget, 0, instanceId, 0); thumbnailWidget->SetInteractor(*thumbnailInteractor_); } @@ -410,19 +410,19 @@ { LOG(INFO) << "Selecting study: " << studyId; context_->GetOrthancApiClient().GetJsonAsync( - "/studies/" + studyId, new Callable<SimpleViewerApplication, OrthancApiClient::JsonResponseReadyMessage> + "/studies/" + studyId, new Callable<SimpleViewerApplication, Deprecated::OrthancApiClient::JsonResponseReadyMessage> (*this, &SimpleViewerApplication::OnStudyReceived)); } - void OnWidgetGeometryChanged(const SliceViewerWidget::GeometryChangedMessage& message) + void OnWidgetGeometryChanged(const Deprecated::SliceViewerWidget::GeometryChangedMessage& message) { // TODO: The "const_cast" could probably be replaced by "mainWidget" - const_cast<SliceViewerWidget&>(message.GetOrigin()).FitContent(); + const_cast<Deprecated::SliceViewerWidget&>(message.GetOrigin()).FitContent(); } void SelectSeriesInMainViewport(const std::string& seriesId) { - SliceViewerWidget& widget = *dynamic_cast<SliceViewerWidget*>(mainWidget_); + Deprecated::SliceViewerWidget& widget = *dynamic_cast<Deprecated::SliceViewerWidget*>(mainWidget_); smartLoader_->SetFrameInWidget(widget, 0, instancesIdsPerSeriesId_[seriesId][0], 0); }
--- a/Applications/Samples/SingleFrameApplication.h Mon May 20 16:26:34 2019 +0200 +++ b/Applications/Samples/SingleFrameApplication.h Tue May 21 11:43:25 2019 +0200 @@ -41,7 +41,7 @@ public IObserver { private: - class Interactor : public IWorldSceneInteractor + class Interactor : public Deprecated::IWorldSceneInteractor { private: SingleFrameApplication& application_; @@ -52,30 +52,30 @@ { } - virtual IWorldSceneMouseTracker* CreateMouseTracker(WorldSceneWidget& widget, - const ViewportGeometry& view, - MouseButton button, - KeyboardModifiers modifiers, - int viewportX, - int viewportY, - double x, - double y, - IStatusBar* statusBar, - const std::vector<Touch>& displayTouches) + virtual Deprecated::IWorldSceneMouseTracker* CreateMouseTracker(Deprecated::WorldSceneWidget& widget, + const Deprecated::ViewportGeometry& view, + MouseButton button, + KeyboardModifiers modifiers, + int viewportX, + int viewportY, + double x, + double y, + Deprecated::IStatusBar* statusBar, + const std::vector<Deprecated::Touch>& displayTouches) { return NULL; } virtual void MouseOver(CairoContext& context, - WorldSceneWidget& widget, - const ViewportGeometry& view, + Deprecated::WorldSceneWidget& widget, + const Deprecated::ViewportGeometry& view, double x, double y, - IStatusBar* statusBar) + Deprecated::IStatusBar* statusBar) { if (statusBar != NULL) { - Vector p = dynamic_cast<SliceViewerWidget&>(widget).GetSlice().MapSliceToWorldCoordinates(x, y); + Vector p = dynamic_cast<Deprecated::SliceViewerWidget&>(widget).GetSlice().MapSliceToWorldCoordinates(x, y); char buf[64]; sprintf(buf, "X = %.02f Y = %.02f Z = %.02f (in cm)", @@ -84,10 +84,10 @@ } } - virtual void MouseWheel(WorldSceneWidget& widget, + virtual void MouseWheel(Deprecated::WorldSceneWidget& widget, MouseWheelDirection direction, KeyboardModifiers modifiers, - IStatusBar* statusBar) + Deprecated::IStatusBar* statusBar) { int scale = (modifiers & KeyboardModifiers_Control ? 10 : 1); @@ -106,11 +106,11 @@ } } - virtual void KeyPressed(WorldSceneWidget& widget, + virtual void KeyPressed(Deprecated::WorldSceneWidget& widget, KeyboardKeys key, char keyChar, KeyboardModifiers modifiers, - IStatusBar* statusBar) + Deprecated::IStatusBar* statusBar) { switch (keyChar) { @@ -149,9 +149,9 @@ } - SliceViewerWidget& GetMainWidget() + Deprecated::SliceViewerWidget& GetMainWidget() { - return *dynamic_cast<SliceViewerWidget*>(mainWidget_); + return *dynamic_cast<Deprecated::SliceViewerWidget*>(mainWidget_); } @@ -184,7 +184,7 @@ } - void OnMainWidgetGeometryReady(const IVolumeSlicer::GeometryReadyMessage& message) + void OnMainWidgetGeometryReady(const Deprecated::IVolumeSlicer::GeometryReadyMessage& message) { // Once the geometry of the series is downloaded from Orthanc, // display its middle slice, and adapt the viewport to fit this @@ -198,7 +198,7 @@ } std::auto_ptr<Interactor> mainWidgetInteractor_; - const DicomSeriesVolumeSlicer* source_; + const Deprecated::DicomSeriesVolumeSlicer* source_; unsigned int slice_; public: @@ -225,7 +225,7 @@ } virtual void Initialize(StoneApplicationContext* context, - IStatusBar& statusBar, + Deprecated::IStatusBar& statusBar, const boost::program_options::variables_map& parameters) { using namespace OrthancStone; @@ -243,15 +243,15 @@ std::string instance = parameters["instance"].as<std::string>(); int frame = parameters["frame"].as<unsigned int>(); - mainWidget_ = new SliceViewerWidget(GetBroker(), "main-widget"); + mainWidget_ = new Deprecated::SliceViewerWidget(GetBroker(), "main-widget"); - std::auto_ptr<DicomSeriesVolumeSlicer> layer(new DicomSeriesVolumeSlicer(GetBroker(), context->GetOrthancApiClient())); + std::auto_ptr<Deprecated::DicomSeriesVolumeSlicer> layer(new Deprecated::DicomSeriesVolumeSlicer(GetBroker(), context->GetOrthancApiClient())); source_ = layer.get(); layer->LoadFrame(instance, frame); - layer->RegisterObserverCallback(new Callable<SingleFrameApplication, IVolumeSlicer::GeometryReadyMessage>(*this, &SingleFrameApplication::OnMainWidgetGeometryReady)); + layer->RegisterObserverCallback(new Callable<SingleFrameApplication, Deprecated::IVolumeSlicer::GeometryReadyMessage>(*this, &SingleFrameApplication::OnMainWidgetGeometryReady)); GetMainWidget().AddLayer(layer.release()); - RenderStyle s; + Deprecated::RenderStyle s; if (parameters["smooth"].as<bool>()) {
--- a/Applications/Samples/SingleFrameEditorApplication.h Mon May 20 16:26:34 2019 +0200 +++ b/Applications/Samples/SingleFrameEditorApplication.h Tue May 21 11:43:25 2019 +0200 @@ -52,7 +52,7 @@ namespace Samples { class RadiographyEditorInteractor : - public IWorldSceneInteractor, + public Deprecated::IWorldSceneInteractor, public IObserver { private: @@ -97,16 +97,16 @@ { maskLayer_ = maskLayer; } - virtual IWorldSceneMouseTracker* CreateMouseTracker(WorldSceneWidget& worldWidget, - const ViewportGeometry& view, - MouseButton button, - KeyboardModifiers modifiers, - int viewportX, - int viewportY, - double x, - double y, - IStatusBar* statusBar, - const std::vector<Touch>& displayTouches) + virtual Deprecated::IWorldSceneMouseTracker* CreateMouseTracker(Deprecated::WorldSceneWidget& worldWidget, + const Deprecated::ViewportGeometry& view, + MouseButton button, + KeyboardModifiers modifiers, + int viewportX, + int viewportY, + double x, + double y, + Deprecated::IStatusBar* statusBar, + const std::vector<Deprecated::Touch>& displayTouches) { RadiographyWidget& widget = dynamic_cast<RadiographyWidget&>(worldWidget); @@ -226,11 +226,11 @@ } virtual void MouseOver(CairoContext& context, - WorldSceneWidget& worldWidget, - const ViewportGeometry& view, + Deprecated::WorldSceneWidget& worldWidget, + const Deprecated::ViewportGeometry& view, double x, double y, - IStatusBar* statusBar) + Deprecated::IStatusBar* statusBar) { RadiographyWidget& widget = dynamic_cast<RadiographyWidget&>(worldWidget); @@ -270,18 +270,18 @@ } } - virtual void MouseWheel(WorldSceneWidget& widget, + virtual void MouseWheel(Deprecated::WorldSceneWidget& widget, MouseWheelDirection direction, KeyboardModifiers modifiers, - IStatusBar* statusBar) + Deprecated::IStatusBar* statusBar) { } - virtual void KeyPressed(WorldSceneWidget& worldWidget, + virtual void KeyPressed(Deprecated::WorldSceneWidget& worldWidget, KeyboardKeys key, char keyChar, KeyboardModifiers modifiers, - IStatusBar* statusBar) + Deprecated::IStatusBar* statusBar) { RadiographyWidget& widget = dynamic_cast<RadiographyWidget&>(worldWidget); @@ -455,7 +455,7 @@ } virtual void Initialize(StoneApplicationContext* context, - IStatusBar& statusBar, + Deprecated::IStatusBar& statusBar, const boost::program_options::variables_map& parameters) { using namespace OrthancStone; @@ -485,7 +485,7 @@ } std::string instance = parameters["instance"].as<std::string>(); - int frame = parameters["frame"].as<unsigned int>(); + //int frame = parameters["frame"].as<unsigned int>(); fontRegistry_.AddFromResource(Orthanc::EmbeddedResources::FONT_UBUNTU_MONO_BOLD_16);
--- a/Applications/Sdl/SdlCairoSurface.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Applications/Sdl/SdlCairoSurface.cpp Tue May 21 11:43:25 2019 +0200 @@ -74,7 +74,7 @@ } - void SdlCairoSurface::Render(IViewport& viewport) + void SdlCairoSurface::Render(Deprecated::IViewport& viewport) { if (cairoSurface_.get() == NULL) {
--- a/Applications/Sdl/SdlCairoSurface.h Mon May 20 16:26:34 2019 +0200 +++ b/Applications/Sdl/SdlCairoSurface.h Tue May 21 11:43:25 2019 +0200 @@ -46,7 +46,7 @@ void SetSize(unsigned int width, unsigned int height); - void Render(IViewport& viewport); + void Render(Deprecated::IViewport& viewport); }; }
--- a/Applications/Sdl/SdlEngine.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Applications/Sdl/SdlEngine.cpp Tue May 21 11:43:25 2019 +0200 @@ -146,15 +146,15 @@ switch (event.button.button) { case SDL_BUTTON_LEFT: - locker.GetCentralViewport().MouseDown(MouseButton_Left, event.button.x, event.button.y, modifiers, std::vector<Touch>()); + locker.GetCentralViewport().MouseDown(MouseButton_Left, event.button.x, event.button.y, modifiers, std::vector<Deprecated::Touch>()); break; case SDL_BUTTON_RIGHT: - locker.GetCentralViewport().MouseDown(MouseButton_Right, event.button.x, event.button.y, modifiers, std::vector<Touch>()); + locker.GetCentralViewport().MouseDown(MouseButton_Right, event.button.x, event.button.y, modifiers, std::vector<Deprecated::Touch>()); break; case SDL_BUTTON_MIDDLE: - locker.GetCentralViewport().MouseDown(MouseButton_Middle, event.button.x, event.button.y, modifiers, std::vector<Touch>()); + locker.GetCentralViewport().MouseDown(MouseButton_Middle, event.button.x, event.button.y, modifiers, std::vector<Deprecated::Touch>()); break; default: @@ -163,7 +163,7 @@ } else if (event.type == SDL_MOUSEMOTION) { - locker.GetCentralViewport().MouseMove(event.button.x, event.button.y, std::vector<Touch>()); + locker.GetCentralViewport().MouseMove(event.button.x, event.button.y, std::vector<Deprecated::Touch>()); } else if (event.type == SDL_MOUSEBUTTONUP) {
--- a/Applications/Sdl/SdlEngine.h Mon May 20 16:26:34 2019 +0200 +++ b/Applications/Sdl/SdlEngine.h Tue May 21 11:43:25 2019 +0200 @@ -49,7 +49,7 @@ NativeStoneApplicationContext& context, MessageBroker& broker); - void OnViewportChanged(const IViewport::ViewportChangedMessage& message) + void OnViewportChanged(const Deprecated::IViewport::ViewportChangedMessage& message) { viewportChanged_ = true; }
--- a/Applications/Sdl/SdlStoneApplicationRunner.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Applications/Sdl/SdlStoneApplicationRunner.cpp Tue May 21 11:43:25 2019 +0200 @@ -110,7 +110,7 @@ NativeStoneApplicationContext::GlobalMutexLocker locker(context); locker.GetCentralViewport().RegisterObserverCallback( - new Callable<SdlEngine, IViewport::ViewportChangedMessage> + new Callable<SdlEngine, Deprecated::IViewport::ViewportChangedMessage> (sdl, &SdlEngine::OnViewportChanged)); //context.GetCentralViewport().Register(sdl); // (*)
--- a/Applications/StoneApplicationContext.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Applications/StoneApplicationContext.cpp Tue May 21 11:43:25 2019 +0200 @@ -32,11 +32,11 @@ throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls); } - orthanc_.reset(new OrthancApiClient(broker_, *webService_, orthancBaseUrl_)); + orthanc_.reset(new Deprecated::OrthancApiClient(broker_, *webService_, orthancBaseUrl_)); } - IWebService& StoneApplicationContext::GetWebService() + Deprecated::IWebService& StoneApplicationContext::GetWebService() { if (webService_ == NULL) { @@ -47,7 +47,7 @@ } - OrthancApiClient& StoneApplicationContext::GetOrthancApiClient() + Deprecated::OrthancApiClient& StoneApplicationContext::GetOrthancApiClient() { if (orthanc_.get() == NULL) { @@ -58,7 +58,7 @@ } - void StoneApplicationContext::SetWebService(IWebService& webService) + void StoneApplicationContext::SetWebService(Deprecated::IWebService& webService) { webService_ = &webService; InitializeOrthanc();
--- a/Applications/StoneApplicationContext.h Mon May 20 16:26:34 2019 +0200 +++ b/Applications/StoneApplicationContext.h Tue May 21 11:43:25 2019 +0200 @@ -60,9 +60,9 @@ { private: MessageBroker& broker_; - IWebService* webService_; - IDelayedCallExecutor* delayedCallExecutor_; - std::auto_ptr<OrthancApiClient> orthanc_; + Deprecated::IWebService* webService_; + Deprecated::IDelayedCallExecutor* delayedCallExecutor_; + std::auto_ptr<Deprecated::OrthancApiClient> orthanc_; std::string orthancBaseUrl_; void InitializeOrthanc(); @@ -89,20 +89,20 @@ return webService_ != NULL; } - IWebService& GetWebService(); + Deprecated::IWebService& GetWebService(); - OrthancApiClient& GetOrthancApiClient(); + Deprecated::OrthancApiClient& GetOrthancApiClient(); - void SetWebService(IWebService& webService); + void SetWebService(Deprecated::IWebService& webService); void SetOrthancBaseUrl(const std::string& baseUrl); - void SetDelayedCallExecutor(IDelayedCallExecutor& delayedCallExecutor) + void SetDelayedCallExecutor(Deprecated::IDelayedCallExecutor& delayedCallExecutor) { delayedCallExecutor_ = &delayedCallExecutor; } - IDelayedCallExecutor& GetDelayedCallExecutor() + Deprecated::IDelayedCallExecutor& GetDelayedCallExecutor() { return *delayedCallExecutor_; }
--- a/Framework/Layers/CircleMeasureTracker.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Layers/CircleMeasureTracker.cpp Tue May 21 11:43:25 2019 +0200 @@ -24,10 +24,10 @@ #include <stdio.h> #include <boost/math/constants/constants.hpp> -namespace OrthancStone +namespace Deprecated { CircleMeasureTracker::CircleMeasureTracker(IStatusBar* statusBar, - const CoordinateSystem3D& slice, + const OrthancStone::CoordinateSystem3D& slice, double x, double y, uint8_t red, @@ -48,14 +48,14 @@ } - void CircleMeasureTracker::Render(CairoContext& context, + void CircleMeasureTracker::Render(OrthancStone::CairoContext& context, double zoom) { double x = (x1_ + x2_) / 2.0; double y = (y1_ + y2_) / 2.0; - Vector tmp; - LinearAlgebra::AssignVector(tmp, x2_ - x1_, y2_ - y1_); + OrthancStone::Vector tmp; + OrthancStone::LinearAlgebra::AssignVector(tmp, x2_ - x1_, y2_ - y1_); double r = boost::numeric::ublas::norm_2(tmp) / 2.0; context.SetSourceColor(color_[0], color_[1], color_[2]); @@ -69,14 +69,14 @@ cairo_stroke(cr); cairo_restore(cr); - context.DrawText(font_, FormatRadius(), x, y, BitmapAnchor_Center); + context.DrawText(font_, FormatRadius(), x, y, OrthancStone::BitmapAnchor_Center); } double CircleMeasureTracker::GetRadius() const // In millimeters { - Vector a = slice_.MapSliceToWorldCoordinates(x1_, y1_); - Vector b = slice_.MapSliceToWorldCoordinates(x2_, y2_); + OrthancStone::Vector a = slice_.MapSliceToWorldCoordinates(x1_, y1_); + OrthancStone::Vector b = slice_.MapSliceToWorldCoordinates(x2_, y2_); return boost::numeric::ublas::norm_2(b - a) / 2.0; }
--- a/Framework/Layers/CircleMeasureTracker.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Layers/CircleMeasureTracker.h Tue May 21 11:43:25 2019 +0200 @@ -28,13 +28,13 @@ #include <Core/Images/Font.h> -namespace OrthancStone +namespace Deprecated { class CircleMeasureTracker : public IWorldSceneMouseTracker { private: IStatusBar* statusBar_; - CoordinateSystem3D slice_; + OrthancStone::CoordinateSystem3D slice_; double x1_; double y1_; double x2_; @@ -44,7 +44,7 @@ public: CircleMeasureTracker(IStatusBar* statusBar, - const CoordinateSystem3D& slice, + const OrthancStone::CoordinateSystem3D& slice, double x, double y, uint8_t red, @@ -57,7 +57,7 @@ return true; } - virtual void Render(CairoContext& context, + virtual void Render(OrthancStone::CairoContext& context, double zoom); double GetRadius() const; // In millimeters
--- a/Framework/Layers/ColorFrameRenderer.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Layers/ColorFrameRenderer.cpp Tue May 21 11:43:25 2019 +0200 @@ -25,11 +25,12 @@ #include <Core/Images/Image.h> #include <Core/Images/ImageProcessing.h> -namespace OrthancStone +namespace Deprecated { - CairoSurface* ColorFrameRenderer::GenerateDisplay(const RenderStyle& style) + OrthancStone::CairoSurface* ColorFrameRenderer::GenerateDisplay(const RenderStyle& style) { - std::auto_ptr<CairoSurface> display(new CairoSurface(frame_->GetWidth(), frame_->GetHeight(), false /* no alpha */)); + std::auto_ptr<OrthancStone::CairoSurface> display + (new OrthancStone::CairoSurface(frame_->GetWidth(), frame_->GetHeight(), false /* no alpha */)); Orthanc::ImageAccessor target; display->GetWriteableAccessor(target); @@ -41,7 +42,7 @@ ColorFrameRenderer::ColorFrameRenderer(const Orthanc::ImageAccessor& frame, - const CoordinateSystem3D& framePlane, + const OrthancStone::CoordinateSystem3D& framePlane, double pixelSpacingX, double pixelSpacingY, bool isFullQuality) :
--- a/Framework/Layers/ColorFrameRenderer.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Layers/ColorFrameRenderer.h Tue May 21 11:43:25 2019 +0200 @@ -23,7 +23,7 @@ #include "FrameRenderer.h" -namespace OrthancStone +namespace Deprecated { class ColorFrameRenderer : public FrameRenderer { @@ -31,11 +31,11 @@ std::auto_ptr<Orthanc::ImageAccessor> frame_; // In RGB24 protected: - virtual CairoSurface* GenerateDisplay(const RenderStyle& style); + virtual OrthancStone::CairoSurface* GenerateDisplay(const RenderStyle& style); public: ColorFrameRenderer(const Orthanc::ImageAccessor& frame, - const CoordinateSystem3D& framePlane, + const OrthancStone::CoordinateSystem3D& framePlane, double pixelSpacingX, double pixelSpacingY, bool isFullQuality);
--- a/Framework/Layers/DicomSeriesVolumeSlicer.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Layers/DicomSeriesVolumeSlicer.cpp Tue May 21 11:43:25 2019 +0200 @@ -29,7 +29,7 @@ #include <boost/lexical_cast.hpp> -namespace OrthancStone +namespace Deprecated { void DicomSeriesVolumeSlicer::OnSliceGeometryReady(const OrthancSlicesLoader::SliceGeometryReadyMessage& message) @@ -63,8 +63,8 @@ virtual ILayerRenderer* CreateRenderer() const { - bool isFull = (message_.GetEffectiveQuality() == SliceImageQuality_FullPng || - message_.GetEffectiveQuality() == SliceImageQuality_FullPam); + bool isFull = (message_.GetEffectiveQuality() == OrthancStone::SliceImageQuality_FullPng || + message_.GetEffectiveQuality() == OrthancStone::SliceImageQuality_FullPam); return FrameRenderer::CreateRenderer(message_.GetImage(), message_.GetSlice(), isFull); } @@ -87,26 +87,27 @@ } - DicomSeriesVolumeSlicer::DicomSeriesVolumeSlicer(MessageBroker& broker, OrthancApiClient& orthanc) : + DicomSeriesVolumeSlicer::DicomSeriesVolumeSlicer(OrthancStone::MessageBroker& broker, + OrthancApiClient& orthanc) : IVolumeSlicer(broker), IObserver(broker), loader_(broker, orthanc), - quality_(SliceImageQuality_FullPng) + quality_(OrthancStone::SliceImageQuality_FullPng) { loader_.RegisterObserverCallback( - new Callable<DicomSeriesVolumeSlicer, OrthancSlicesLoader::SliceGeometryReadyMessage> + new OrthancStone::Callable<DicomSeriesVolumeSlicer, OrthancSlicesLoader::SliceGeometryReadyMessage> (*this, &DicomSeriesVolumeSlicer::OnSliceGeometryReady)); loader_.RegisterObserverCallback( - new Callable<DicomSeriesVolumeSlicer, OrthancSlicesLoader::SliceGeometryErrorMessage> + new OrthancStone::Callable<DicomSeriesVolumeSlicer, OrthancSlicesLoader::SliceGeometryErrorMessage> (*this, &DicomSeriesVolumeSlicer::OnSliceGeometryError)); loader_.RegisterObserverCallback( - new Callable<DicomSeriesVolumeSlicer, OrthancSlicesLoader::SliceImageReadyMessage> + new OrthancStone::Callable<DicomSeriesVolumeSlicer, OrthancSlicesLoader::SliceImageReadyMessage> (*this, &DicomSeriesVolumeSlicer::OnSliceImageReady)); loader_.RegisterObserverCallback( - new Callable<DicomSeriesVolumeSlicer, OrthancSlicesLoader::SliceImageErrorMessage> + new OrthancStone::Callable<DicomSeriesVolumeSlicer, OrthancSlicesLoader::SliceImageErrorMessage> (*this, &DicomSeriesVolumeSlicer::OnSliceImageError)); } @@ -130,8 +131,8 @@ } - bool DicomSeriesVolumeSlicer::GetExtent(std::vector<Vector>& points, - const CoordinateSystem3D& viewportSlice) + bool DicomSeriesVolumeSlicer::GetExtent(std::vector<OrthancStone::Vector>& points, + const OrthancStone::CoordinateSystem3D& viewportSlice) { size_t index; @@ -148,7 +149,7 @@ } - void DicomSeriesVolumeSlicer::ScheduleLayerCreation(const CoordinateSystem3D& viewportSlice) + void DicomSeriesVolumeSlicer::ScheduleLayerCreation(const OrthancStone::CoordinateSystem3D& viewportSlice) { size_t index;
--- a/Framework/Layers/DicomSeriesVolumeSlicer.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Layers/DicomSeriesVolumeSlicer.h Tue May 21 11:43:25 2019 +0200 @@ -26,32 +26,32 @@ #include "../Toolbox/OrthancSlicesLoader.h" #include "../Toolbox/OrthancApiClient.h" -namespace OrthancStone +namespace Deprecated { // this class is in charge of loading a Frame. // once it's been loaded (first the geometry and then the image), // messages are sent to observers so they can use it class DicomSeriesVolumeSlicer : public IVolumeSlicer, - public IObserver + public OrthancStone::IObserver //private OrthancSlicesLoader::ISliceLoaderObserver { public: // TODO: Add "frame" and "instanceId" - class FrameReadyMessage : public OriginMessage<DicomSeriesVolumeSlicer> + class FrameReadyMessage : public OrthancStone::OriginMessage<DicomSeriesVolumeSlicer> { ORTHANC_STONE_MESSAGE(__FILE__, __LINE__); private: const Orthanc::ImageAccessor& frame_; - SliceImageQuality imageQuality_; - const Deprecated::Slice& slice_; + OrthancStone::SliceImageQuality imageQuality_; + const Slice& slice_; public: FrameReadyMessage(DicomSeriesVolumeSlicer& origin, const Orthanc::ImageAccessor& frame, - SliceImageQuality imageQuality, - const Deprecated::Slice& slice) : + OrthancStone::SliceImageQuality imageQuality, + const Slice& slice) : OriginMessage(origin), frame_(frame), imageQuality_(imageQuality), @@ -64,12 +64,12 @@ return frame_; } - SliceImageQuality GetImageQuality() const + OrthancStone::SliceImageQuality GetImageQuality() const { return imageQuality_; } - const Deprecated::Slice& GetSlice() const + const Slice& GetSlice() const { return slice_; } @@ -80,10 +80,11 @@ class RendererFactory; OrthancSlicesLoader loader_; - SliceImageQuality quality_; + OrthancStone::SliceImageQuality quality_; public: - DicomSeriesVolumeSlicer(MessageBroker& broker, OrthancApiClient& orthanc); + DicomSeriesVolumeSlicer(OrthancStone::MessageBroker& broker, + OrthancApiClient& orthanc); void LoadSeries(const std::string& seriesId); @@ -92,12 +93,12 @@ void LoadFrame(const std::string& instanceId, unsigned int frame); - void SetImageQuality(SliceImageQuality quality) + void SetImageQuality(OrthancStone::SliceImageQuality quality) { quality_ = quality; } - SliceImageQuality GetImageQuality() const + OrthancStone::SliceImageQuality GetImageQuality() const { return quality_; } @@ -107,15 +108,15 @@ return loader_.GetSlicesCount(); } - const Deprecated::Slice& GetSlice(size_t slice) const + const Slice& GetSlice(size_t slice) const { return loader_.GetSlice(slice); } - virtual bool GetExtent(std::vector<Vector>& points, - const CoordinateSystem3D& viewportSlice); + virtual bool GetExtent(std::vector<OrthancStone::Vector>& points, + const OrthancStone::CoordinateSystem3D& viewportSlice); - virtual void ScheduleLayerCreation(const CoordinateSystem3D& viewportSlice); + virtual void ScheduleLayerCreation(const OrthancStone::CoordinateSystem3D& viewportSlice); protected: void OnSliceGeometryReady(const OrthancSlicesLoader::SliceGeometryReadyMessage& message);
--- a/Framework/Layers/DicomStructureSetSlicer.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Layers/DicomStructureSetSlicer.cpp Tue May 21 11:43:25 2019 +0200 @@ -21,7 +21,7 @@ #include "DicomStructureSetSlicer.h" -namespace OrthancStone +namespace Deprecated { class DicomStructureSetSlicer::Renderer : public ILayerRenderer { @@ -34,11 +34,11 @@ uint8_t green_; uint8_t blue_; std::string name_; - std::vector< std::vector<DicomStructureSet::PolygonPoint> > polygons_; + std::vector< std::vector<OrthancStone::DicomStructureSet::PolygonPoint> > polygons_; public: - Structure(DicomStructureSet& structureSet, - const CoordinateSystem3D& plane, + Structure(OrthancStone::DicomStructureSet& structureSet, + const OrthancStone::CoordinateSystem3D& plane, size_t index) : name_(structureSet.GetStructureName(index)) { @@ -46,7 +46,7 @@ visible_ = structureSet.ProjectStructure(polygons_, index, plane); } - void Render(CairoContext& context) + void Render(OrthancStone::CairoContext& context) { if (visible_) { @@ -72,12 +72,12 @@ typedef std::list<Structure*> Structures; - CoordinateSystem3D plane_; + OrthancStone::CoordinateSystem3D plane_; Structures structures_; public: - Renderer(DicomStructureSet& structureSet, - const CoordinateSystem3D& plane) : + Renderer(OrthancStone::DicomStructureSet& structureSet, + const OrthancStone::CoordinateSystem3D& plane) : plane_(plane) { for (size_t k = 0; k < structureSet.GetStructureCount(); k++) @@ -95,7 +95,7 @@ } } - virtual bool RenderLayer(CairoContext& context, + virtual bool RenderLayer(OrthancStone::CairoContext& context, const ViewportGeometry& view) { cairo_set_line_width(context.GetObject(), 2.0f / view.GetZoom()); @@ -110,7 +110,7 @@ return true; } - virtual const CoordinateSystem3D& GetLayerPlane() + virtual const OrthancStone::CoordinateSystem3D& GetLayerPlane() { return plane_; } @@ -129,12 +129,12 @@ class DicomStructureSetSlicer::RendererFactory : public LayerReadyMessage::IRendererFactory { private: - DicomStructureSet& structureSet_; - const CoordinateSystem3D& plane_; + OrthancStone::DicomStructureSet& structureSet_; + const OrthancStone::CoordinateSystem3D& plane_; public: - RendererFactory(DicomStructureSet& structureSet, - const CoordinateSystem3D& plane) : + RendererFactory(OrthancStone::DicomStructureSet& structureSet, + const OrthancStone::CoordinateSystem3D& plane) : structureSet_(structureSet), plane_(plane) { @@ -147,19 +147,19 @@ }; - DicomStructureSetSlicer::DicomStructureSetSlicer(MessageBroker& broker, + DicomStructureSetSlicer::DicomStructureSetSlicer(OrthancStone::MessageBroker& broker, StructureSetLoader& loader) : IVolumeSlicer(broker), IObserver(broker), loader_(loader) { loader_.RegisterObserverCallback( - new Callable<DicomStructureSetSlicer, StructureSetLoader::ContentChangedMessage> + new OrthancStone::Callable<DicomStructureSetSlicer, StructureSetLoader::ContentChangedMessage> (*this, &DicomStructureSetSlicer::OnStructureSetLoaded)); } - void DicomStructureSetSlicer::ScheduleLayerCreation(const CoordinateSystem3D& viewportPlane) + void DicomStructureSetSlicer::ScheduleLayerCreation(const OrthancStone::CoordinateSystem3D& viewportPlane) { if (loader_.HasStructureSet()) {
--- a/Framework/Layers/DicomStructureSetSlicer.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Layers/DicomStructureSetSlicer.h Tue May 21 11:43:25 2019 +0200 @@ -24,11 +24,11 @@ #include "IVolumeSlicer.h" #include "../Volumes/StructureSetLoader.h" -namespace OrthancStone +namespace Deprecated { class DicomStructureSetSlicer : public IVolumeSlicer, - public IObserver + public OrthancStone::IObserver { private: class Renderer; @@ -42,15 +42,15 @@ } public: - DicomStructureSetSlicer(MessageBroker& broker, + DicomStructureSetSlicer(OrthancStone::MessageBroker& broker, StructureSetLoader& loader); - virtual bool GetExtent(std::vector<Vector>& points, - const CoordinateSystem3D& viewportPlane) + virtual bool GetExtent(std::vector<OrthancStone::Vector>& points, + const OrthancStone::CoordinateSystem3D& viewportPlane) { return false; } - virtual void ScheduleLayerCreation(const CoordinateSystem3D& viewportPlane); + virtual void ScheduleLayerCreation(const OrthancStone::CoordinateSystem3D& viewportPlane); }; }
--- a/Framework/Layers/FrameRenderer.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Layers/FrameRenderer.cpp Tue May 21 11:43:25 2019 +0200 @@ -26,9 +26,9 @@ #include <Core/OrthancException.h> -namespace OrthancStone +namespace Deprecated { - FrameRenderer::FrameRenderer(const CoordinateSystem3D& framePlane, + FrameRenderer::FrameRenderer(const OrthancStone::CoordinateSystem3D& framePlane, double pixelSpacingX, double pixelSpacingY, bool isFullQuality) : @@ -40,7 +40,7 @@ } - bool FrameRenderer::RenderLayer(CairoContext& context, + bool FrameRenderer::RenderLayer(OrthancStone::CairoContext& context, const ViewportGeometry& view) { if (!style_.visible_) @@ -70,11 +70,11 @@ switch (style_.interpolation_) { - case ImageInterpolation_Nearest: + case OrthancStone::ImageInterpolation_Nearest: cairo_pattern_set_filter(cairo_get_source(cr), CAIRO_FILTER_NEAREST); break; - case ImageInterpolation_Bilinear: + case OrthancStone::ImageInterpolation_Bilinear: cairo_pattern_set_filter(cairo_get_source(cr), CAIRO_FILTER_BILINEAR); break;
--- a/Framework/Layers/FrameRenderer.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Layers/FrameRenderer.h Tue May 21 11:43:25 2019 +0200 @@ -25,31 +25,31 @@ #include "../Toolbox/Slice.h" -namespace OrthancStone +namespace Deprecated { class FrameRenderer : public ILayerRenderer { private: - CoordinateSystem3D framePlane_; + OrthancStone::CoordinateSystem3D framePlane_; double pixelSpacingX_; double pixelSpacingY_; RenderStyle style_; bool isFullQuality_; - std::auto_ptr<CairoSurface> display_; + std::auto_ptr<OrthancStone::CairoSurface> display_; protected: - virtual CairoSurface* GenerateDisplay(const RenderStyle& style) = 0; + virtual OrthancStone::CairoSurface* GenerateDisplay(const RenderStyle& style) = 0; public: - FrameRenderer(const CoordinateSystem3D& framePlane, + FrameRenderer(const OrthancStone::CoordinateSystem3D& framePlane, double pixelSpacingX, double pixelSpacingY, bool isFullQuality); - virtual bool RenderLayer(CairoContext& context, + virtual bool RenderLayer(OrthancStone::CairoContext& context, const ViewportGeometry& view); - virtual const CoordinateSystem3D& GetLayerPlane() + virtual const OrthancStone::CoordinateSystem3D& GetLayerPlane() { return framePlane_; }
--- a/Framework/Layers/GrayscaleFrameRenderer.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Layers/GrayscaleFrameRenderer.cpp Tue May 21 11:43:25 2019 +0200 @@ -24,13 +24,13 @@ #include <Core/Images/Image.h> #include <Core/OrthancException.h> -namespace OrthancStone +namespace Deprecated { - CairoSurface* GrayscaleFrameRenderer::GenerateDisplay(const RenderStyle& style) + OrthancStone::CairoSurface* GrayscaleFrameRenderer::GenerateDisplay(const RenderStyle& style) { assert(frame_->GetFormat() == Orthanc::PixelFormat_Float32); - std::auto_ptr<CairoSurface> result; + std::auto_ptr<OrthancStone::CairoSurface> result; float windowCenter, windowWidth; style.ComputeWindowing(windowCenter, windowWidth, @@ -41,7 +41,7 @@ //LOG(INFO) << "Window: " << x0 << " => " << x1; - result.reset(new CairoSurface(frame_->GetWidth(), frame_->GetHeight(), false /* no alpha */)); + result.reset(new OrthancStone::CairoSurface(frame_->GetWidth(), frame_->GetHeight(), false /* no alpha */)); const uint8_t* lut = NULL; if (style.applyLut_) @@ -115,7 +115,7 @@ GrayscaleFrameRenderer::GrayscaleFrameRenderer(const Orthanc::ImageAccessor& frame, const Deprecated::DicomFrameConverter& converter, - const CoordinateSystem3D& framePlane, + const OrthancStone::CoordinateSystem3D& framePlane, double pixelSpacingX, double pixelSpacingY, bool isFullQuality) :
--- a/Framework/Layers/GrayscaleFrameRenderer.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Layers/GrayscaleFrameRenderer.h Tue May 21 11:43:25 2019 +0200 @@ -24,7 +24,7 @@ #include "FrameRenderer.h" #include "../Toolbox/DicomFrameConverter.h" -namespace OrthancStone +namespace Deprecated { class GrayscaleFrameRenderer : public FrameRenderer { @@ -35,12 +35,12 @@ Orthanc::PhotometricInterpretation photometric_; protected: - virtual CairoSurface* GenerateDisplay(const RenderStyle& style); + virtual OrthancStone::CairoSurface* GenerateDisplay(const RenderStyle& style); public: GrayscaleFrameRenderer(const Orthanc::ImageAccessor& frame, const Deprecated::DicomFrameConverter& converter, - const CoordinateSystem3D& framePlane, + const OrthancStone::CoordinateSystem3D& framePlane, double pixelSpacingX, double pixelSpacingY, bool isFullQuality);
--- a/Framework/Layers/ILayerRenderer.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Layers/ILayerRenderer.h Tue May 21 11:43:25 2019 +0200 @@ -26,7 +26,7 @@ #include "../Toolbox/ViewportGeometry.h" #include "RenderStyle.h" -namespace OrthancStone +namespace Deprecated { class ILayerRenderer : public boost::noncopyable { @@ -35,12 +35,12 @@ { } - virtual bool RenderLayer(CairoContext& context, + virtual bool RenderLayer(OrthancStone::CairoContext& context, const ViewportGeometry& view) = 0; virtual void SetLayerStyle(const RenderStyle& style) = 0; - virtual const CoordinateSystem3D& GetLayerPlane() = 0; + virtual const OrthancStone::CoordinateSystem3D& GetLayerPlane() = 0; virtual bool IsFullQuality() = 0; };
--- a/Framework/Layers/IVolumeSlicer.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Layers/IVolumeSlicer.h Tue May 21 11:43:25 2019 +0200 @@ -28,16 +28,16 @@ #include "Core/Images/Image.h" #include <boost/shared_ptr.hpp> -namespace OrthancStone +namespace Deprecated { - class IVolumeSlicer : public IObservable + class IVolumeSlicer : public OrthancStone::IObservable { public: ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, GeometryReadyMessage, IVolumeSlicer); ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, GeometryErrorMessage, IVolumeSlicer); ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, ContentChangedMessage, IVolumeSlicer); - class SliceContentChangedMessage : public OriginMessage<IVolumeSlicer> + class SliceContentChangedMessage : public OrthancStone::OriginMessage<IVolumeSlicer> { ORTHANC_STONE_MESSAGE(__FILE__, __LINE__); @@ -59,7 +59,7 @@ }; - class LayerReadyMessage : public OriginMessage<IVolumeSlicer> + class LayerReadyMessage : public OrthancStone::OriginMessage<IVolumeSlicer> { ORTHANC_STONE_MESSAGE(__FILE__, __LINE__); @@ -76,12 +76,12 @@ private: const IRendererFactory& factory_; - const CoordinateSystem3D& slice_; + const OrthancStone::CoordinateSystem3D& slice_; public: LayerReadyMessage(IVolumeSlicer& origin, const IRendererFactory& rendererFactory, - const CoordinateSystem3D& slice) : + const OrthancStone::CoordinateSystem3D& slice) : OriginMessage(origin), factory_(rendererFactory), slice_(slice) @@ -93,36 +93,36 @@ return factory_.CreateRenderer(); } - const CoordinateSystem3D& GetSlice() const + const OrthancStone::CoordinateSystem3D& GetSlice() const { return slice_; } }; - class LayerErrorMessage : public OriginMessage<IVolumeSlicer> + class LayerErrorMessage : public OrthancStone::OriginMessage<IVolumeSlicer> { ORTHANC_STONE_MESSAGE(__FILE__, __LINE__); private: - const CoordinateSystem3D& slice_; + const OrthancStone::CoordinateSystem3D& slice_; public: LayerErrorMessage(IVolumeSlicer& origin, - const CoordinateSystem3D& slice) : + const OrthancStone::CoordinateSystem3D& slice) : OriginMessage(origin), slice_(slice) { } - const CoordinateSystem3D& GetSlice() const + const OrthancStone::CoordinateSystem3D& GetSlice() const { return slice_; } }; - IVolumeSlicer(MessageBroker& broker) : + IVolumeSlicer(OrthancStone::MessageBroker& broker) : IObservable(broker) { } @@ -131,9 +131,9 @@ { } - virtual bool GetExtent(std::vector<Vector>& points, - const CoordinateSystem3D& viewportSlice) = 0; + virtual bool GetExtent(std::vector<OrthancStone::Vector>& points, + const OrthancStone::CoordinateSystem3D& viewportSlice) = 0; - virtual void ScheduleLayerCreation(const CoordinateSystem3D& viewportSlice) = 0; + virtual void ScheduleLayerCreation(const OrthancStone::CoordinateSystem3D& viewportSlice) = 0; }; }
--- a/Framework/Layers/LineLayerRenderer.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Layers/LineLayerRenderer.cpp Tue May 21 11:43:25 2019 +0200 @@ -21,13 +21,13 @@ #include "LineLayerRenderer.h" -namespace OrthancStone +namespace Deprecated { LineLayerRenderer::LineLayerRenderer(double x1, double y1, double x2, double y2, - const CoordinateSystem3D& plane) : + const OrthancStone::CoordinateSystem3D& plane) : x1_(x1), y1_(y1), x2_(x2), @@ -39,7 +39,7 @@ } - bool LineLayerRenderer::RenderLayer(CairoContext& context, + bool LineLayerRenderer::RenderLayer(OrthancStone::CairoContext& context, const ViewportGeometry& view) { if (visible_)
--- a/Framework/Layers/LineLayerRenderer.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Layers/LineLayerRenderer.h Tue May 21 11:43:25 2019 +0200 @@ -23,7 +23,7 @@ #include "ILayerRenderer.h" -namespace OrthancStone +namespace Deprecated { class LineLayerRenderer : public ILayerRenderer { @@ -32,7 +32,7 @@ double y1_; double x2_; double y2_; - CoordinateSystem3D plane_; + OrthancStone::CoordinateSystem3D plane_; bool visible_; uint8_t color_[3]; @@ -41,14 +41,14 @@ double y1, double x2, double y2, - const CoordinateSystem3D& plane); + const OrthancStone::CoordinateSystem3D& plane); - virtual bool RenderLayer(CairoContext& context, + virtual bool RenderLayer(OrthancStone::CairoContext& context, const ViewportGeometry& view); virtual void SetLayerStyle(const RenderStyle& style); - virtual const CoordinateSystem3D& GetLayerPlane() + virtual const OrthancStone::CoordinateSystem3D& GetLayerPlane() { return plane_; }
--- a/Framework/Layers/LineMeasureTracker.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Layers/LineMeasureTracker.cpp Tue May 21 11:43:25 2019 +0200 @@ -23,10 +23,10 @@ #include <stdio.h> -namespace OrthancStone +namespace Deprecated { LineMeasureTracker::LineMeasureTracker(IStatusBar* statusBar, - const CoordinateSystem3D& slice, + const OrthancStone::CoordinateSystem3D& slice, double x, double y, uint8_t red, @@ -47,7 +47,7 @@ } - void LineMeasureTracker::Render(CairoContext& context, + void LineMeasureTracker::Render(OrthancStone::CairoContext& context, double zoom) { context.SetSourceColor(color_[0], color_[1], color_[2]); @@ -60,19 +60,19 @@ if (y2_ - y1_ < 0) { - context.DrawText(font_, FormatLength(), x2_, y2_ - 5, BitmapAnchor_BottomCenter); + context.DrawText(font_, FormatLength(), x2_, y2_ - 5, OrthancStone::BitmapAnchor_BottomCenter); } else { - context.DrawText(font_, FormatLength(), x2_, y2_ + 5, BitmapAnchor_TopCenter); + context.DrawText(font_, FormatLength(), x2_, y2_ + 5, OrthancStone::BitmapAnchor_TopCenter); } } double LineMeasureTracker::GetLength() const // In millimeters { - Vector a = slice_.MapSliceToWorldCoordinates(x1_, y1_); - Vector b = slice_.MapSliceToWorldCoordinates(x2_, y2_); + OrthancStone::Vector a = slice_.MapSliceToWorldCoordinates(x1_, y1_); + OrthancStone::Vector b = slice_.MapSliceToWorldCoordinates(x2_, y2_); return boost::numeric::ublas::norm_2(b - a); }
--- a/Framework/Layers/LineMeasureTracker.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Layers/LineMeasureTracker.h Tue May 21 11:43:25 2019 +0200 @@ -26,13 +26,13 @@ #include "../Viewport/IStatusBar.h" #include "../Toolbox/CoordinateSystem3D.h" -namespace OrthancStone +namespace Deprecated { class LineMeasureTracker : public IWorldSceneMouseTracker { private: IStatusBar* statusBar_; - CoordinateSystem3D slice_; + OrthancStone::CoordinateSystem3D slice_; double x1_; double y1_; double x2_; @@ -43,7 +43,7 @@ public: LineMeasureTracker(IStatusBar* statusBar, - const CoordinateSystem3D& slice, + const OrthancStone::CoordinateSystem3D& slice, double x, double y, uint8_t red, @@ -56,7 +56,7 @@ return true; } - virtual void Render(CairoContext& context, + virtual void Render(OrthancStone::CairoContext& context, double zoom); double GetLength() const; // In millimeters
--- a/Framework/Layers/RenderStyle.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Layers/RenderStyle.cpp Tue May 21 11:43:25 2019 +0200 @@ -23,13 +23,13 @@ #include <Core/OrthancException.h> -namespace OrthancStone +namespace Deprecated { RenderStyle::RenderStyle() { visible_ = true; reverse_ = false; - windowing_ = ImageWindowing_Custom; + windowing_ = OrthancStone::ImageWindowing_Custom; alpha_ = 1; applyLut_ = false; lut_ = Orthanc::EmbeddedResources::COLORMAP_HOT; @@ -39,7 +39,7 @@ drawColor_[2] = 255; customWindowCenter_ = 128; customWindowWidth_ = 256; - interpolation_ = ImageInterpolation_Nearest; + interpolation_ = OrthancStone::ImageInterpolation_Nearest; fontSize_ = 14; } @@ -49,7 +49,7 @@ float defaultCenter, float defaultWidth) const { - if (windowing_ == ImageWindowing_Custom) + if (windowing_ == OrthancStone::ImageWindowing_Custom) { targetCenter = customWindowCenter_; targetWidth = customWindowWidth_;
--- a/Framework/Layers/RenderStyle.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Layers/RenderStyle.h Tue May 21 11:43:25 2019 +0200 @@ -27,13 +27,13 @@ #include <stdint.h> -namespace OrthancStone +namespace Deprecated { struct RenderStyle { bool visible_; bool reverse_; - ImageWindowing windowing_; + OrthancStone::ImageWindowing windowing_; float alpha_; // In [0,1] bool applyLut_; Orthanc::EmbeddedResources::FileResourceId lut_; @@ -41,7 +41,7 @@ uint8_t drawColor_[3]; float customWindowCenter_; float customWindowWidth_; - ImageInterpolation interpolation_; + OrthancStone::ImageInterpolation interpolation_; unsigned int fontSize_; RenderStyle();
--- a/Framework/Layers/SeriesFrameRendererFactory.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Layers/SeriesFrameRendererFactory.cpp Tue May 21 11:43:25 2019 +0200 @@ -30,7 +30,7 @@ #include <Plugins/Samples/Common/DicomDatasetReader.h> -namespace OrthancStone +namespace Deprecated { void SeriesFrameRendererFactory::ReadCurrentFrameDataset(size_t frame) {
--- a/Framework/Layers/SeriesFrameRendererFactory.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Layers/SeriesFrameRendererFactory.h Tue May 21 11:43:25 2019 +0200 @@ -25,7 +25,7 @@ #include "../Toolbox/ISeriesLoader.h" -namespace OrthancStone +namespace Deprecated { class SeriesFrameRendererFactory : public ILayerRendererFactory {
--- a/Framework/Layers/SingleFrameRendererFactory.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Layers/SingleFrameRendererFactory.cpp Tue May 21 11:43:25 2019 +0200 @@ -29,7 +29,7 @@ #include <Plugins/Samples/Common/FullOrthancDataset.h> #include <Plugins/Samples/Common/DicomDatasetReader.h> -namespace OrthancStone +namespace Deprecated { SingleFrameRendererFactory::SingleFrameRendererFactory(OrthancPlugins::IOrthancConnection& orthanc, const std::string& instanceId,
--- a/Framework/Layers/SingleFrameRendererFactory.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Layers/SingleFrameRendererFactory.h Tue May 21 11:43:25 2019 +0200 @@ -24,7 +24,7 @@ #include "ILayerRendererFactory.h" #include <Plugins/Samples/Common/IOrthancConnection.h> -namespace OrthancStone +namespace Deprecated { class SingleFrameRendererFactory : public ILayerRendererFactory {
--- a/Framework/Layers/SliceOutlineRenderer.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Layers/SliceOutlineRenderer.cpp Tue May 21 11:43:25 2019 +0200 @@ -21,9 +21,9 @@ #include "SliceOutlineRenderer.h" -namespace OrthancStone +namespace Deprecated { - bool SliceOutlineRenderer::RenderLayer(CairoContext& context, + bool SliceOutlineRenderer::RenderLayer(OrthancStone::CairoContext& context, const ViewportGeometry& view) { if (style_.visible_)
--- a/Framework/Layers/SliceOutlineRenderer.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Layers/SliceOutlineRenderer.h Tue May 21 11:43:25 2019 +0200 @@ -24,12 +24,12 @@ #include "ILayerRenderer.h" #include "../Toolbox/Slice.h" -namespace OrthancStone +namespace Deprecated { class SliceOutlineRenderer : public ILayerRenderer { private: - CoordinateSystem3D geometry_; + OrthancStone::CoordinateSystem3D geometry_; double pixelSpacingX_; double pixelSpacingY_; unsigned int width_; @@ -37,7 +37,7 @@ RenderStyle style_; public: - SliceOutlineRenderer(const Deprecated::Slice& slice) : + SliceOutlineRenderer(const Slice& slice) : geometry_(slice.GetGeometry()), pixelSpacingX_(slice.GetPixelSpacingX()), pixelSpacingY_(slice.GetPixelSpacingY()), @@ -46,7 +46,7 @@ { } - virtual bool RenderLayer(CairoContext& context, + virtual bool RenderLayer(OrthancStone::CairoContext& context, const ViewportGeometry& view); virtual void SetLayerStyle(const RenderStyle& style) @@ -54,7 +54,7 @@ style_ = style; } - virtual const CoordinateSystem3D& GetLayerSlice() + virtual const OrthancStone::CoordinateSystem3D& GetLayerSlice() { return geometry_; }
--- a/Framework/Radiography/RadiographyLayerCropTracker.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Radiography/RadiographyLayerCropTracker.cpp Tue May 21 11:43:25 2019 +0200 @@ -66,7 +66,7 @@ RadiographyLayerCropTracker::RadiographyLayerCropTracker(UndoRedoStack& undoRedoStack, RadiographyScene& scene, - const ViewportGeometry& view, + const Deprecated::ViewportGeometry& view, size_t layer, const ControlPoint& startControlPoint) : undoRedoStack_(undoRedoStack), @@ -100,8 +100,8 @@ int displayY, double sceneX, double sceneY, - const std::vector<Touch>& displayTouches, - const std::vector<Touch>& sceneTouches) + const std::vector<Deprecated::Touch>& displayTouches, + const std::vector<Deprecated::Touch>& sceneTouches) { if (accessor_.IsValid()) {
--- a/Framework/Radiography/RadiographyLayerCropTracker.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Radiography/RadiographyLayerCropTracker.h Tue May 21 11:43:25 2019 +0200 @@ -28,7 +28,7 @@ namespace OrthancStone { - class RadiographyLayerCropTracker : public IWorldSceneMouseTracker + class RadiographyLayerCropTracker : public Deprecated::IWorldSceneMouseTracker { private: class UndoRedoCommand; @@ -44,7 +44,7 @@ public: RadiographyLayerCropTracker(UndoRedoStack& undoRedoStack, RadiographyScene& scene, - const ViewportGeometry& view, + const Deprecated::ViewportGeometry& view, size_t layer, const ControlPoint& startControlPoint); @@ -62,7 +62,7 @@ int displayY, double sceneX, double sceneY, - const std::vector<Touch>& displayTouches, - const std::vector<Touch>& sceneTouches); + const std::vector<Deprecated::Touch>& displayTouches, + const std::vector<Deprecated::Touch>& sceneTouches); }; }
--- a/Framework/Radiography/RadiographyLayerMaskTracker.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Radiography/RadiographyLayerMaskTracker.cpp Tue May 21 11:43:25 2019 +0200 @@ -85,7 +85,7 @@ RadiographyLayerMaskTracker::RadiographyLayerMaskTracker(UndoRedoStack& undoRedoStack, RadiographyScene& scene, - const ViewportGeometry& view, + const Deprecated::ViewportGeometry& view, size_t layer, const ControlPoint& startSceneControlPoint) : undoRedoStack_(undoRedoStack), @@ -116,8 +116,8 @@ int displayY, double sceneX, double sceneY, - const std::vector<Touch>& displayTouches, - const std::vector<Touch>& sceneTouches) + const std::vector<Deprecated::Touch>& displayTouches, + const std::vector<Deprecated::Touch>& sceneTouches) { if (accessor_.IsValid()) {
--- a/Framework/Radiography/RadiographyLayerMaskTracker.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Radiography/RadiographyLayerMaskTracker.h Tue May 21 11:43:25 2019 +0200 @@ -28,7 +28,7 @@ namespace OrthancStone { - class RadiographyLayerMaskTracker : public IWorldSceneMouseTracker + class RadiographyLayerMaskTracker : public Deprecated::IWorldSceneMouseTracker { private: class UndoRedoCommand; @@ -41,7 +41,7 @@ public: RadiographyLayerMaskTracker(UndoRedoStack& undoRedoStack, RadiographyScene& scene, - const ViewportGeometry& view, + const Deprecated::ViewportGeometry& view, size_t layer, const ControlPoint& startSceneControlPoint); @@ -59,7 +59,7 @@ int displayY, double sceneX, double sceneY, - const std::vector<Touch>& displayTouches, - const std::vector<Touch>& sceneTouches); + const std::vector<Deprecated::Touch>& displayTouches, + const std::vector<Deprecated::Touch>& sceneTouches); }; }
--- a/Framework/Radiography/RadiographyLayerMoveTracker.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Radiography/RadiographyLayerMoveTracker.cpp Tue May 21 11:43:25 2019 +0200 @@ -98,8 +98,8 @@ int displayY, double sceneX, double sceneY, - const std::vector<Touch>& displayTouches, - const std::vector<Touch>& sceneTouches) + const std::vector<Deprecated::Touch>& displayTouches, + const std::vector<Deprecated::Touch>& sceneTouches) { if (accessor_.IsValid()) {
--- a/Framework/Radiography/RadiographyLayerMoveTracker.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Radiography/RadiographyLayerMoveTracker.h Tue May 21 11:43:25 2019 +0200 @@ -27,7 +27,7 @@ namespace OrthancStone { - class RadiographyLayerMoveTracker : public IWorldSceneMouseTracker + class RadiographyLayerMoveTracker : public Deprecated::IWorldSceneMouseTracker { private: class UndoRedoCommand; @@ -62,7 +62,7 @@ int displayY, double sceneX, double sceneY, - const std::vector<Touch>& displayTouches, - const std::vector<Touch>& sceneTouches); + const std::vector<Deprecated::Touch>& displayTouches, + const std::vector<Deprecated::Touch>& sceneTouches); }; }
--- a/Framework/Radiography/RadiographyLayerResizeTracker.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Radiography/RadiographyLayerResizeTracker.cpp Tue May 21 11:43:25 2019 +0200 @@ -159,8 +159,8 @@ int displayY, double sceneX, double sceneY, - const std::vector<Touch>& displayTouches, - const std::vector<Touch>& sceneTouches) + const std::vector<Deprecated::Touch>& displayTouches, + const std::vector<Deprecated::Touch>& sceneTouches) { static const double ROUND_SCALING = 0.1;
--- a/Framework/Radiography/RadiographyLayerResizeTracker.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Radiography/RadiographyLayerResizeTracker.h Tue May 21 11:43:25 2019 +0200 @@ -27,7 +27,7 @@ namespace OrthancStone { - class RadiographyLayerResizeTracker : public IWorldSceneMouseTracker + class RadiographyLayerResizeTracker : public Deprecated::IWorldSceneMouseTracker { private: class UndoRedoCommand; @@ -63,7 +63,7 @@ int displayY, double sceneX, double sceneY, - const std::vector<Touch>& displayTouches, - const std::vector<Touch>& sceneTouches); + const std::vector<Deprecated::Touch>& displayTouches, + const std::vector<Deprecated::Touch>& sceneTouches); }; }
--- a/Framework/Radiography/RadiographyLayerRotateTracker.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Radiography/RadiographyLayerRotateTracker.cpp Tue May 21 11:43:25 2019 +0200 @@ -88,7 +88,7 @@ RadiographyLayerRotateTracker::RadiographyLayerRotateTracker(UndoRedoStack& undoRedoStack, RadiographyScene& scene, - const ViewportGeometry& view, + const Deprecated::ViewportGeometry& view, size_t layer, double x, double y, @@ -133,8 +133,8 @@ int displayY, double sceneX, double sceneY, - const std::vector<Touch>& displayTouches, - const std::vector<Touch>& sceneTouches) + const std::vector<Deprecated::Touch>& displayTouches, + const std::vector<Deprecated::Touch>& sceneTouches) { static const double ROUND_ANGLE = 15.0 / 180.0 * boost::math::constants::pi<double>();
--- a/Framework/Radiography/RadiographyLayerRotateTracker.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Radiography/RadiographyLayerRotateTracker.h Tue May 21 11:43:25 2019 +0200 @@ -29,7 +29,7 @@ namespace OrthancStone { - class RadiographyLayerRotateTracker : public IWorldSceneMouseTracker + class RadiographyLayerRotateTracker : public Deprecated::IWorldSceneMouseTracker { private: class UndoRedoCommand; @@ -49,7 +49,7 @@ public: RadiographyLayerRotateTracker(UndoRedoStack& undoRedoStack, RadiographyScene& scene, - const ViewportGeometry& view, + const Deprecated::ViewportGeometry& view, size_t layer, double x, double y, @@ -69,7 +69,7 @@ int displayY, double sceneX, double sceneY, - const std::vector<Touch>& displayTouches, - const std::vector<Touch>& sceneTouches); + const std::vector<Deprecated::Touch>& displayTouches, + const std::vector<Deprecated::Touch>& sceneTouches); }; }
--- a/Framework/Radiography/RadiographyScene.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Radiography/RadiographyScene.cpp Tue May 21 11:43:25 2019 +0200 @@ -364,7 +364,7 @@ return layer; } - RadiographyLayer& RadiographyScene::LoadDicomFrame(OrthancApiClient& orthanc, + RadiographyLayer& RadiographyScene::LoadDicomFrame(Deprecated::OrthancApiClient& orthanc, const std::string& instance, unsigned int frame, bool httpCompression, @@ -379,18 +379,18 @@ } { - IWebService::HttpHeaders headers; + Deprecated::IWebService::HttpHeaders headers; std::string uri = "/instances/" + instance + "/tags"; orthanc.GetBinaryAsync( uri, headers, - new Callable<RadiographyScene, OrthancApiClient::BinaryResponseReadyMessage> + new Callable<RadiographyScene, Deprecated::OrthancApiClient::BinaryResponseReadyMessage> (*this, &RadiographyScene::OnTagsReceived), NULL, new Orthanc::SingleValueObject<size_t>(layer.GetIndex())); } { - IWebService::HttpHeaders headers; + Deprecated::IWebService::HttpHeaders headers; headers["Accept"] = "image/x-portable-arbitrarymap"; if (httpCompression) @@ -403,7 +403,7 @@ orthanc.GetBinaryAsync( uri, headers, - new Callable<RadiographyScene, OrthancApiClient::BinaryResponseReadyMessage> + new Callable<RadiographyScene, Deprecated::OrthancApiClient::BinaryResponseReadyMessage> (*this, &RadiographyScene::OnFrameReceived), NULL, new Orthanc::SingleValueObject<size_t>(layer.GetIndex())); } @@ -412,7 +412,7 @@ } - RadiographyLayer& RadiographyScene::LoadDicomWebFrame(IWebService& web) + RadiographyLayer& RadiographyScene::LoadDicomWebFrame(Deprecated::IWebService& web) { RadiographyLayer& layer = RegisterLayer(new RadiographyDicomLayer(IObservable::GetBroker(), *this)); @@ -422,7 +422,7 @@ - void RadiographyScene::OnTagsReceived(const OrthancApiClient::BinaryResponseReadyMessage& message) + void RadiographyScene::OnTagsReceived(const Deprecated::OrthancApiClient::BinaryResponseReadyMessage& message) { size_t index = dynamic_cast<const Orthanc::SingleValueObject<size_t>&> (message.GetPayload()).GetValue(); @@ -452,7 +452,7 @@ } - void RadiographyScene::OnFrameReceived(const OrthancApiClient::BinaryResponseReadyMessage& message) + void RadiographyScene::OnFrameReceived(const Deprecated::OrthancApiClient::BinaryResponseReadyMessage& message) { size_t index = dynamic_cast<const Orthanc::SingleValueObject<size_t>&>(message.GetPayload()).GetValue(); @@ -726,7 +726,7 @@ } - void RadiographyScene::ExportDicom(OrthancApiClient& orthanc, + void RadiographyScene::ExportDicom(Deprecated::OrthancApiClient& orthanc, const Json::Value& dicomTags, const std::string& parentOrthancId, double pixelSpacingX, @@ -741,7 +741,7 @@ orthanc.PostJsonAsyncExpectJson( "/tools/create-dicom", createDicomRequestContent, - new Callable<RadiographyScene, OrthancApiClient::JsonResponseReadyMessage> + new Callable<RadiographyScene, Deprecated::OrthancApiClient::JsonResponseReadyMessage> (*this, &RadiographyScene::OnDicomExported), NULL, NULL); @@ -750,7 +750,7 @@ // Export using PAM is faster than using PNG, but requires Orthanc // core >= 1.4.3 - void RadiographyScene::ExportDicom(OrthancApiClient& orthanc, + void RadiographyScene::ExportDicom(Deprecated::OrthancApiClient& orthanc, const Orthanc::DicomMap& dicom, const std::string& parentOrthancId, double pixelSpacingX, @@ -778,19 +778,19 @@ ExportDicom(orthanc, jsonTags, parentOrthancId, pixelSpacingX, pixelSpacingY, invert, interpolation, usePam); } - void RadiographyScene::OnDicomExported(const OrthancApiClient::JsonResponseReadyMessage& message) + void RadiographyScene::OnDicomExported(const Deprecated::OrthancApiClient::JsonResponseReadyMessage& message) { LOG(INFO) << "DICOM export was successful: " << message.GetJson().toStyledString(); } - void RadiographyScene::OnDicomWebReceived(const IWebService::HttpRequestSuccessMessage& message) + void RadiographyScene::OnDicomWebReceived(const Deprecated::IWebService::HttpRequestSuccessMessage& message) { LOG(INFO) << "DICOMweb WADO-RS received: " << message.GetAnswerSize() << " bytes"; - const IWebService::HttpHeaders& h = message.GetAnswerHttpHeaders(); - for (IWebService::HttpHeaders::const_iterator + const Deprecated::IWebService::HttpHeaders& h = message.GetAnswerHttpHeaders(); + for (Deprecated::IWebService::HttpHeaders::const_iterator it = h.begin(); it != h.end(); ++it) { printf("[%s] = [%s]\n", it->first.c_str(), it->second.c_str());
--- a/Framework/Radiography/RadiographyScene.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Radiography/RadiographyScene.h Tue May 21 11:43:25 2019 +0200 @@ -149,13 +149,13 @@ protected: RadiographyLayer& RegisterLayer(RadiographyLayer* layer); - void OnTagsReceived(const OrthancApiClient::BinaryResponseReadyMessage& message); + void OnTagsReceived(const Deprecated::OrthancApiClient::BinaryResponseReadyMessage& message); - virtual void OnFrameReceived(const OrthancApiClient::BinaryResponseReadyMessage& message); + virtual void OnFrameReceived(const Deprecated::OrthancApiClient::BinaryResponseReadyMessage& message); - void OnDicomExported(const OrthancApiClient::JsonResponseReadyMessage& message); + void OnDicomExported(const Deprecated::OrthancApiClient::JsonResponseReadyMessage& message); - void OnDicomWebReceived(const IWebService::HttpRequestSuccessMessage& message); + void OnDicomWebReceived(const Deprecated::IWebService::HttpRequestSuccessMessage& message); void OnLayerEdited(const RadiographyLayer::LayerEditedMessage& message); public: @@ -197,13 +197,13 @@ PhotometricDisplayMode preferredPhotometricDisplayMode, RadiographyLayer::Geometry* geometry); - virtual RadiographyLayer& LoadDicomFrame(OrthancApiClient& orthanc, + virtual RadiographyLayer& LoadDicomFrame(Deprecated::OrthancApiClient& orthanc, const std::string& instance, unsigned int frame, bool httpCompression, RadiographyLayer::Geometry* geometry); // pass NULL if you want default geometry - RadiographyLayer& LoadDicomWebFrame(IWebService& web); + RadiographyLayer& LoadDicomWebFrame(Deprecated::IWebService& web); void RemoveLayer(size_t layerIndex); @@ -278,7 +278,7 @@ // Export using PAM is faster than using PNG, but requires Orthanc // core >= 1.4.3 - void ExportDicom(OrthancApiClient& orthanc, + void ExportDicom(Deprecated::OrthancApiClient& orthanc, const Orthanc::DicomMap& dicom, const std::string& parentOrthancId, double pixelSpacingX, @@ -287,7 +287,7 @@ ImageInterpolation interpolation, bool usePam); - void ExportDicom(OrthancApiClient& orthanc, + void ExportDicom(Deprecated::OrthancApiClient& orthanc, const Json::Value& dicomTags, const std::string& parentOrthancId, double pixelSpacingX,
--- a/Framework/Radiography/RadiographySceneReader.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Radiography/RadiographySceneReader.h Tue May 21 11:43:25 2019 +0200 @@ -26,13 +26,13 @@ #include "RadiographyDicomLayer.h" #include "RadiographyMaskLayer.h" #include "RadiographyTextLayer.h" +#include "../Toolbox/OrthancApiClient.h" + #include <json/value.h> #include <Core/Images/FontRegistry.h> namespace OrthancStone { - class OrthancApiClient; - // HACK: I had to introduce this builder class in order to be able to recreate a RadiographyScene // from a serialized scene that is passed to web-workers. // It needs some architecturing... @@ -72,10 +72,10 @@ class RadiographySceneReader : public RadiographySceneBuilder { - OrthancApiClient& orthancApiClient_; + Deprecated::OrthancApiClient& orthancApiClient_; public: - RadiographySceneReader(RadiographyScene& scene, OrthancApiClient& orthancApiClient) : + RadiographySceneReader(RadiographyScene& scene, Deprecated::OrthancApiClient& orthancApiClient) : RadiographySceneBuilder(scene), orthancApiClient_(orthancApiClient) {
--- a/Framework/Radiography/RadiographyWidget.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Radiography/RadiographyWidget.cpp Tue May 21 11:43:25 2019 +0200 @@ -151,7 +151,7 @@ bool RadiographyWidget::RenderScene(CairoContext& context, - const ViewportGeometry& view) + const Deprecated::ViewportGeometry& view) { cairo_t* cr = context.GetObject();
--- a/Framework/Radiography/RadiographyWidget.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Radiography/RadiographyWidget.h Tue May 21 11:43:25 2019 +0200 @@ -30,7 +30,7 @@ class RadiographyMaskLayer; class RadiographyWidget : - public WorldSceneWidget, + public Deprecated::WorldSceneWidget, public IObserver { private: @@ -53,7 +53,7 @@ } virtual bool RenderScene(CairoContext& context, - const ViewportGeometry& view); + const Deprecated::ViewportGeometry& view); virtual void RenderBackground(Orthanc::ImageAccessor& image, float minValue, float maxValue);
--- a/Framework/Radiography/RadiographyWindowingTracker.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Radiography/RadiographyWindowingTracker.cpp Tue May 21 11:43:25 2019 +0200 @@ -164,8 +164,8 @@ int displayY, double sceneX, double sceneY, - const std::vector<Touch>& displayTouches, - const std::vector<Touch>& sceneTouches) + const std::vector<Deprecated::Touch>& displayTouches, + const std::vector<Deprecated::Touch>& sceneTouches) { // This follows the behavior of the Osimis Web viewer: // https://bitbucket.org/osimis/osimis-webviewer-plugin/src/master/frontend/src/app/viewport/image-plugins/windowing-viewport-tool.class.js
--- a/Framework/Radiography/RadiographyWindowingTracker.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Radiography/RadiographyWindowingTracker.h Tue May 21 11:43:25 2019 +0200 @@ -27,7 +27,7 @@ namespace OrthancStone { - class RadiographyWindowingTracker : public IWorldSceneMouseTracker + class RadiographyWindowingTracker : public Deprecated::IWorldSceneMouseTracker { public: enum Action @@ -83,7 +83,7 @@ int displayY, double sceneX, double sceneY, - const std::vector<Touch>& displayTouches, - const std::vector<Touch>& sceneTouches); + const std::vector<Deprecated::Touch>& displayTouches, + const std::vector<Deprecated::Touch>& sceneTouches); }; }
--- a/Framework/SmartLoader.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Framework/SmartLoader.cpp Tue May 21 11:43:25 2019 +0200 @@ -28,7 +28,7 @@ #include "Framework/Layers/FrameRenderer.h" #include "Core/Logging.h" -namespace OrthancStone +namespace Deprecated { enum CachedSliceStatus { @@ -53,21 +53,21 @@ virtual ILayerRenderer* CreateRenderer() const { - bool isFull = (that_.effectiveQuality_ == SliceImageQuality_FullPng || - that_.effectiveQuality_ == SliceImageQuality_FullPam); + bool isFull = (that_.effectiveQuality_ == OrthancStone::SliceImageQuality_FullPng || + that_.effectiveQuality_ == OrthancStone::SliceImageQuality_FullPam); return FrameRenderer::CreateRenderer(*that_.image_, *that_.slice_, isFull); } }; unsigned int sliceIndex_; - std::auto_ptr<Deprecated::Slice> slice_; + std::auto_ptr<Slice> slice_; boost::shared_ptr<Orthanc::ImageAccessor> image_; - SliceImageQuality effectiveQuality_; + OrthancStone::SliceImageQuality effectiveQuality_; CachedSliceStatus status_; public: - CachedSlice(MessageBroker& broker) : + CachedSlice(OrthancStone::MessageBroker& broker) : IVolumeSlicer(broker) { } @@ -76,15 +76,15 @@ { } - virtual bool GetExtent(std::vector<Vector>& points, - const CoordinateSystem3D& viewportSlice) + virtual bool GetExtent(std::vector<OrthancStone::Vector>& points, + const OrthancStone::CoordinateSystem3D& viewportSlice) { // TODO: viewportSlice is not used !!!! slice_->GetExtent(points); return true; } - virtual void ScheduleLayerCreation(const CoordinateSystem3D& viewportSlice) + virtual void ScheduleLayerCreation(const OrthancStone::CoordinateSystem3D& viewportSlice) { // TODO: viewportSlice is not used !!!! @@ -118,11 +118,11 @@ }; - SmartLoader::SmartLoader(MessageBroker& broker, + SmartLoader::SmartLoader(OrthancStone::MessageBroker& broker, OrthancApiClient& orthancApiClient) : IObservable(broker), IObserver(broker), - imageQuality_(SliceImageQuality_FullPam), + imageQuality_(OrthancStone::SliceImageQuality_FullPam), orthancApiClient_(orthancApiClient) { } @@ -152,9 +152,9 @@ { layerSource.reset(new DicomSeriesVolumeSlicer(IObserver::GetBroker(), orthancApiClient_)); dynamic_cast<DicomSeriesVolumeSlicer*>(layerSource.get())->SetImageQuality(imageQuality_); - layerSource->RegisterObserverCallback(new Callable<SmartLoader, IVolumeSlicer::GeometryReadyMessage>(*this, &SmartLoader::OnLayerGeometryReady)); - layerSource->RegisterObserverCallback(new Callable<SmartLoader, DicomSeriesVolumeSlicer::FrameReadyMessage>(*this, &SmartLoader::OnFrameReady)); - layerSource->RegisterObserverCallback(new Callable<SmartLoader, IVolumeSlicer::LayerReadyMessage>(*this, &SmartLoader::OnLayerReady)); + layerSource->RegisterObserverCallback(new OrthancStone::Callable<SmartLoader, IVolumeSlicer::GeometryReadyMessage>(*this, &SmartLoader::OnLayerGeometryReady)); + layerSource->RegisterObserverCallback(new OrthancStone::Callable<SmartLoader, DicomSeriesVolumeSlicer::FrameReadyMessage>(*this, &SmartLoader::OnFrameReady)); + layerSource->RegisterObserverCallback(new OrthancStone::Callable<SmartLoader, IVolumeSlicer::LayerReadyMessage>(*this, &SmartLoader::OnLayerReady)); dynamic_cast<DicomSeriesVolumeSlicer*>(layerSource.get())->LoadFrame(instanceId, frame); } @@ -169,7 +169,7 @@ } else { - throw StoneException(ErrorCode_CanOnlyAddOneLayerAtATime); + throw OrthancStone::StoneException(OrthancStone::ErrorCode_CanOnlyAddOneLayerAtATime); } if (cachedSlice != NULL) @@ -190,7 +190,7 @@ // create the slice in the cache with "empty" data boost::shared_ptr<CachedSlice> cachedSlice(new CachedSlice(IObserver::GetBroker())); - cachedSlice->slice_.reset(new Deprecated::Slice(instanceId, frame)); + cachedSlice->slice_.reset(new Slice(instanceId, frame)); cachedSlice->status_ = CachedSliceStatus_ScheduledToLoad; std::string sliceKeyId = instanceId + ":" + boost::lexical_cast<std::string>(frame); @@ -201,9 +201,9 @@ std::auto_ptr<IVolumeSlicer> layerSource(new DicomSeriesVolumeSlicer(IObserver::GetBroker(), orthancApiClient_)); dynamic_cast<DicomSeriesVolumeSlicer*>(layerSource.get())->SetImageQuality(imageQuality_); - layerSource->RegisterObserverCallback(new Callable<SmartLoader, IVolumeSlicer::GeometryReadyMessage>(*this, &SmartLoader::OnLayerGeometryReady)); - layerSource->RegisterObserverCallback(new Callable<SmartLoader, DicomSeriesVolumeSlicer::FrameReadyMessage>(*this, &SmartLoader::OnFrameReady)); - layerSource->RegisterObserverCallback(new Callable<SmartLoader, IVolumeSlicer::LayerReadyMessage>(*this, &SmartLoader::OnLayerReady)); + layerSource->RegisterObserverCallback(new OrthancStone::Callable<SmartLoader, IVolumeSlicer::GeometryReadyMessage>(*this, &SmartLoader::OnLayerGeometryReady)); + layerSource->RegisterObserverCallback(new OrthancStone::Callable<SmartLoader, DicomSeriesVolumeSlicer::FrameReadyMessage>(*this, &SmartLoader::OnFrameReady)); + layerSource->RegisterObserverCallback(new OrthancStone::Callable<SmartLoader, IVolumeSlicer::LayerReadyMessage>(*this, &SmartLoader::OnLayerReady)); dynamic_cast<DicomSeriesVolumeSlicer*>(layerSource.get())->LoadFrame(instanceId, frame); // keep a ref to the VolumeSlicer until the slice is fully loaded and saved to cache @@ -228,7 +228,7 @@ dynamic_cast<const DicomSeriesVolumeSlicer&>(message.GetOrigin()); // save/replace the slice in cache - const Deprecated::Slice& slice = source.GetSlice(0); // TODO handle GetSliceCount() + const Slice& slice = source.GetSlice(0); // TODO handle GetSliceCount() std::string sliceKeyId = (slice.GetOrthancInstanceId() + ":" + boost::lexical_cast<std::string>(slice.GetFrame())); @@ -249,7 +249,7 @@ void SmartLoader::OnFrameReady(const DicomSeriesVolumeSlicer::FrameReadyMessage& message) { // save/replace the slice in cache - const Deprecated::Slice& slice = message.GetSlice(); + const Slice& slice = message.GetSlice(); std::string sliceKeyId = (slice.GetOrthancInstanceId() + ":" + boost::lexical_cast<std::string>(slice.GetFrame())); @@ -273,7 +273,7 @@ const DicomSeriesVolumeSlicer& source = dynamic_cast<const DicomSeriesVolumeSlicer&>(message.GetOrigin()); - const Deprecated::Slice& slice = source.GetSlice(0); // TODO handle GetSliceCount() ? + const Slice& slice = source.GetSlice(0); // TODO handle GetSliceCount() ? std::string sliceKeyId = (slice.GetOrthancInstanceId() + ":" + boost::lexical_cast<std::string>(slice.GetFrame()));
--- a/Framework/SmartLoader.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/SmartLoader.h Tue May 21 11:43:25 2019 +0200 @@ -26,11 +26,11 @@ #include "Messages/IObservable.h" #include "Toolbox/OrthancApiClient.h" -namespace OrthancStone +namespace Deprecated { class SliceViewerWidget; - class SmartLoader : public IObservable, public IObserver + class SmartLoader : public OrthancStone::IObservable, public OrthancStone::IObserver { class CachedSlice; @@ -41,17 +41,17 @@ typedef std::map<std::string, boost::shared_ptr<IVolumeSlicer> > PreloadingInstances; PreloadingInstances preloadingInstances_; - SliceImageQuality imageQuality_; + OrthancStone::SliceImageQuality imageQuality_; OrthancApiClient& orthancApiClient_; public: - SmartLoader(MessageBroker& broker, OrthancApiClient& orthancApiClient); // TODO: add maxPreloadStorageSizeInBytes + SmartLoader(OrthancStone::MessageBroker& broker, OrthancApiClient& orthancApiClient); // TODO: add maxPreloadStorageSizeInBytes // void PreloadStudy(const std::string studyId); // void PreloadSeries(const std::string seriesId); void PreloadSlice(const std::string instanceId, unsigned int frame); - void SetImageQuality(SliceImageQuality imageQuality) { imageQuality_ = imageQuality; } + void SetImageQuality(OrthancStone::SliceImageQuality imageQuality) { imageQuality_ = imageQuality; } void SetFrameInWidget(SliceViewerWidget& sliceViewer, size_t layerIndex, const std::string& instanceId, unsigned int frame);
--- a/Framework/Toolbox/BaseWebService.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Toolbox/BaseWebService.cpp Tue May 21 11:43:25 2019 +0200 @@ -26,20 +26,20 @@ #include "Platforms/Generic/IOracleCommand.h" #include <boost/shared_ptr.hpp> -namespace OrthancStone +namespace Deprecated { class BaseWebService::BaseWebServicePayload : public Orthanc::IDynamicObject { private: - std::auto_ptr< MessageHandler<IWebService::HttpRequestSuccessMessage> > userSuccessHandler_; - std::auto_ptr< MessageHandler<IWebService::HttpRequestErrorMessage> > userFailureHandler_; + std::auto_ptr< OrthancStone::MessageHandler<IWebService::HttpRequestSuccessMessage> > userSuccessHandler_; + std::auto_ptr< OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage> > userFailureHandler_; std::auto_ptr< Orthanc::IDynamicObject> userPayload_; public: - BaseWebServicePayload(MessageHandler<IWebService::HttpRequestSuccessMessage>* userSuccessHandler, - MessageHandler<IWebService::HttpRequestErrorMessage>* userFailureHandler, + BaseWebServicePayload(OrthancStone::MessageHandler<IWebService::HttpRequestSuccessMessage>* userSuccessHandler, + OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage>* userFailureHandler, Orthanc::IDynamicObject* userPayload) : userSuccessHandler_(userSuccessHandler), userFailureHandler_(userFailureHandler), @@ -83,17 +83,17 @@ void BaseWebService::GetAsync(const std::string& uri, const HttpHeaders& headers, Orthanc::IDynamicObject* payload /* takes ownership */, - MessageHandler<IWebService::HttpRequestSuccessMessage>* successCallback, - MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback, + OrthancStone::MessageHandler<IWebService::HttpRequestSuccessMessage>* successCallback, + OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback, unsigned int timeoutInSeconds) { if (cache_.find(uri) == cache_.end()) { GetAsyncInternal(uri, headers, new BaseWebService::BaseWebServicePayload(successCallback, failureCallback, payload), // ownership is transfered - new Callable<BaseWebService, IWebService::HttpRequestSuccessMessage> + new OrthancStone::Callable<BaseWebService, IWebService::HttpRequestSuccessMessage> (*this, &BaseWebService::CacheAndNotifyHttpSuccess), - new Callable<BaseWebService, IWebService::HttpRequestErrorMessage> + new OrthancStone::Callable<BaseWebService, IWebService::HttpRequestErrorMessage> (*this, &BaseWebService::NotifyHttpError), timeoutInSeconds); }
--- a/Framework/Toolbox/BaseWebService.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Toolbox/BaseWebService.h Tue May 21 11:43:25 2019 +0200 @@ -26,11 +26,11 @@ #include <string> #include <map> -namespace OrthancStone +namespace Deprecated { // This is an intermediate of IWebService that implements some caching on // the HTTP GET requests - class BaseWebService : public IWebService, public IObserver + class BaseWebService : public IWebService, public OrthancStone::IObserver { public: class CachedHttpRequestSuccessMessage @@ -85,7 +85,7 @@ public: - BaseWebService(MessageBroker& broker) : + BaseWebService(OrthancStone::MessageBroker& broker) : IWebService(broker), IObserver(broker), cacheEnabled_(true) @@ -104,21 +104,21 @@ virtual void GetAsync(const std::string& uri, const HttpHeaders& headers, Orthanc::IDynamicObject* payload /* takes ownership */, - MessageHandler<IWebService::HttpRequestSuccessMessage>* successCallback, - MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback = NULL, + OrthancStone::MessageHandler<IWebService::HttpRequestSuccessMessage>* successCallback, + OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback = NULL, unsigned int timeoutInSeconds = 60); protected: virtual void GetAsyncInternal(const std::string& uri, const HttpHeaders& headers, Orthanc::IDynamicObject* payload /* takes ownership */, - MessageHandler<IWebService::HttpRequestSuccessMessage>* successCallback, - MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback = NULL, + OrthancStone::MessageHandler<IWebService::HttpRequestSuccessMessage>* successCallback, + OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback = NULL, unsigned int timeoutInSeconds = 60) = 0; virtual void NotifyHttpSuccessLater(boost::shared_ptr<BaseWebService::CachedHttpRequestSuccessMessage> cachedHttpMessage, Orthanc::IDynamicObject* payload, // takes ownership - MessageHandler<IWebService::HttpRequestSuccessMessage>* successCallback) = 0; + OrthancStone::MessageHandler<IWebService::HttpRequestSuccessMessage>* successCallback) = 0; private: void NotifyHttpSuccess(const IWebService::HttpRequestSuccessMessage& message);
--- a/Framework/Toolbox/DownloadStack.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Toolbox/DownloadStack.cpp Tue May 21 11:43:25 2019 +0200 @@ -25,7 +25,7 @@ #include <cassert> -namespace OrthancStone +namespace Deprecated { bool DownloadStack::CheckInvariants() const {
--- a/Framework/Toolbox/DownloadStack.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Toolbox/DownloadStack.h Tue May 21 11:43:25 2019 +0200 @@ -24,7 +24,7 @@ #include <vector> #include <boost/noncopyable.hpp> -namespace OrthancStone +namespace Deprecated { class DownloadStack : public boost::noncopyable {
--- a/Framework/Toolbox/IDelayedCallExecutor.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Toolbox/IDelayedCallExecutor.h Tue May 21 11:43:25 2019 +0200 @@ -30,18 +30,18 @@ #include <string> #include <map> -namespace OrthancStone +namespace Deprecated { // The IDelayedCall executes a callback after a delay (equivalent to timeout() function in javascript). class IDelayedCallExecutor : public boost::noncopyable { protected: - MessageBroker& broker_; + OrthancStone::MessageBroker& broker_; public: ORTHANC_STONE_DEFINE_EMPTY_MESSAGE(__FILE__, __LINE__, TimeoutMessage); - IDelayedCallExecutor(MessageBroker& broker) : + IDelayedCallExecutor(OrthancStone::MessageBroker& broker) : broker_(broker) { } @@ -52,7 +52,7 @@ } - virtual void Schedule(MessageHandler<IDelayedCallExecutor::TimeoutMessage>* callback, - unsigned int timeoutInMs = 1000) = 0; + virtual void Schedule(OrthancStone::MessageHandler<IDelayedCallExecutor::TimeoutMessage>* callback, + unsigned int timeoutInMs = 1000) = 0; }; }
--- a/Framework/Toolbox/IWebService.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Toolbox/IWebService.cpp Tue May 21 11:43:25 2019 +0200 @@ -24,7 +24,7 @@ #include <Core/OrthancException.h> -namespace OrthancStone +namespace Deprecated { const Orthanc::IDynamicObject& IWebService::HttpRequestSuccessMessage::GetPayload() const
--- a/Framework/Toolbox/IWebService.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Toolbox/IWebService.h Tue May 21 11:43:25 2019 +0200 @@ -30,7 +30,7 @@ #include <string> #include <map> -namespace OrthancStone +namespace Deprecated { // The IWebService performs HTTP requests. // Since applications can run in native or WASM environment and, since @@ -40,12 +40,12 @@ class IWebService : public boost::noncopyable { protected: - MessageBroker& broker_; + OrthancStone::MessageBroker& broker_; public: typedef std::map<std::string, std::string> HttpHeaders; - class HttpRequestSuccessMessage : public IMessage + class HttpRequestSuccessMessage : public OrthancStone::IMessage { ORTHANC_STONE_MESSAGE(__FILE__, __LINE__); @@ -99,7 +99,7 @@ }; - class HttpRequestErrorMessage : public IMessage + class HttpRequestErrorMessage : public OrthancStone::IMessage { ORTHANC_STONE_MESSAGE(__FILE__, __LINE__); @@ -129,7 +129,7 @@ }; - IWebService(MessageBroker& broker) : + IWebService(OrthancStone::MessageBroker& broker) : broker_(broker) { } @@ -144,23 +144,23 @@ virtual void GetAsync(const std::string& uri, const HttpHeaders& headers, Orthanc::IDynamicObject* payload /* takes ownership */, - MessageHandler<IWebService::HttpRequestSuccessMessage>* successCallback, - MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback = NULL, + OrthancStone::MessageHandler<IWebService::HttpRequestSuccessMessage>* successCallback, + OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback = NULL, unsigned int timeoutInSeconds = 60) = 0; virtual void PostAsync(const std::string& uri, const HttpHeaders& headers, const std::string& body, Orthanc::IDynamicObject* payload /* takes ownership */, - MessageHandler<IWebService::HttpRequestSuccessMessage>* successCallback, - MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback = NULL, + OrthancStone::MessageHandler<IWebService::HttpRequestSuccessMessage>* successCallback, + OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback = NULL, unsigned int timeoutInSeconds = 60) = 0; virtual void DeleteAsync(const std::string& uri, const HttpHeaders& headers, Orthanc::IDynamicObject* payload /* takes ownership */, - MessageHandler<IWebService::HttpRequestSuccessMessage>* successCallback, - MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback = NULL, + OrthancStone::MessageHandler<IWebService::HttpRequestSuccessMessage>* successCallback, + OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback = NULL, unsigned int timeoutInSeconds = 60) = 0; }; }
--- a/Framework/Toolbox/OrthancApiClient.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Toolbox/OrthancApiClient.cpp Tue May 21 11:43:25 2019 +0200 @@ -25,7 +25,7 @@ #include <Core/OrthancException.h> -namespace OrthancStone +namespace Deprecated { const Orthanc::IDynamicObject& OrthancApiClient::JsonResponseReadyMessage::GetPayload() const { @@ -69,10 +69,10 @@ class OrthancApiClient::WebServicePayload : public Orthanc::IDynamicObject { private: - std::auto_ptr< MessageHandler<EmptyResponseReadyMessage> > emptyHandler_; - std::auto_ptr< MessageHandler<JsonResponseReadyMessage> > jsonHandler_; - std::auto_ptr< MessageHandler<BinaryResponseReadyMessage> > binaryHandler_; - std::auto_ptr< MessageHandler<IWebService::HttpRequestErrorMessage> > failureHandler_; + std::auto_ptr< OrthancStone::MessageHandler<EmptyResponseReadyMessage> > emptyHandler_; + std::auto_ptr< OrthancStone::MessageHandler<JsonResponseReadyMessage> > jsonHandler_; + std::auto_ptr< OrthancStone::MessageHandler<BinaryResponseReadyMessage> > binaryHandler_; + std::auto_ptr< OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage> > failureHandler_; std::auto_ptr< Orthanc::IDynamicObject > userPayload_; void NotifyConversionError(const IWebService::HttpRequestSuccessMessage& message) const @@ -85,8 +85,8 @@ } public: - WebServicePayload(MessageHandler<EmptyResponseReadyMessage>* handler, - MessageHandler<IWebService::HttpRequestErrorMessage>* failureHandler, + WebServicePayload(OrthancStone::MessageHandler<EmptyResponseReadyMessage>* handler, + OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage>* failureHandler, Orthanc::IDynamicObject* userPayload) : emptyHandler_(handler), failureHandler_(failureHandler), @@ -98,8 +98,8 @@ } } - WebServicePayload(MessageHandler<BinaryResponseReadyMessage>* handler, - MessageHandler<IWebService::HttpRequestErrorMessage>* failureHandler, + WebServicePayload(OrthancStone::MessageHandler<BinaryResponseReadyMessage>* handler, + OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage>* failureHandler, Orthanc::IDynamicObject* userPayload) : binaryHandler_(handler), failureHandler_(failureHandler), @@ -111,8 +111,8 @@ } } - WebServicePayload(MessageHandler<JsonResponseReadyMessage>* handler, - MessageHandler<IWebService::HttpRequestErrorMessage>* failureHandler, + WebServicePayload(OrthancStone::MessageHandler<JsonResponseReadyMessage>* handler, + OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage>* failureHandler, Orthanc::IDynamicObject* userPayload) : jsonHandler_(handler), failureHandler_(failureHandler), @@ -140,7 +140,7 @@ else if (jsonHandler_.get() != NULL) { Json::Value response; - if (MessagingToolbox::ParseJson(response, message.GetAnswer(), message.GetAnswerSize())) + if (OrthancStone::MessagingToolbox::ParseJson(response, message.GetAnswer(), message.GetAnswerSize())) { jsonHandler_->Apply(OrthancApiClient::JsonResponseReadyMessage (message.GetUri(), response, userPayload_.get())); @@ -167,7 +167,7 @@ }; - OrthancApiClient::OrthancApiClient(MessageBroker& broker, + OrthancApiClient::OrthancApiClient(OrthancStone::MessageBroker& broker, IWebService& web, const std::string& baseUrl) : IObservable(broker), @@ -180,17 +180,17 @@ void OrthancApiClient::GetJsonAsync( const std::string& uri, - MessageHandler<JsonResponseReadyMessage>* successCallback, - MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback, + OrthancStone::MessageHandler<JsonResponseReadyMessage>* successCallback, + OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback, Orthanc::IDynamicObject* payload) { IWebService::HttpHeaders emptyHeaders; web_.GetAsync(baseUrl_ + uri, emptyHeaders, new WebServicePayload(successCallback, failureCallback, payload), - new Callable<OrthancApiClient, IWebService::HttpRequestSuccessMessage> + new OrthancStone::Callable<OrthancApiClient, IWebService::HttpRequestSuccessMessage> (*this, &OrthancApiClient::NotifyHttpSuccess), - new Callable<OrthancApiClient, IWebService::HttpRequestErrorMessage> + new OrthancStone::Callable<OrthancApiClient, IWebService::HttpRequestErrorMessage> (*this, &OrthancApiClient::NotifyHttpError)); } @@ -198,8 +198,8 @@ void OrthancApiClient::GetBinaryAsync( const std::string& uri, const std::string& contentType, - MessageHandler<BinaryResponseReadyMessage>* successCallback, - MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback, + OrthancStone::MessageHandler<BinaryResponseReadyMessage>* successCallback, + OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback, Orthanc::IDynamicObject* payload) { IWebService::HttpHeaders headers; @@ -210,17 +210,17 @@ void OrthancApiClient::GetBinaryAsync( const std::string& uri, const IWebService::HttpHeaders& headers, - MessageHandler<BinaryResponseReadyMessage>* successCallback, - MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback, + OrthancStone::MessageHandler<BinaryResponseReadyMessage>* successCallback, + OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback, Orthanc::IDynamicObject* payload) { // printf("GET [%s] [%s]\n", baseUrl_.c_str(), uri.c_str()); web_.GetAsync(baseUrl_ + uri, headers, new WebServicePayload(successCallback, failureCallback, payload), - new Callable<OrthancApiClient, IWebService::HttpRequestSuccessMessage> + new OrthancStone::Callable<OrthancApiClient, IWebService::HttpRequestSuccessMessage> (*this, &OrthancApiClient::NotifyHttpSuccess), - new Callable<OrthancApiClient, IWebService::HttpRequestErrorMessage> + new OrthancStone::Callable<OrthancApiClient, IWebService::HttpRequestErrorMessage> (*this, &OrthancApiClient::NotifyHttpError)); } @@ -228,15 +228,15 @@ void OrthancApiClient::PostBinaryAsyncExpectJson( const std::string& uri, const std::string& body, - MessageHandler<JsonResponseReadyMessage>* successCallback, - MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback, + OrthancStone::MessageHandler<JsonResponseReadyMessage>* successCallback, + OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback, Orthanc::IDynamicObject* payload) { web_.PostAsync(baseUrl_ + uri, IWebService::HttpHeaders(), body, new WebServicePayload(successCallback, failureCallback, payload), - new Callable<OrthancApiClient, IWebService::HttpRequestSuccessMessage> + new OrthancStone::Callable<OrthancApiClient, IWebService::HttpRequestSuccessMessage> (*this, &OrthancApiClient::NotifyHttpSuccess), - new Callable<OrthancApiClient, IWebService::HttpRequestErrorMessage> + new OrthancStone::Callable<OrthancApiClient, IWebService::HttpRequestErrorMessage> (*this, &OrthancApiClient::NotifyHttpError)); } @@ -251,27 +251,27 @@ void OrthancApiClient::PostBinaryAsync( const std::string& uri, const std::string& body, - MessageHandler<EmptyResponseReadyMessage>* successCallback, - MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback, + OrthancStone::MessageHandler<EmptyResponseReadyMessage>* successCallback, + OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback, Orthanc::IDynamicObject* payload /* takes ownership */) { web_.PostAsync(baseUrl_ + uri, IWebService::HttpHeaders(), body, new WebServicePayload(successCallback, failureCallback, payload), - new Callable<OrthancApiClient, IWebService::HttpRequestSuccessMessage> + new OrthancStone::Callable<OrthancApiClient, IWebService::HttpRequestSuccessMessage> (*this, &OrthancApiClient::NotifyHttpSuccess), - new Callable<OrthancApiClient, IWebService::HttpRequestErrorMessage> + new OrthancStone::Callable<OrthancApiClient, IWebService::HttpRequestErrorMessage> (*this, &OrthancApiClient::NotifyHttpError)); } void OrthancApiClient::PostJsonAsyncExpectJson( const std::string& uri, const Json::Value& data, - MessageHandler<JsonResponseReadyMessage>* successCallback, - MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback, + OrthancStone::MessageHandler<JsonResponseReadyMessage>* successCallback, + OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback, Orthanc::IDynamicObject* payload) { std::string body; - MessagingToolbox::JsonToString(body, data); + OrthancStone::MessagingToolbox::JsonToString(body, data); return PostBinaryAsyncExpectJson(uri, body, successCallback, failureCallback, payload); } @@ -280,33 +280,33 @@ const Json::Value& data) { std::string body; - MessagingToolbox::JsonToString(body, data); + OrthancStone::MessagingToolbox::JsonToString(body, data); return PostBinaryAsync(uri, body); } void OrthancApiClient::PostJsonAsync( const std::string& uri, const Json::Value& data, - MessageHandler<EmptyResponseReadyMessage>* successCallback, - MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback, + OrthancStone::MessageHandler<EmptyResponseReadyMessage>* successCallback, + OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback, Orthanc::IDynamicObject* payload /* takes ownership */) { std::string body; - MessagingToolbox::JsonToString(body, data); + OrthancStone::MessagingToolbox::JsonToString(body, data); return PostBinaryAsync(uri, body, successCallback, failureCallback, payload); } void OrthancApiClient::DeleteAsync( const std::string& uri, - MessageHandler<EmptyResponseReadyMessage>* successCallback, - MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback, + OrthancStone::MessageHandler<EmptyResponseReadyMessage>* successCallback, + OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback, Orthanc::IDynamicObject* payload) { web_.DeleteAsync(baseUrl_ + uri, IWebService::HttpHeaders(), new WebServicePayload(successCallback, failureCallback, payload), - new Callable<OrthancApiClient, IWebService::HttpRequestSuccessMessage> + new OrthancStone::Callable<OrthancApiClient, IWebService::HttpRequestSuccessMessage> (*this, &OrthancApiClient::NotifyHttpSuccess), - new Callable<OrthancApiClient, IWebService::HttpRequestErrorMessage> + new OrthancStone::Callable<OrthancApiClient, IWebService::HttpRequestErrorMessage> (*this, &OrthancApiClient::NotifyHttpError)); }
--- a/Framework/Toolbox/OrthancApiClient.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Toolbox/OrthancApiClient.h Tue May 21 11:43:25 2019 +0200 @@ -28,14 +28,14 @@ #include "../Messages/IObservable.h" #include "../Messages/Promise.h" -namespace OrthancStone +namespace Deprecated { class OrthancApiClient : - public IObservable, - public IObserver + public OrthancStone::IObservable, + public OrthancStone::IObserver { public: - class JsonResponseReadyMessage : public IMessage + class JsonResponseReadyMessage : public OrthancStone::IMessage { ORTHANC_STONE_MESSAGE(__FILE__, __LINE__); @@ -73,7 +73,7 @@ }; - class BinaryResponseReadyMessage : public IMessage + class BinaryResponseReadyMessage : public OrthancStone::IMessage { ORTHANC_STONE_MESSAGE(__FILE__, __LINE__); @@ -119,7 +119,7 @@ }; - class EmptyResponseReadyMessage : public IMessage + class EmptyResponseReadyMessage : public OrthancStone::IMessage { ORTHANC_STONE_MESSAGE(__FILE__, __LINE__); @@ -158,7 +158,7 @@ std::string baseUrl_; public: - OrthancApiClient(MessageBroker& broker, + OrthancApiClient(OrthancStone::MessageBroker& broker, IWebService& web, const std::string& baseUrl); @@ -170,36 +170,36 @@ // schedule a GET request expecting a JSON response. void GetJsonAsync(const std::string& uri, - MessageHandler<JsonResponseReadyMessage>* successCallback, - MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback = NULL, + OrthancStone::MessageHandler<JsonResponseReadyMessage>* successCallback, + OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback = NULL, Orthanc::IDynamicObject* payload = NULL /* takes ownership */); // schedule a GET request expecting a binary response. void GetBinaryAsync(const std::string& uri, const std::string& contentType, - MessageHandler<BinaryResponseReadyMessage>* successCallback, - MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback = NULL, + OrthancStone::MessageHandler<BinaryResponseReadyMessage>* successCallback, + OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback = NULL, Orthanc::IDynamicObject* payload = NULL /* takes ownership */); // schedule a GET request expecting a binary response. void GetBinaryAsync(const std::string& uri, const IWebService::HttpHeaders& headers, - MessageHandler<BinaryResponseReadyMessage>* successCallback, - MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback = NULL, + OrthancStone::MessageHandler<BinaryResponseReadyMessage>* successCallback, + OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback = NULL, Orthanc::IDynamicObject* payload = NULL /* takes ownership */); // schedule a POST request expecting a JSON response. void PostBinaryAsyncExpectJson(const std::string& uri, const std::string& body, - MessageHandler<JsonResponseReadyMessage>* successCallback, - MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback = NULL, + OrthancStone::MessageHandler<JsonResponseReadyMessage>* successCallback, + OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback = NULL, Orthanc::IDynamicObject* payload = NULL /* takes ownership */); // schedule a POST request expecting a JSON response. void PostJsonAsyncExpectJson(const std::string& uri, const Json::Value& data, - MessageHandler<JsonResponseReadyMessage>* successCallback, - MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback = NULL, + OrthancStone::MessageHandler<JsonResponseReadyMessage>* successCallback, + OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback = NULL, Orthanc::IDynamicObject* payload = NULL /* takes ownership */); // schedule a POST request and don't mind the response. @@ -209,8 +209,8 @@ // schedule a POST request and don't expect any response. void PostJsonAsync(const std::string& uri, const Json::Value& data, - MessageHandler<EmptyResponseReadyMessage>* successCallback, - MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback = NULL, + OrthancStone::MessageHandler<EmptyResponseReadyMessage>* successCallback, + OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback = NULL, Orthanc::IDynamicObject* payload = NULL /* takes ownership */); @@ -221,14 +221,14 @@ // schedule a POST request and don't expect any response. void PostBinaryAsync(const std::string& uri, const std::string& body, - MessageHandler<EmptyResponseReadyMessage>* successCallback, - MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback = NULL, + OrthancStone::MessageHandler<EmptyResponseReadyMessage>* successCallback, + OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback = NULL, Orthanc::IDynamicObject* payload = NULL /* takes ownership */); // schedule a DELETE request expecting an empty response. void DeleteAsync(const std::string& uri, - MessageHandler<EmptyResponseReadyMessage>* successCallback, - MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback = NULL, + OrthancStone::MessageHandler<EmptyResponseReadyMessage>* successCallback, + OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback = NULL, Orthanc::IDynamicObject* payload = NULL /* takes ownership */); void NotifyHttpSuccess(const IWebService::HttpRequestSuccessMessage& message);
--- a/Framework/Toolbox/OrthancSlicesLoader.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Toolbox/OrthancSlicesLoader.cpp Tue May 21 11:43:25 2019 +0200 @@ -68,7 +68,7 @@ -namespace OrthancStone +namespace Deprecated { class OrthancSlicesLoader::Operation : public Orthanc::IDynamicObject { @@ -76,9 +76,9 @@ Mode mode_; unsigned int frame_; unsigned int sliceIndex_; - const Deprecated::Slice* slice_; + const Slice* slice_; std::string instanceId_; - SliceImageQuality quality_; + OrthancStone::SliceImageQuality quality_; Operation(Mode mode) : mode_(mode) @@ -91,7 +91,7 @@ return mode_; } - SliceImageQuality GetQuality() const + OrthancStone::SliceImageQuality GetQuality() const { assert(mode_ == Mode_LoadImage || mode_ == Mode_LoadRawImage); @@ -105,7 +105,7 @@ return sliceIndex_; } - const Deprecated::Slice& GetSlice() const + const Slice& GetSlice() const { assert(mode_ == Mode_LoadImage || mode_ == Mode_LoadRawImage); @@ -143,8 +143,8 @@ } static Operation* DownloadSliceImage(unsigned int sliceIndex, - const Deprecated::Slice& slice, - SliceImageQuality quality) + const Slice& slice, + OrthancStone::SliceImageQuality quality) { std::auto_ptr<Operation> tmp(new Operation(Mode_LoadImage)); tmp->sliceIndex_ = sliceIndex; @@ -154,16 +154,16 @@ } static Operation* DownloadSliceRawImage(unsigned int sliceIndex, - const Deprecated::Slice& slice) + const Slice& slice) { std::auto_ptr<Operation> tmp(new Operation(Mode_LoadRawImage)); tmp->sliceIndex_ = sliceIndex; tmp->slice_ = &slice; - tmp->quality_ = SliceImageQuality_InternalRaw; + tmp->quality_ = OrthancStone::SliceImageQuality_InternalRaw; return tmp.release(); } - static Operation* DownloadDicomFile(const Deprecated::Slice& slice) + static Operation* DownloadDicomFile(const Slice& slice) { std::auto_ptr<Operation> tmp(new Operation(Mode_LoadDicomFile)); tmp->slice_ = &slice; @@ -231,7 +231,7 @@ OrthancPlugins::FullOrthancDataset dataset(series[instances[i]]); Orthanc::DicomMap dicom; - MessagingToolbox::ConvertDataset(dicom, dataset); + OrthancStone::MessagingToolbox::ConvertDataset(dicom, dataset); unsigned int frames; if (!dicom.ParseUnsignedInteger32(frames, Orthanc::DICOM_TAG_NUMBER_OF_FRAMES)) @@ -241,10 +241,10 @@ for (unsigned int frame = 0; frame < frames; frame++) { - std::auto_ptr<Deprecated::Slice> slice(new Deprecated::Slice); + std::auto_ptr<Slice> slice(new Slice); if (slice->ParseOrthancFrame(dicom, instances[i], frame)) { - CoordinateSystem3D geometry = slice->GetGeometry(); + OrthancStone::CoordinateSystem3D geometry = slice->GetGeometry(); slices_.AddSlice(geometry, slice.release()); } else @@ -265,7 +265,7 @@ OrthancPlugins::FullOrthancDataset dataset(tags); Orthanc::DicomMap dicom; - MessagingToolbox::ConvertDataset(dicom, dataset); + OrthancStone::MessagingToolbox::ConvertDataset(dicom, dataset); unsigned int frames; if (!dicom.ParseUnsignedInteger32(frames, Orthanc::DICOM_TAG_NUMBER_OF_FRAMES)) @@ -277,10 +277,10 @@ for (unsigned int frame = 0; frame < frames; frame++) { - std::auto_ptr<Deprecated::Slice> slice(new Deprecated::Slice); + std::auto_ptr<Slice> slice(new Slice); if (slice->ParseOrthancFrame(dicom, instanceId, frame)) { - CoordinateSystem3D geometry = slice->GetGeometry(); + OrthancStone::CoordinateSystem3D geometry = slice->GetGeometry(); slices_.AddSlice(geometry, slice.release()); } else @@ -306,14 +306,14 @@ state_ = State_GeometryReady; Orthanc::DicomMap dicom; - MessagingToolbox::ConvertDataset(dicom, dataset); + OrthancStone::MessagingToolbox::ConvertDataset(dicom, dataset); - std::auto_ptr<Deprecated::Slice> slice(new Deprecated::Slice); + std::auto_ptr<Slice> slice(new Slice); if (slice->ParseOrthancFrame(dicom, instanceId, frame)) { LOG(INFO) << "Loaded instance geometry " << instanceId; - CoordinateSystem3D geometry = slice->GetGeometry(); + OrthancStone::CoordinateSystem3D geometry = slice->GetGeometry(); slices_.AddSlice(geometry, slice.release()); BroadcastMessage(SliceGeometryReadyMessage(*this)); @@ -544,7 +544,7 @@ float scaling = static_cast<float>(stretchHigh - stretchLow) / 255.0f; - if (!LinearAlgebra::IsCloseToZero(scaling)) + if (!OrthancStone::LinearAlgebra::IsCloseToZero(scaling)) { float offset = static_cast<float>(stretchLow) / scaling; Orthanc::ImageProcessing::ShiftScale(*image, offset, scaling, true); @@ -639,10 +639,10 @@ } - OrthancSlicesLoader::OrthancSlicesLoader(MessageBroker& broker, + OrthancSlicesLoader::OrthancSlicesLoader(OrthancStone::MessageBroker& broker, OrthancApiClient& orthanc) : - IObservable(broker), - IObserver(broker), + OrthancStone::IObservable(broker), + OrthancStone::IObserver(broker), orthanc_(orthanc), state_(State_Initialization) { @@ -659,8 +659,8 @@ { state_ = State_LoadingGeometry; orthanc_.GetJsonAsync("/series/" + seriesId + "/instances-tags", - new Callable<OrthancSlicesLoader, OrthancApiClient::JsonResponseReadyMessage>(*this, &OrthancSlicesLoader::ParseSeriesGeometry), - new Callable<OrthancSlicesLoader, IWebService::HttpRequestErrorMessage>(*this, &OrthancSlicesLoader::OnGeometryError), + new OrthancStone::Callable<OrthancSlicesLoader, OrthancApiClient::JsonResponseReadyMessage>(*this, &OrthancSlicesLoader::ParseSeriesGeometry), + new OrthancStone::Callable<OrthancSlicesLoader, IWebService::HttpRequestErrorMessage>(*this, &OrthancSlicesLoader::OnGeometryError), NULL); } } @@ -678,8 +678,8 @@ // Tag "3004-000c" is "Grid Frame Offset Vector", which is // mandatory to read RT DOSE, but is too long to be returned by default orthanc_.GetJsonAsync("/instances/" + instanceId + "/tags?ignore-length=3004-000c", - new Callable<OrthancSlicesLoader, OrthancApiClient::JsonResponseReadyMessage>(*this, &OrthancSlicesLoader::ParseInstanceGeometry), - new Callable<OrthancSlicesLoader, IWebService::HttpRequestErrorMessage>(*this, &OrthancSlicesLoader::OnGeometryError), + new OrthancStone::Callable<OrthancSlicesLoader, OrthancApiClient::JsonResponseReadyMessage>(*this, &OrthancSlicesLoader::ParseInstanceGeometry), + new OrthancStone::Callable<OrthancSlicesLoader, IWebService::HttpRequestErrorMessage>(*this, &OrthancSlicesLoader::OnGeometryError), Operation::DownloadInstanceGeometry(instanceId)); } } @@ -697,8 +697,8 @@ state_ = State_LoadingGeometry; orthanc_.GetJsonAsync("/instances/" + instanceId + "/tags", - new Callable<OrthancSlicesLoader, OrthancApiClient::JsonResponseReadyMessage>(*this, &OrthancSlicesLoader::ParseFrameGeometry), - new Callable<OrthancSlicesLoader, IWebService::HttpRequestErrorMessage>(*this, &OrthancSlicesLoader::OnGeometryError), + new OrthancStone::Callable<OrthancSlicesLoader, OrthancApiClient::JsonResponseReadyMessage>(*this, &OrthancSlicesLoader::ParseFrameGeometry), + new OrthancStone::Callable<OrthancSlicesLoader, IWebService::HttpRequestErrorMessage>(*this, &OrthancSlicesLoader::OnGeometryError), Operation::DownloadFrameGeometry(instanceId, frame)); } } @@ -721,19 +721,19 @@ } - const Deprecated::Slice& OrthancSlicesLoader::GetSlice(size_t index) const + const Slice& OrthancSlicesLoader::GetSlice(size_t index) const { if (state_ != State_GeometryReady) { throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls); } - return dynamic_cast<const Deprecated::Slice&>(slices_.GetSlicePayload(index)); + return dynamic_cast<const Slice&>(slices_.GetSlicePayload(index)); } bool OrthancSlicesLoader::LookupSlice(size_t& index, - const CoordinateSystem3D& plane) const + const OrthancStone::CoordinateSystem3D& plane) const { if (state_ != State_GeometryReady) { @@ -746,7 +746,7 @@ } - void OrthancSlicesLoader::ScheduleSliceImagePng(const Deprecated::Slice& slice, + void OrthancSlicesLoader::ScheduleSliceImagePng(const Slice& slice, size_t index) { std::string uri = ("/instances/" + slice.GetOrthancInstanceId() + "/frames/" + @@ -771,17 +771,17 @@ } orthanc_.GetBinaryAsync(uri, "image/png", - new Callable<OrthancSlicesLoader, + new OrthancStone::Callable<OrthancSlicesLoader, OrthancApiClient::BinaryResponseReadyMessage> (*this, &OrthancSlicesLoader::ParseSliceImagePng), - new Callable<OrthancSlicesLoader, + new OrthancStone::Callable<OrthancSlicesLoader, IWebService::HttpRequestErrorMessage> (*this, &OrthancSlicesLoader::OnSliceImageError), Operation::DownloadSliceImage( - static_cast<unsigned int>(index), slice, SliceImageQuality_FullPng)); + static_cast<unsigned int>(index), slice, OrthancStone::SliceImageQuality_FullPng)); } - void OrthancSlicesLoader::ScheduleSliceImagePam(const Deprecated::Slice& slice, + void OrthancSlicesLoader::ScheduleSliceImagePam(const Slice& slice, size_t index) { std::string uri = @@ -807,35 +807,35 @@ } orthanc_.GetBinaryAsync(uri, "image/x-portable-arbitrarymap", - new Callable<OrthancSlicesLoader, + new OrthancStone::Callable<OrthancSlicesLoader, OrthancApiClient::BinaryResponseReadyMessage> (*this, &OrthancSlicesLoader::ParseSliceImagePam), - new Callable<OrthancSlicesLoader, + new OrthancStone::Callable<OrthancSlicesLoader, IWebService::HttpRequestErrorMessage> (*this, &OrthancSlicesLoader::OnSliceImageError), Operation::DownloadSliceImage(static_cast<unsigned int>(index), - slice, SliceImageQuality_FullPam)); + slice, OrthancStone::SliceImageQuality_FullPam)); } - void OrthancSlicesLoader::ScheduleSliceImageJpeg(const Deprecated::Slice& slice, + void OrthancSlicesLoader::ScheduleSliceImageJpeg(const Slice& slice, size_t index, - SliceImageQuality quality) + OrthancStone::SliceImageQuality quality) { unsigned int value; switch (quality) { - case SliceImageQuality_Jpeg50: + case OrthancStone::SliceImageQuality_Jpeg50: value = 50; break; - case SliceImageQuality_Jpeg90: + case OrthancStone::SliceImageQuality_Jpeg90: value = 90; break; - case SliceImageQuality_Jpeg95: + case OrthancStone::SliceImageQuality_Jpeg95: value = 95; break; @@ -850,10 +850,10 @@ boost::lexical_cast<std::string>(slice.GetFrame())); orthanc_.GetJsonAsync(uri, - new Callable<OrthancSlicesLoader, + new OrthancStone::Callable<OrthancSlicesLoader, OrthancApiClient::JsonResponseReadyMessage> (*this, &OrthancSlicesLoader::ParseSliceImageJpeg), - new Callable<OrthancSlicesLoader, + new OrthancStone::Callable<OrthancSlicesLoader, IWebService::HttpRequestErrorMessage> (*this, &OrthancSlicesLoader::OnSliceImageError), Operation::DownloadSliceImage( @@ -863,23 +863,23 @@ void OrthancSlicesLoader::ScheduleLoadSliceImage(size_t index, - SliceImageQuality quality) + OrthancStone::SliceImageQuality quality) { if (state_ != State_GeometryReady) { throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls); } - const Deprecated::Slice& slice = GetSlice(index); + const Slice& slice = GetSlice(index); if (slice.HasOrthancDecoding()) { switch (quality) { - case SliceImageQuality_FullPng: + case OrthancStone::SliceImageQuality_FullPng: ScheduleSliceImagePng(slice, index); break; - case SliceImageQuality_FullPam: + case OrthancStone::SliceImageQuality_FullPam: ScheduleSliceImagePam(slice, index); break; default: @@ -891,10 +891,10 @@ std::string uri = ("/instances/" + slice.GetOrthancInstanceId() + "/frames/" + boost::lexical_cast<std::string>(slice.GetFrame()) + "/raw.gz"); orthanc_.GetBinaryAsync(uri, IWebService::HttpHeaders(), - new Callable<OrthancSlicesLoader, + new OrthancStone::Callable<OrthancSlicesLoader, OrthancApiClient::BinaryResponseReadyMessage> (*this, &OrthancSlicesLoader::ParseSliceRawImage), - new Callable<OrthancSlicesLoader, + new OrthancStone::Callable<OrthancSlicesLoader, IWebService::HttpRequestErrorMessage> (*this, &OrthancSlicesLoader::OnSliceImageError), Operation::DownloadSliceRawImage(
--- a/Framework/Toolbox/OrthancSlicesLoader.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Toolbox/OrthancSlicesLoader.h Tue May 21 11:43:25 2019 +0200 @@ -31,31 +31,31 @@ #include <Core/Images/Image.h> -namespace OrthancStone +namespace Deprecated { - class OrthancSlicesLoader : public IObservable, public IObserver + class OrthancSlicesLoader : public OrthancStone::IObservable, public OrthancStone::IObserver { public: ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, SliceGeometryReadyMessage, OrthancSlicesLoader); ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, SliceGeometryErrorMessage, OrthancSlicesLoader); - class SliceImageReadyMessage : public OriginMessage<OrthancSlicesLoader> + class SliceImageReadyMessage : public OrthancStone::OriginMessage<OrthancSlicesLoader> { ORTHANC_STONE_MESSAGE(__FILE__, __LINE__); private: unsigned int sliceIndex_; - const Deprecated::Slice& slice_; + const Slice& slice_; const Orthanc::ImageAccessor& image_; - SliceImageQuality effectiveQuality_; + OrthancStone::SliceImageQuality effectiveQuality_; public: SliceImageReadyMessage(const OrthancSlicesLoader& origin, unsigned int sliceIndex, - const Deprecated::Slice& slice, + const Slice& slice, const Orthanc::ImageAccessor& image, - SliceImageQuality effectiveQuality) : + OrthancStone::SliceImageQuality effectiveQuality) : OriginMessage(origin), sliceIndex_(sliceIndex), slice_(slice), @@ -69,7 +69,7 @@ return sliceIndex_; } - const Deprecated::Slice& GetSlice() const + const Slice& GetSlice() const { return slice_; } @@ -79,27 +79,27 @@ return image_; } - SliceImageQuality GetEffectiveQuality() const + OrthancStone::SliceImageQuality GetEffectiveQuality() const { return effectiveQuality_; } }; - class SliceImageErrorMessage : public OriginMessage<OrthancSlicesLoader> + class SliceImageErrorMessage : public OrthancStone::OriginMessage<OrthancSlicesLoader> { ORTHANC_STONE_MESSAGE(__FILE__, __LINE__); private: - const Deprecated::Slice& slice_; + const Slice& slice_; unsigned int sliceIndex_; - SliceImageQuality effectiveQuality_; + OrthancStone::SliceImageQuality effectiveQuality_; public: SliceImageErrorMessage(const OrthancSlicesLoader& origin, unsigned int sliceIndex, - const Deprecated::Slice& slice, - SliceImageQuality effectiveQuality) : + const Slice& slice, + OrthancStone::SliceImageQuality effectiveQuality) : OriginMessage(origin), slice_(slice), sliceIndex_(sliceIndex), @@ -111,12 +111,12 @@ return sliceIndex_; } - const Deprecated::Slice& GetSlice() const + const Slice& GetSlice() const { return slice_; } - SliceImageQuality GetEffectiveQuality() const + OrthancStone::SliceImageQuality GetEffectiveQuality() const { return effectiveQuality_; } @@ -145,7 +145,7 @@ OrthancApiClient& orthanc_; State state_; - SlicesSorter slices_; + OrthancStone::SlicesSorter slices_; void NotifySliceImageSuccess(const Operation& operation, const Orthanc::ImageAccessor& image); @@ -170,20 +170,20 @@ void ParseSliceRawImage(const OrthancApiClient::BinaryResponseReadyMessage& message); - void ScheduleSliceImagePng(const Deprecated::Slice& slice, + void ScheduleSliceImagePng(const Slice& slice, size_t index); - void ScheduleSliceImagePam(const Deprecated::Slice& slice, + void ScheduleSliceImagePam(const Slice& slice, size_t index); - void ScheduleSliceImageJpeg(const Deprecated::Slice& slice, + void ScheduleSliceImageJpeg(const Slice& slice, size_t index, - SliceImageQuality quality); + OrthancStone::SliceImageQuality quality); void SortAndFinalizeSlices(); public: - OrthancSlicesLoader(MessageBroker& broker, + OrthancSlicesLoader(OrthancStone::MessageBroker& broker, //ISliceLoaderObserver& callback, OrthancApiClient& orthancApi); @@ -198,12 +198,12 @@ size_t GetSlicesCount() const; - const Deprecated::Slice& GetSlice(size_t index) const; + const Slice& GetSlice(size_t index) const; bool LookupSlice(size_t& index, - const CoordinateSystem3D& plane) const; + const OrthancStone::CoordinateSystem3D& plane) const; void ScheduleLoadSliceImage(size_t index, - SliceImageQuality requestedQuality); + OrthancStone::SliceImageQuality requestedQuality); }; }
--- a/Framework/Toolbox/ViewportGeometry.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Toolbox/ViewportGeometry.cpp Tue May 21 11:43:25 2019 +0200 @@ -26,7 +26,7 @@ #include <boost/math/special_functions/round.hpp> -namespace OrthancStone +namespace Deprecated { void ViewportGeometry::ComputeTransform() { @@ -79,7 +79,7 @@ } - void ViewportGeometry::SetSceneExtent(const Extent2D& extent) + void ViewportGeometry::SetSceneExtent(const OrthancStone::Extent2D& extent) { LOG(INFO) << "New scene extent: (" << extent.GetX1() << "," << extent.GetY1() << ") => (" @@ -168,7 +168,7 @@ } - void ViewportGeometry::ApplyTransform(CairoContext& context) const + void ViewportGeometry::ApplyTransform(OrthancStone::CairoContext& context) const { cairo_set_matrix(context.GetObject(), &transform_); } @@ -198,9 +198,9 @@ } - Matrix ViewportGeometry::GetMatrix() const + OrthancStone::Matrix ViewportGeometry::GetMatrix() const { - Matrix m(3, 3); + OrthancStone::Matrix m(3, 3); m(0, 0) = transform_.xx; m(0, 1) = transform_.xy;
--- a/Framework/Toolbox/ViewportGeometry.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Toolbox/ViewportGeometry.h Tue May 21 11:43:25 2019 +0200 @@ -26,13 +26,13 @@ #include "LinearAlgebra.h" #include "../Viewport/IMouseTracker.h" // to include "Touch" definition -namespace OrthancStone +namespace Deprecated { class ViewportGeometry { private: // Extent of the scene (in world units) - Extent2D sceneExtent_; + OrthancStone::Extent2D sceneExtent_; // Size of the display (in pixels) unsigned int width_; @@ -53,9 +53,9 @@ void SetDisplaySize(unsigned int width, unsigned int height); - void SetSceneExtent(const Extent2D& extent); + void SetSceneExtent(const OrthancStone::Extent2D& extent); - const Extent2D& GetSceneExtent() const + const OrthancStone::Extent2D& GetSceneExtent() const { return sceneExtent_; } @@ -95,7 +95,7 @@ void FitContent(); - void ApplyTransform(CairoContext& context) const; + void ApplyTransform(OrthancStone::CairoContext& context) const; void GetPan(double& x, double& y) const; @@ -105,6 +105,6 @@ void SetZoom(double zoom); - Matrix GetMatrix() const; + OrthancStone::Matrix GetMatrix() const; }; }
--- a/Framework/Viewport/IMouseTracker.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Viewport/IMouseTracker.h Tue May 21 11:43:25 2019 +0200 @@ -24,7 +24,7 @@ #include "CairoSurface.h" #include <vector> -namespace OrthancStone +namespace Deprecated { struct Touch {
--- a/Framework/Viewport/IStatusBar.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Viewport/IStatusBar.h Tue May 21 11:43:25 2019 +0200 @@ -24,7 +24,7 @@ #include <string> #include <boost/noncopyable.hpp> -namespace OrthancStone +namespace Deprecated { class IStatusBar : public boost::noncopyable {
--- a/Framework/Viewport/IViewport.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Viewport/IViewport.h Tue May 21 11:43:25 2019 +0200 @@ -28,16 +28,16 @@ #include <Core/Images/ImageAccessor.h> #include "../Viewport/IMouseTracker.h" // only to get the "Touch" definition -namespace OrthancStone +namespace Deprecated { class IWidget; // Forward declaration - class IViewport : public IObservable + class IViewport : public OrthancStone::IObservable { public: ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, ViewportChangedMessage, IViewport); - IViewport(MessageBroker& broker) : + IViewport(OrthancStone::MessageBroker& broker) : IObservable(broker) { } @@ -56,10 +56,10 @@ // The function returns "true" iff. a new frame was rendered virtual bool Render(Orthanc::ImageAccessor& surface) = 0; - virtual void MouseDown(MouseButton button, + virtual void MouseDown(OrthancStone::MouseButton button, int x, int y, - KeyboardModifiers modifiers, + OrthancStone::KeyboardModifiers modifiers, const std::vector<Touch>& touches) = 0; virtual void MouseUp() = 0; @@ -72,14 +72,14 @@ virtual void MouseLeave() = 0; - virtual void MouseWheel(MouseWheelDirection direction, + virtual void MouseWheel(OrthancStone::MouseWheelDirection direction, int x, int y, - KeyboardModifiers modifiers) = 0; + OrthancStone::KeyboardModifiers modifiers) = 0; - virtual void KeyPressed(KeyboardKeys key, + virtual void KeyPressed(OrthancStone::KeyboardKeys key, char keyChar, - KeyboardModifiers modifiers) = 0; + OrthancStone::KeyboardModifiers modifiers) = 0; virtual bool HasAnimation() = 0;
--- a/Framework/Viewport/WidgetViewport.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Viewport/WidgetViewport.cpp Tue May 21 11:43:25 2019 +0200 @@ -24,9 +24,9 @@ #include <Core/Images/ImageProcessing.h> #include <Core/OrthancException.h> -namespace OrthancStone +namespace Deprecated { - WidgetViewport::WidgetViewport(MessageBroker& broker) : + WidgetViewport::WidgetViewport(OrthancStone::MessageBroker& broker) : IViewport(broker), statusBar_(NULL), isMouseOver_(false), @@ -139,7 +139,7 @@ void WidgetViewport::TouchStart(const std::vector<Touch>& displayTouches) { - MouseDown(MouseButton_Left, (int)displayTouches[0].x, (int)displayTouches[0].y, KeyboardModifiers_None, displayTouches); // one touch is equivalent to a mouse tracker without left button -> set the mouse coordinates to the first touch coordinates + MouseDown(OrthancStone::MouseButton_Left, (int)displayTouches[0].x, (int)displayTouches[0].y, OrthancStone::KeyboardModifiers_None, displayTouches); // one touch is equivalent to a mouse tracker without left button -> set the mouse coordinates to the first touch coordinates } void WidgetViewport::TouchMove(const std::vector<Touch>& displayTouches) @@ -154,10 +154,10 @@ MouseUp(); } - void WidgetViewport::MouseDown(MouseButton button, + void WidgetViewport::MouseDown(OrthancStone::MouseButton button, int x, int y, - KeyboardModifiers modifiers, + OrthancStone::KeyboardModifiers modifiers, const std::vector<Touch>& displayTouches ) { @@ -241,10 +241,10 @@ } - void WidgetViewport::MouseWheel(MouseWheelDirection direction, + void WidgetViewport::MouseWheel(OrthancStone::MouseWheelDirection direction, int x, int y, - KeyboardModifiers modifiers) + OrthancStone::KeyboardModifiers modifiers) { if (centralWidget_.get() != NULL && mouseTracker_.get() == NULL) @@ -254,9 +254,9 @@ } - void WidgetViewport::KeyPressed(KeyboardKeys key, + void WidgetViewport::KeyPressed(OrthancStone::KeyboardKeys key, char keyChar, - KeyboardModifiers modifiers) + OrthancStone::KeyboardModifiers modifiers) { if (centralWidget_.get() != NULL && mouseTracker_.get() == NULL)
--- a/Framework/Viewport/WidgetViewport.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Viewport/WidgetViewport.h Tue May 21 11:43:25 2019 +0200 @@ -26,7 +26,7 @@ #include <memory> -namespace OrthancStone +namespace Deprecated { class WidgetViewport : public IViewport { @@ -37,11 +37,11 @@ bool isMouseOver_; int lastMouseX_; int lastMouseY_; - CairoSurface background_; + OrthancStone::CairoSurface background_; bool backgroundChanged_; public: - WidgetViewport(MessageBroker& broker); + WidgetViewport(OrthancStone::MessageBroker& broker); virtual void FitContent(); @@ -56,10 +56,10 @@ virtual bool Render(Orthanc::ImageAccessor& surface); - virtual void MouseDown(MouseButton button, + virtual void MouseDown(OrthancStone::MouseButton button, int x, int y, - KeyboardModifiers modifiers, + OrthancStone::KeyboardModifiers modifiers, const std::vector<Touch>& displayTouches); virtual void MouseUp(); @@ -78,14 +78,14 @@ virtual void TouchEnd(const std::vector<Touch>& touches); - virtual void MouseWheel(MouseWheelDirection direction, + virtual void MouseWheel(OrthancStone::MouseWheelDirection direction, int x, int y, - KeyboardModifiers modifiers); + OrthancStone::KeyboardModifiers modifiers); - virtual void KeyPressed(KeyboardKeys key, + virtual void KeyPressed(OrthancStone::KeyboardKeys key, char keyChar, - KeyboardModifiers modifiers); + OrthancStone::KeyboardModifiers modifiers); virtual bool HasAnimation();
--- a/Framework/Volumes/ISlicedVolume.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Volumes/ISlicedVolume.h Tue May 21 11:43:25 2019 +0200 @@ -24,9 +24,9 @@ #include "../Messages/IObservable.h" #include "../Toolbox/Slice.h" -namespace OrthancStone +namespace Deprecated { - class ISlicedVolume : public IObservable + class ISlicedVolume : public OrthancStone::IObservable { public: ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, ContentChangedMessage, ISlicedVolume); @@ -35,18 +35,18 @@ ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, VolumeReadyMessage, ISlicedVolume); - class SliceContentChangedMessage : public OriginMessage<ISlicedVolume> + class SliceContentChangedMessage : public OrthancStone::OriginMessage<ISlicedVolume> { ORTHANC_STONE_MESSAGE(__FILE__, __LINE__); private: size_t sliceIndex_; - const Deprecated::Slice& slice_; + const Slice& slice_; public: SliceContentChangedMessage(ISlicedVolume& origin, size_t sliceIndex, - const Deprecated::Slice& slice) : + const Slice& slice) : OriginMessage(origin), sliceIndex_(sliceIndex), slice_(slice) @@ -58,20 +58,20 @@ return sliceIndex_; } - const Deprecated::Slice& GetSlice() const + const Slice& GetSlice() const { return slice_; } }; - ISlicedVolume(MessageBroker& broker) : + ISlicedVolume(OrthancStone::MessageBroker& broker) : IObservable(broker) { } virtual size_t GetSliceCount() const = 0; - virtual const Deprecated::Slice& GetSlice(size_t slice) const = 0; + virtual const Slice& GetSlice(size_t slice) const = 0; }; }
--- a/Framework/Volumes/IVolumeLoader.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Volumes/IVolumeLoader.h Tue May 21 11:43:25 2019 +0200 @@ -23,16 +23,16 @@ #include "../Messages/IObservable.h" -namespace OrthancStone +namespace Deprecated { - class IVolumeLoader : public IObservable + class IVolumeLoader : public OrthancStone::IObservable { public: ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, GeometryReadyMessage, IVolumeLoader); ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, GeometryErrorMessage, IVolumeLoader); ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, ContentChangedMessage, IVolumeLoader); - IVolumeLoader(MessageBroker& broker) : + IVolumeLoader(OrthancStone::MessageBroker& broker) : IObservable(broker) { }
--- a/Framework/Volumes/ImageBuffer3D.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Volumes/ImageBuffer3D.cpp Tue May 21 11:43:25 2019 +0200 @@ -258,7 +258,7 @@ } - bool ImageBuffer3D::FitWindowingToRange(RenderStyle& style, + bool ImageBuffer3D::FitWindowingToRange(Deprecated::RenderStyle& style, const Deprecated::DicomFrameConverter& converter) const { if (hasRange_)
--- a/Framework/Volumes/ImageBuffer3D.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Volumes/ImageBuffer3D.h Tue May 21 11:43:25 2019 +0200 @@ -121,7 +121,7 @@ bool GetRange(float& minValue, float& maxValue) const; - bool FitWindowingToRange(RenderStyle& style, + bool FitWindowingToRange(Deprecated::RenderStyle& style, const Deprecated::DicomFrameConverter& converter) const; uint8_t GetVoxelGrayscale8Unchecked(unsigned int x,
--- a/Framework/Volumes/StructureSetLoader.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Volumes/StructureSetLoader.cpp Tue May 21 11:43:25 2019 +0200 @@ -25,9 +25,9 @@ #include <Core/OrthancException.h> -namespace OrthancStone +namespace Deprecated { - StructureSetLoader::StructureSetLoader(MessageBroker& broker, + StructureSetLoader::StructureSetLoader(OrthancStone::MessageBroker& broker, OrthancApiClient& orthanc) : IVolumeLoader(broker), IObserver(broker), @@ -41,7 +41,7 @@ OrthancPlugins::FullOrthancDataset dataset(message.GetJson()); Orthanc::DicomMap slice; - MessagingToolbox::ConvertDataset(slice, dataset); + OrthancStone::MessagingToolbox::ConvertDataset(slice, dataset); structureSet_->AddReferencedSlice(slice); BroadcastMessage(ContentChangedMessage(*this)); @@ -51,7 +51,7 @@ void StructureSetLoader::OnStructureSetLoaded(const OrthancApiClient::JsonResponseReadyMessage& message) { OrthancPlugins::FullOrthancDataset dataset(message.GetJson()); - structureSet_.reset(new DicomStructureSet(dataset)); + structureSet_.reset(new OrthancStone::DicomStructureSet(dataset)); std::set<std::string> instances; structureSet_->GetReferencedInstances(instances); @@ -60,7 +60,7 @@ it != instances.end(); ++it) { orthanc_.PostBinaryAsyncExpectJson("/tools/lookup", *it, - new Callable<StructureSetLoader, OrthancApiClient::JsonResponseReadyMessage>(*this, &StructureSetLoader::OnLookupCompleted)); + new OrthancStone::Callable<StructureSetLoader, OrthancApiClient::JsonResponseReadyMessage>(*this, &StructureSetLoader::OnLookupCompleted)); } BroadcastMessage(GeometryReadyMessage(*this)); @@ -84,7 +84,7 @@ const std::string& instance = lookup[0]["ID"].asString(); orthanc_.GetJsonAsync("/instances/" + instance + "/tags", - new Callable<StructureSetLoader, OrthancApiClient::JsonResponseReadyMessage>(*this, &StructureSetLoader::OnReferencedSliceLoaded)); + new OrthancStone::Callable<StructureSetLoader, OrthancApiClient::JsonResponseReadyMessage>(*this, &StructureSetLoader::OnReferencedSliceLoaded)); } @@ -97,12 +97,12 @@ else { orthanc_.GetJsonAsync("/instances/" + instance + "/tags?ignore-length=3006-0050", - new Callable<StructureSetLoader, OrthancApiClient::JsonResponseReadyMessage>(*this, &StructureSetLoader::OnStructureSetLoaded)); + new OrthancStone::Callable<StructureSetLoader, OrthancApiClient::JsonResponseReadyMessage>(*this, &StructureSetLoader::OnStructureSetLoaded)); } } - DicomStructureSet& StructureSetLoader::GetStructureSet() + OrthancStone::DicomStructureSet& StructureSetLoader::GetStructureSet() { if (structureSet_.get() == NULL) {
--- a/Framework/Volumes/StructureSetLoader.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Volumes/StructureSetLoader.h Tue May 21 11:43:25 2019 +0200 @@ -25,15 +25,15 @@ #include "../Toolbox/OrthancApiClient.h" #include "IVolumeLoader.h" -namespace OrthancStone +namespace Deprecated { class StructureSetLoader : public IVolumeLoader, - public IObserver + public OrthancStone::IObserver { private: OrthancApiClient& orthanc_; - std::auto_ptr<DicomStructureSet> structureSet_; + std::auto_ptr<OrthancStone::DicomStructureSet> structureSet_; void OnReferencedSliceLoaded(const OrthancApiClient::JsonResponseReadyMessage& message); @@ -42,7 +42,7 @@ void OnLookupCompleted(const OrthancApiClient::JsonResponseReadyMessage& message); public: - StructureSetLoader(MessageBroker& broker, + StructureSetLoader(OrthancStone::MessageBroker& broker, OrthancApiClient& orthanc); void ScheduleLoadInstance(const std::string& instance); @@ -52,6 +52,6 @@ return structureSet_.get() != NULL; } - DicomStructureSet& GetStructureSet(); + OrthancStone::DicomStructureSet& GetStructureSet(); }; }
--- a/Framework/Widgets/CairoWidget.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Widgets/CairoWidget.cpp Tue May 21 11:43:25 2019 +0200 @@ -24,7 +24,7 @@ #include <Core/Images/ImageProcessing.h> #include <Core/OrthancException.h> -namespace OrthancStone +namespace Deprecated { static bool IsAligned(const Orthanc::ImageAccessor& target) { @@ -51,14 +51,14 @@ if (IsAligned(target)) { - CairoSurface surface(target, false /* no alpha */); - CairoContext context(surface); + OrthancStone::CairoSurface surface(target, false /* no alpha */); + OrthancStone::CairoContext context(surface); ClearBackgroundCairo(context); return RenderCairo(context); } else { - CairoContext context(surface_); + OrthancStone::CairoContext context(surface_); ClearBackgroundCairo(context); if (RenderCairo(context)) @@ -82,8 +82,8 @@ { if (IsAligned(target)) { - CairoSurface surface(target, false /* no alpha */); - CairoContext context(surface); + OrthancStone::CairoSurface surface(target, false /* no alpha */); + OrthancStone::CairoContext context(surface); RenderMouseOverCairo(context, x, y); } else @@ -92,7 +92,7 @@ surface_.GetWriteableAccessor(accessor); Orthanc::ImageProcessing::Copy(accessor, target); - CairoContext context(surface_); + OrthancStone::CairoContext context(surface_); RenderMouseOverCairo(context, x, y); Orthanc::ImageProcessing::Copy(target, accessor);
--- a/Framework/Widgets/CairoWidget.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Widgets/CairoWidget.h Tue May 21 11:43:25 2019 +0200 @@ -23,17 +23,17 @@ #include "WidgetBase.h" -namespace OrthancStone +namespace Deprecated { class CairoWidget : public WidgetBase { private: - CairoSurface surface_; + OrthancStone::CairoSurface surface_; protected: - virtual bool RenderCairo(CairoContext& context) = 0; + virtual bool RenderCairo(OrthancStone::CairoContext& context) = 0; - virtual void RenderMouseOverCairo(CairoContext& context, + virtual void RenderMouseOverCairo(OrthancStone::CairoContext& context, int x, int y) = 0;
--- a/Framework/Widgets/EmptyWidget.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Widgets/EmptyWidget.cpp Tue May 21 11:43:25 2019 +0200 @@ -24,7 +24,7 @@ #include <Core/Images/ImageProcessing.h> #include <Core/OrthancException.h> -namespace OrthancStone +namespace Deprecated { bool EmptyWidget::Render(Orthanc::ImageAccessor& surface) {
--- a/Framework/Widgets/EmptyWidget.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Widgets/EmptyWidget.h Tue May 21 11:43:25 2019 +0200 @@ -23,7 +23,7 @@ #include "IWidget.h" -namespace OrthancStone +namespace Deprecated { /** * This is a test widget that simply fills its surface with an @@ -73,10 +73,10 @@ virtual bool Render(Orthanc::ImageAccessor& surface); - virtual IMouseTracker* CreateMouseTracker(MouseButton button, + virtual IMouseTracker* CreateMouseTracker(OrthancStone::MouseButton button, int x, int y, - KeyboardModifiers modifiers, + OrthancStone::KeyboardModifiers modifiers, const std::vector<Touch>& touches) { return NULL; @@ -88,16 +88,16 @@ { } - virtual void MouseWheel(MouseWheelDirection direction, + virtual void MouseWheel(OrthancStone::MouseWheelDirection direction, int x, int y, - KeyboardModifiers modifiers) + OrthancStone::KeyboardModifiers modifiers) { } - virtual void KeyPressed(KeyboardKeys key, + virtual void KeyPressed(OrthancStone::KeyboardKeys key, char keyChar, - KeyboardModifiers modifiers) + OrthancStone::KeyboardModifiers modifiers) { }
--- a/Framework/Widgets/IWidget.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Widgets/IWidget.h Tue May 21 11:43:25 2019 +0200 @@ -25,7 +25,7 @@ #include "../Viewport/IMouseTracker.h" #include "../Viewport/IStatusBar.h" -namespace OrthancStone +namespace Deprecated { class WidgetViewport; // Forward declaration @@ -49,10 +49,10 @@ virtual bool Render(Orthanc::ImageAccessor& surface) = 0; - virtual IMouseTracker* CreateMouseTracker(MouseButton button, + virtual IMouseTracker* CreateMouseTracker(OrthancStone::MouseButton button, int x, int y, - KeyboardModifiers modifiers, + OrthancStone::KeyboardModifiers modifiers, const std::vector<Touch>& touches) = 0; virtual void RenderMouseOver(Orthanc::ImageAccessor& target, @@ -61,14 +61,14 @@ virtual bool HasRenderMouseOver() = 0; - virtual void MouseWheel(MouseWheelDirection direction, + virtual void MouseWheel(OrthancStone::MouseWheelDirection direction, int x, int y, - KeyboardModifiers modifiers) = 0; + OrthancStone::KeyboardModifiers modifiers) = 0; - virtual void KeyPressed(KeyboardKeys key, + virtual void KeyPressed(OrthancStone::KeyboardKeys key, char keyChar, - KeyboardModifiers modifiers) = 0; + OrthancStone::KeyboardModifiers modifiers) = 0; virtual bool HasAnimation() const = 0;
--- a/Framework/Widgets/IWorldSceneInteractor.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Widgets/IWorldSceneInteractor.h Tue May 21 11:43:25 2019 +0200 @@ -27,7 +27,7 @@ #include "../StoneEnumerations.h" #include "../Viewport/IStatusBar.h" -namespace OrthancStone +namespace Deprecated { class WorldSceneWidget; @@ -40,8 +40,8 @@ virtual IWorldSceneMouseTracker* CreateMouseTracker(WorldSceneWidget& widget, const ViewportGeometry& view, - MouseButton button, - KeyboardModifiers modifiers, + OrthancStone::MouseButton button, + OrthancStone::KeyboardModifiers modifiers, int viewportX, int viewportY, double x, @@ -49,7 +49,7 @@ IStatusBar* statusBar, const std::vector<Touch>& touches) = 0; - virtual void MouseOver(CairoContext& context, + virtual void MouseOver(OrthancStone::CairoContext& context, WorldSceneWidget& widget, const ViewportGeometry& view, double x, @@ -57,14 +57,14 @@ IStatusBar* statusBar) = 0; virtual void MouseWheel(WorldSceneWidget& widget, - MouseWheelDirection direction, - KeyboardModifiers modifiers, + OrthancStone::MouseWheelDirection direction, + OrthancStone::KeyboardModifiers modifiers, IStatusBar* statusBar) = 0; virtual void KeyPressed(WorldSceneWidget& widget, - KeyboardKeys key, + OrthancStone::KeyboardKeys key, char keyChar, - KeyboardModifiers modifiers, + OrthancStone::KeyboardModifiers modifiers, IStatusBar* statusBar) = 0; }; }
--- a/Framework/Widgets/IWorldSceneMouseTracker.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Widgets/IWorldSceneMouseTracker.h Tue May 21 11:43:25 2019 +0200 @@ -24,7 +24,7 @@ #include "../Viewport/CairoContext.h" #include "../Viewport/IMouseTracker.h" // only to get the "Touch" definition -namespace OrthancStone +namespace Deprecated { // this is tracking a mouse in scene coordinates/mm unlike @@ -39,7 +39,7 @@ virtual bool HasRender() const = 0; - virtual void Render(CairoContext& context, + virtual void Render(OrthancStone::CairoContext& context, double zoom) = 0; virtual void MouseUp() = 0;
--- a/Framework/Widgets/LayoutWidget.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Widgets/LayoutWidget.cpp Tue May 21 11:43:25 2019 +0200 @@ -26,7 +26,7 @@ #include <boost/math/special_functions/round.hpp> -namespace OrthancStone +namespace Deprecated { class LayoutWidget::LayoutMouseTracker : public IMouseTracker { @@ -154,10 +154,10 @@ } } - IMouseTracker* CreateMouseTracker(MouseButton button, + IMouseTracker* CreateMouseTracker(OrthancStone::MouseButton button, int x, int y, - KeyboardModifiers modifiers, + OrthancStone::KeyboardModifiers modifiers, const std::vector<Touch>& touches) { if (Contains(x, y)) @@ -189,10 +189,10 @@ } } - void MouseWheel(MouseWheelDirection direction, + void MouseWheel(OrthancStone::MouseWheelDirection direction, int x, int y, - KeyboardModifiers modifiers) + OrthancStone::KeyboardModifiers modifiers) { if (Contains(x, y)) { @@ -419,10 +419,10 @@ } - IMouseTracker* LayoutWidget::CreateMouseTracker(MouseButton button, + IMouseTracker* LayoutWidget::CreateMouseTracker(OrthancStone::MouseButton button, int x, int y, - KeyboardModifiers modifiers, + OrthancStone::KeyboardModifiers modifiers, const std::vector<Touch>& touches) { for (size_t i = 0; i < children_.size(); i++) @@ -449,10 +449,10 @@ } - void LayoutWidget::MouseWheel(MouseWheelDirection direction, + void LayoutWidget::MouseWheel(OrthancStone::MouseWheelDirection direction, int x, int y, - KeyboardModifiers modifiers) + OrthancStone::KeyboardModifiers modifiers) { for (size_t i = 0; i < children_.size(); i++) { @@ -461,9 +461,9 @@ } - void LayoutWidget::KeyPressed(KeyboardKeys key, + void LayoutWidget::KeyPressed(OrthancStone::KeyboardKeys key, char keyChar, - KeyboardModifiers modifiers) + OrthancStone::KeyboardModifiers modifiers) { for (size_t i = 0; i < children_.size(); i++) {
--- a/Framework/Widgets/LayoutWidget.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Widgets/LayoutWidget.h Tue May 21 11:43:25 2019 +0200 @@ -26,7 +26,7 @@ #include <vector> #include <memory> -namespace OrthancStone +namespace Deprecated { class LayoutWidget : public WidgetBase { @@ -103,24 +103,24 @@ virtual bool Render(Orthanc::ImageAccessor& surface); - virtual IMouseTracker* CreateMouseTracker(MouseButton button, + virtual IMouseTracker* CreateMouseTracker(OrthancStone::MouseButton button, int x, int y, - KeyboardModifiers modifiers, + OrthancStone::KeyboardModifiers modifiers, const std::vector<Touch>& touches); virtual void RenderMouseOver(Orthanc::ImageAccessor& target, int x, int y); - virtual void MouseWheel(MouseWheelDirection direction, + virtual void MouseWheel(OrthancStone::MouseWheelDirection direction, int x, int y, - KeyboardModifiers modifiers); + OrthancStone::KeyboardModifiers modifiers); - virtual void KeyPressed(KeyboardKeys key, + virtual void KeyPressed(OrthancStone::KeyboardKeys key, char keyChar, - KeyboardModifiers modifiers); + OrthancStone::KeyboardModifiers modifiers); virtual bool HasAnimation() const {
--- a/Framework/Widgets/PanMouseTracker.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Widgets/PanMouseTracker.cpp Tue May 21 11:43:25 2019 +0200 @@ -24,7 +24,7 @@ #include <Core/Logging.h> #include <Core/OrthancException.h> -namespace OrthancStone +namespace Deprecated { PanMouseTracker::PanMouseTracker(WorldSceneWidget& that, int x, @@ -36,7 +36,7 @@ } - void PanMouseTracker::Render(CairoContext& context, + void PanMouseTracker::Render(OrthancStone::CairoContext& context, double zoom) { throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError);
--- a/Framework/Widgets/PanMouseTracker.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Widgets/PanMouseTracker.h Tue May 21 11:43:25 2019 +0200 @@ -23,7 +23,7 @@ #include "WorldSceneWidget.h" -namespace OrthancStone +namespace Deprecated { class PanMouseTracker : public IWorldSceneMouseTracker { @@ -48,7 +48,7 @@ { } - virtual void Render(CairoContext& context, + virtual void Render(OrthancStone::CairoContext& context, double zoom); virtual void MouseMove(int displayX,
--- a/Framework/Widgets/PanZoomMouseTracker.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Widgets/PanZoomMouseTracker.cpp Tue May 21 11:43:25 2019 +0200 @@ -25,7 +25,7 @@ #include <Core/OrthancException.h> #include <math.h> -namespace OrthancStone +namespace Deprecated { Touch GetCenter(const std::vector<Touch>& touches) { @@ -75,7 +75,7 @@ } - void PanZoomMouseTracker::Render(CairoContext& context, + void PanZoomMouseTracker::Render(OrthancStone::CairoContext& context, double zoom) { throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError);
--- a/Framework/Widgets/PanZoomMouseTracker.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Widgets/PanZoomMouseTracker.h Tue May 21 11:43:25 2019 +0200 @@ -23,7 +23,7 @@ #include "WorldSceneWidget.h" -namespace OrthancStone +namespace Deprecated { class PanZoomMouseTracker : public IWorldSceneMouseTracker { @@ -52,7 +52,7 @@ { } - virtual void Render(CairoContext& context, + virtual void Render(OrthancStone::CairoContext& context, double zoom); virtual void MouseMove(int displayX,
--- a/Framework/Widgets/SliceViewerWidget.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Widgets/SliceViewerWidget.cpp Tue May 21 11:43:25 2019 +0200 @@ -33,12 +33,12 @@ static const double THIN_SLICE_THICKNESS = 100.0 * std::numeric_limits<double>::epsilon(); -namespace OrthancStone +namespace Deprecated { class SliceViewerWidget::Scene : public boost::noncopyable { private: - CoordinateSystem3D plane_; + OrthancStone::CoordinateSystem3D plane_; double thickness_; size_t countMissing_; std::vector<ILayerRenderer*> renderers_; @@ -62,7 +62,7 @@ } } - Scene(const CoordinateSystem3D& plane, + Scene(const OrthancStone::CoordinateSystem3D& plane, double thickness, size_t countLayers) : plane_(plane), @@ -98,7 +98,7 @@ countMissing_--; } - const CoordinateSystem3D& GetPlane() const + const OrthancStone::CoordinateSystem3D& GetPlane() const { return plane_; } @@ -118,9 +118,9 @@ return static_cast<unsigned int>(countMissing_); } - bool RenderScene(CairoContext& context, + bool RenderScene(OrthancStone::CairoContext& context, const ViewportGeometry& view, - const CoordinateSystem3D& viewportPlane) + const OrthancStone::CoordinateSystem3D& viewportPlane) { bool fullQuality = true; cairo_t *cr = context.GetObject(); @@ -129,7 +129,7 @@ { if (renderers_[i] != NULL) { - const CoordinateSystem3D& framePlane = renderers_[i]->GetLayerPlane(); + const OrthancStone::CoordinateSystem3D& framePlane = renderers_[i]->GetLayerPlane(); double x0, y0, x1, y1, x2, y2; viewportPlane.ProjectPoint(x0, y0, framePlane.GetOrigin()); @@ -207,12 +207,12 @@ } } - bool ContainsPlane(const CoordinateSystem3D& plane) const + bool ContainsPlane(const OrthancStone::CoordinateSystem3D& plane) const { bool isOpposite; - if (!GeometryToolbox::IsParallelOrOpposite(isOpposite, - plane.GetNormal(), - plane_.GetNormal())) + if (!OrthancStone::GeometryToolbox::IsParallelOrOpposite(isOpposite, + plane.GetNormal(), + plane_.GetNormal())) { return false; } @@ -256,12 +256,12 @@ } - void SliceViewerWidget::GetLayerExtent(Extent2D& extent, + void SliceViewerWidget::GetLayerExtent(OrthancStone::Extent2D& extent, IVolumeSlicer& source) const { extent.Reset(); - std::vector<Vector> points; + std::vector<OrthancStone::Vector> points; if (source.GetExtent(points, plane_)) { for (size_t i = 0; i < points.size(); i++) @@ -274,14 +274,14 @@ } - Extent2D SliceViewerWidget::GetSceneExtent() + OrthancStone::Extent2D SliceViewerWidget::GetSceneExtent() { - Extent2D sceneExtent; + OrthancStone::Extent2D sceneExtent; for (size_t i = 0; i < layers_.size(); i++) { assert(layers_[i] != NULL); - Extent2D layerExtent; + OrthancStone::Extent2D layerExtent; GetLayerExtent(layerExtent, *layers_[i]); sceneExtent.Union(layerExtent); @@ -291,7 +291,7 @@ } - bool SliceViewerWidget::RenderScene(CairoContext& context, + bool SliceViewerWidget::RenderScene(OrthancStone::CairoContext& context, const ViewportGeometry& view) { if (currentScene_.get() != NULL) @@ -323,7 +323,7 @@ void SliceViewerWidget::UpdateLayer(size_t index, ILayerRenderer* renderer, - const CoordinateSystem3D& plane) + const OrthancStone::CoordinateSystem3D& plane) { LOG(INFO) << "Updating layer " << index; @@ -364,7 +364,7 @@ } - SliceViewerWidget::SliceViewerWidget(MessageBroker& broker, + SliceViewerWidget::SliceViewerWidget(OrthancStone::MessageBroker& broker, const std::string& name) : WorldSceneWidget(name), IObserver(broker), @@ -385,16 +385,16 @@ void SliceViewerWidget::ObserveLayer(IVolumeSlicer& layer) { - layer.RegisterObserverCallback(new Callable<SliceViewerWidget, IVolumeSlicer::GeometryReadyMessage> + layer.RegisterObserverCallback(new OrthancStone::Callable<SliceViewerWidget, IVolumeSlicer::GeometryReadyMessage> (*this, &SliceViewerWidget::OnGeometryReady)); // currently ignore errors layer->RegisterObserverCallback(new Callable<SliceViewerWidget, IVolumeSlicer::GeometryErrorMessage>(*this, &SliceViewerWidget::...)); - layer.RegisterObserverCallback(new Callable<SliceViewerWidget, IVolumeSlicer::SliceContentChangedMessage> + layer.RegisterObserverCallback(new OrthancStone::Callable<SliceViewerWidget, IVolumeSlicer::SliceContentChangedMessage> (*this, &SliceViewerWidget::OnSliceChanged)); - layer.RegisterObserverCallback(new Callable<SliceViewerWidget, IVolumeSlicer::ContentChangedMessage> + layer.RegisterObserverCallback(new OrthancStone::Callable<SliceViewerWidget, IVolumeSlicer::ContentChangedMessage> (*this, &SliceViewerWidget::OnContentChanged)); - layer.RegisterObserverCallback(new Callable<SliceViewerWidget, IVolumeSlicer::LayerReadyMessage> + layer.RegisterObserverCallback(new OrthancStone::Callable<SliceViewerWidget, IVolumeSlicer::LayerReadyMessage> (*this, &SliceViewerWidget::OnLayerReady)); - layer.RegisterObserverCallback(new Callable<SliceViewerWidget, IVolumeSlicer::LayerErrorMessage> + layer.RegisterObserverCallback(new OrthancStone::Callable<SliceViewerWidget, IVolumeSlicer::LayerErrorMessage> (*this, &SliceViewerWidget::OnLayerError)); } @@ -504,7 +504,7 @@ } - void SliceViewerWidget::SetSlice(const CoordinateSystem3D& plane) + void SliceViewerWidget::SetSlice(const OrthancStone::CoordinateSystem3D& plane) { LOG(INFO) << "Setting slice origin: (" << plane.GetOrigin()[0] << "," << plane.GetOrigin()[1]
--- a/Framework/Widgets/SliceViewerWidget.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Widgets/SliceViewerWidget.h Tue May 21 11:43:25 2019 +0200 @@ -28,12 +28,12 @@ #include <map> -namespace OrthancStone +namespace Deprecated { class SliceViewerWidget : public WorldSceneWidget, - public IObserver, - public IObservable + public OrthancStone::IObserver, + public OrthancStone::IObservable { public: ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, GeometryChangedMessage, SliceViewerWidget); @@ -41,7 +41,7 @@ // TODO - Use this message in ReferenceLineSource - class DisplayedSliceMessage : public OriginMessage<SliceViewerWidget> + class DisplayedSliceMessage : public OrthancStone::OriginMessage<SliceViewerWidget> { ORTHANC_STONE_MESSAGE(__FILE__, __LINE__); @@ -74,7 +74,7 @@ LayersIndex layersIndex_; std::vector<IVolumeSlicer*> layers_; std::vector<RenderStyle> styles_; - CoordinateSystem3D plane_; + OrthancStone::CoordinateSystem3D plane_; std::auto_ptr<Scene> currentScene_; std::auto_ptr<Scene> pendingScene_; std::vector<bool> changedLayers_; @@ -82,7 +82,7 @@ bool LookupLayer(size_t& index /* out */, const IVolumeSlicer& layer) const; - void GetLayerExtent(Extent2D& extent, + void GetLayerExtent(OrthancStone::Extent2D& extent, IVolumeSlicer& source) const; void OnGeometryReady(const IVolumeSlicer::GeometryReadyMessage& message); @@ -100,20 +100,20 @@ void ResetChangedLayers(); public: - SliceViewerWidget(MessageBroker& broker, + SliceViewerWidget(OrthancStone::MessageBroker& broker, const std::string& name); - virtual Extent2D GetSceneExtent(); + virtual OrthancStone::Extent2D GetSceneExtent(); protected: - virtual bool RenderScene(CairoContext& context, + virtual bool RenderScene(OrthancStone::CairoContext& context, const ViewportGeometry& view); void ResetPendingScene(); void UpdateLayer(size_t index, ILayerRenderer* renderer, - const CoordinateSystem3D& plane); + const OrthancStone::CoordinateSystem3D& plane); void InvalidateAllLayers(); @@ -138,9 +138,9 @@ void SetLayerStyle(size_t layer, const RenderStyle& style); - void SetSlice(const CoordinateSystem3D& plane); + void SetSlice(const OrthancStone::CoordinateSystem3D& plane); - const CoordinateSystem3D& GetSlice() const + const OrthancStone::CoordinateSystem3D& GetSlice() const { return plane_; }
--- a/Framework/Widgets/TestCairoWidget.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Widgets/TestCairoWidget.cpp Tue May 21 11:43:25 2019 +0200 @@ -24,7 +24,7 @@ #include <stdio.h> -namespace OrthancStone +namespace Deprecated { namespace Samples { @@ -40,7 +40,7 @@ } - bool TestCairoWidget::RenderCairo(CairoContext& context) + bool TestCairoWidget::RenderCairo(OrthancStone::CairoContext& context) { cairo_t* cr = context.GetObject(); @@ -60,7 +60,7 @@ } - void TestCairoWidget::RenderMouseOverCairo(CairoContext& context, + void TestCairoWidget::RenderMouseOverCairo(OrthancStone::CairoContext& context, int x, int y) { @@ -96,10 +96,10 @@ } - IMouseTracker* TestCairoWidget::CreateMouseTracker(MouseButton button, + IMouseTracker* TestCairoWidget::CreateMouseTracker(OrthancStone::MouseButton button, int x, int y, - KeyboardModifiers modifiers, + OrthancStone::KeyboardModifiers modifiers, const std::vector<Touch>& touches) { UpdateStatusBar("Click"); @@ -107,18 +107,18 @@ } - void TestCairoWidget::MouseWheel(MouseWheelDirection direction, + void TestCairoWidget::MouseWheel(OrthancStone::MouseWheelDirection direction, int x, int y, - KeyboardModifiers modifiers) + OrthancStone::KeyboardModifiers modifiers) { - UpdateStatusBar(direction == MouseWheelDirection_Down ? "Wheel down" : "Wheel up"); + UpdateStatusBar(direction == OrthancStone::MouseWheelDirection_Down ? "Wheel down" : "Wheel up"); } - void TestCairoWidget::KeyPressed(KeyboardKeys key, + void TestCairoWidget::KeyPressed(OrthancStone::KeyboardKeys key, char keyChar, - KeyboardModifiers modifiers) + OrthancStone::KeyboardModifiers modifiers) { UpdateStatusBar("Key pressed: \"" + std::string(1, keyChar) + "\""); }
--- a/Framework/Widgets/TestCairoWidget.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Widgets/TestCairoWidget.h Tue May 21 11:43:25 2019 +0200 @@ -23,7 +23,7 @@ #include "CairoWidget.h" -namespace OrthancStone +namespace Deprecated { namespace Samples { @@ -36,9 +36,9 @@ bool animate_; protected: - virtual bool RenderCairo(CairoContext& context); + virtual bool RenderCairo(OrthancStone::CairoContext& context); - virtual void RenderMouseOverCairo(CairoContext& context, + virtual void RenderMouseOverCairo(OrthancStone::CairoContext& context, int x, int y); @@ -48,20 +48,20 @@ virtual void SetSize(unsigned int width, unsigned int height); - virtual IMouseTracker* CreateMouseTracker(MouseButton button, + virtual IMouseTracker* CreateMouseTracker(OrthancStone::MouseButton button, int x, int y, - KeyboardModifiers modifiers, + OrthancStone::KeyboardModifiers modifiers, const std::vector<Touch>& touches); - virtual void MouseWheel(MouseWheelDirection direction, + virtual void MouseWheel(OrthancStone::MouseWheelDirection direction, int x, int y, - KeyboardModifiers modifiers); + OrthancStone::KeyboardModifiers modifiers); - virtual void KeyPressed(KeyboardKeys key, + virtual void KeyPressed(OrthancStone::KeyboardKeys key, char keyChar, - KeyboardModifiers modifiers); + OrthancStone::KeyboardModifiers modifiers); virtual bool HasAnimation() const {
--- a/Framework/Widgets/TestWorldSceneWidget.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Widgets/TestWorldSceneWidget.cpp Tue May 21 11:43:25 2019 +0200 @@ -26,7 +26,7 @@ #include <math.h> #include <stdio.h> -namespace OrthancStone +namespace Deprecated { namespace Samples { @@ -35,8 +35,8 @@ public: virtual IWorldSceneMouseTracker* CreateMouseTracker(WorldSceneWidget& widget, const ViewportGeometry& view, - MouseButton button, - KeyboardModifiers modifiers, + OrthancStone::MouseButton button, + OrthancStone::KeyboardModifiers modifiers, int viewportX, int viewportY, double x, @@ -54,7 +54,7 @@ return NULL; } - virtual void MouseOver(CairoContext& context, + virtual void MouseOver(OrthancStone::CairoContext& context, WorldSceneWidget& widget, const ViewportGeometry& view, double x, @@ -75,20 +75,20 @@ } virtual void MouseWheel(WorldSceneWidget& widget, - MouseWheelDirection direction, - KeyboardModifiers modifiers, + OrthancStone::MouseWheelDirection direction, + OrthancStone::KeyboardModifiers modifiers, IStatusBar* statusBar) { if (statusBar) { - statusBar->SetMessage(direction == MouseWheelDirection_Down ? "Wheel down" : "Wheel up"); + statusBar->SetMessage(direction == OrthancStone::MouseWheelDirection_Down ? "Wheel down" : "Wheel up"); } } virtual void KeyPressed(WorldSceneWidget& widget, - KeyboardKeys key, + OrthancStone::KeyboardKeys key, char keyChar, - KeyboardModifiers modifiers, + OrthancStone::KeyboardModifiers modifiers, IStatusBar* statusBar) { if (statusBar) @@ -99,7 +99,7 @@ }; - bool TestWorldSceneWidget::RenderScene(CairoContext& context, + bool TestWorldSceneWidget::RenderScene(OrthancStone::CairoContext& context, const ViewportGeometry& view) { cairo_t* cr = context.GetObject(); @@ -127,9 +127,9 @@ } - Extent2D TestWorldSceneWidget::GetSceneExtent() + OrthancStone::Extent2D TestWorldSceneWidget::GetSceneExtent() { - return Extent2D(-10, -.5, 10, .5); + return OrthancStone::Extent2D(-10, -.5, 10, .5); }
--- a/Framework/Widgets/TestWorldSceneWidget.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Widgets/TestWorldSceneWidget.h Tue May 21 11:43:25 2019 +0200 @@ -25,7 +25,7 @@ #include <memory> -namespace OrthancStone +namespace Deprecated { namespace Samples { @@ -39,13 +39,13 @@ unsigned int count_; protected: - virtual bool RenderScene(CairoContext& context, + virtual bool RenderScene(OrthancStone::CairoContext& context, const ViewportGeometry& view); public: TestWorldSceneWidget(const std::string& name, bool animate); - virtual Extent2D GetSceneExtent(); + virtual OrthancStone::Extent2D GetSceneExtent(); virtual bool HasAnimation() const {
--- a/Framework/Widgets/WidgetBase.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Widgets/WidgetBase.cpp Tue May 21 11:43:25 2019 +0200 @@ -25,7 +25,7 @@ #include <Core/Images/ImageProcessing.h> #include <Core/Logging.h> -namespace OrthancStone +namespace Deprecated { void WidgetBase::NotifyContentChanged() { @@ -69,7 +69,7 @@ } - void WidgetBase::ClearBackgroundCairo(CairoContext& context) const + void WidgetBase::ClearBackgroundCairo(OrthancStone::CairoContext& context) const { // Clear the background using Cairo @@ -86,8 +86,8 @@ void WidgetBase::ClearBackgroundCairo(Orthanc::ImageAccessor& target) const { - CairoSurface surface(target, false /* no alpha */); - CairoContext context(surface); + OrthancStone::CairoSurface surface(target, false /* no alpha */); + OrthancStone::CairoContext context(surface); ClearBackgroundCairo(context); }
--- a/Framework/Widgets/WidgetBase.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Widgets/WidgetBase.h Tue May 21 11:43:25 2019 +0200 @@ -26,7 +26,7 @@ #include "../Viewport/CairoContext.h" #include "../Viewport/WidgetViewport.h" -namespace OrthancStone +namespace Deprecated { class WidgetBase : public IWidget { @@ -42,7 +42,7 @@ protected: void ClearBackgroundOrthanc(Orthanc::ImageAccessor& target) const; - void ClearBackgroundCairo(CairoContext& context) const; + void ClearBackgroundCairo(OrthancStone::CairoContext& context) const; void ClearBackgroundCairo(Orthanc::ImageAccessor& target) const;
--- a/Framework/Widgets/WorldSceneWidget.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Widgets/WorldSceneWidget.cpp Tue May 21 11:43:25 2019 +0200 @@ -32,7 +32,7 @@ #include <memory> #include <cassert> -namespace OrthancStone +namespace Deprecated { // this is an adapter between a IWorldSceneMouseTracker // that is tracking a mouse in scene coordinates/mm and @@ -60,8 +60,8 @@ { if (tracker_->HasRender()) { - CairoSurface surface(target, false /* no alpha */); - CairoContext context(surface); + OrthancStone::CairoSurface surface(target, false /* no alpha */); + OrthancStone::CairoContext context(surface); view_.ApplyTransform(context); tracker_->Render(context, view_.GetZoom()); } @@ -95,14 +95,14 @@ }; - bool WorldSceneWidget::RenderCairo(CairoContext& context) + bool WorldSceneWidget::RenderCairo(OrthancStone::CairoContext& context) { view_.ApplyTransform(context); return RenderScene(context, view_); } - void WorldSceneWidget::RenderMouseOverCairo(CairoContext& context, + void WorldSceneWidget::RenderMouseOverCairo(OrthancStone::CairoContext& context, int x, int y) { @@ -156,10 +156,10 @@ } - IMouseTracker* WorldSceneWidget::CreateMouseTracker(MouseButton button, + IMouseTracker* WorldSceneWidget::CreateMouseTracker(OrthancStone::MouseButton button, int x, int y, - KeyboardModifiers modifiers, + OrthancStone::KeyboardModifiers modifiers, const std::vector<Touch>& touches) { double sceneX, sceneY; @@ -189,10 +189,10 @@ { switch (button) { - case MouseButton_Middle: + case OrthancStone::MouseButton_Middle: return new SceneMouseTracker(view_, new PanMouseTracker(*this, x, y)); - case MouseButton_Right: + case OrthancStone::MouseButton_Right: return new SceneMouseTracker(view_, new ZoomMouseTracker(*this, x, y)); default: @@ -207,10 +207,10 @@ } - void WorldSceneWidget::MouseWheel(MouseWheelDirection direction, + void WorldSceneWidget::MouseWheel(OrthancStone::MouseWheelDirection direction, int x, int y, - KeyboardModifiers modifiers) + OrthancStone::KeyboardModifiers modifiers) { if (interactor_) { @@ -219,9 +219,9 @@ } - void WorldSceneWidget::KeyPressed(KeyboardKeys key, + void WorldSceneWidget::KeyPressed(OrthancStone::KeyboardKeys key, char keyChar, - KeyboardModifiers modifiers) + OrthancStone::KeyboardModifiers modifiers) { if (interactor_) {
--- a/Framework/Widgets/WorldSceneWidget.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Widgets/WorldSceneWidget.h Tue May 21 11:43:25 2019 +0200 @@ -26,7 +26,7 @@ #include "../Toolbox/ViewportGeometry.h" -namespace OrthancStone +namespace Deprecated { class WorldSceneWidget : public CairoWidget { @@ -38,16 +38,16 @@ bool hasDefaultMouseEvents_; protected: - virtual Extent2D GetSceneExtent() = 0; + virtual OrthancStone::Extent2D GetSceneExtent() = 0; - virtual bool RenderScene(CairoContext& context, + virtual bool RenderScene(OrthancStone::CairoContext& context, const ViewportGeometry& view) = 0; // From CairoWidget - virtual bool RenderCairo(CairoContext& context); + virtual bool RenderCairo(OrthancStone::CairoContext& context); // From CairoWidget - virtual void RenderMouseOverCairo(CairoContext& context, + virtual void RenderMouseOverCairo(OrthancStone::CairoContext& context, int x, int y); @@ -85,19 +85,19 @@ virtual void FitContent(); - virtual IMouseTracker* CreateMouseTracker(MouseButton button, + virtual IMouseTracker* CreateMouseTracker(OrthancStone::MouseButton button, int x, int y, - KeyboardModifiers modifiers, + OrthancStone::KeyboardModifiers modifiers, const std::vector<Touch>& touches); - virtual void MouseWheel(MouseWheelDirection direction, + virtual void MouseWheel(OrthancStone::MouseWheelDirection direction, int x, int y, - KeyboardModifiers modifiers); + OrthancStone::KeyboardModifiers modifiers); - virtual void KeyPressed(KeyboardKeys key, + virtual void KeyPressed(OrthancStone::KeyboardKeys key, char keyChar, - KeyboardModifiers modifiers); + OrthancStone::KeyboardModifiers modifiers); }; }
--- a/Framework/Widgets/ZoomMouseTracker.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Widgets/ZoomMouseTracker.cpp Tue May 21 11:43:25 2019 +0200 @@ -24,7 +24,7 @@ #include <Core/Logging.h> #include <Core/OrthancException.h> -namespace OrthancStone +namespace Deprecated { ZoomMouseTracker::ZoomMouseTracker(WorldSceneWidget& that, int x, @@ -51,7 +51,7 @@ } - void ZoomMouseTracker::Render(CairoContext& context, + void ZoomMouseTracker::Render(OrthancStone::CairoContext& context, double zoom) { throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError);
--- a/Framework/Widgets/ZoomMouseTracker.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/Widgets/ZoomMouseTracker.h Tue May 21 11:43:25 2019 +0200 @@ -23,7 +23,7 @@ #include "WorldSceneWidget.h" -namespace OrthancStone +namespace Deprecated { class ZoomMouseTracker : public IWorldSceneMouseTracker { @@ -51,7 +51,7 @@ { } - virtual void Render(CairoContext& context, + virtual void Render(OrthancStone::CairoContext& context, double zoom); virtual void MouseMove(int displayX,
--- a/Framework/dev.h Mon May 20 16:26:34 2019 +0200 +++ b/Framework/dev.h Tue May 21 11:43:25 2019 +0200 @@ -38,16 +38,16 @@ #include <boost/math/special_functions/round.hpp> -namespace OrthancStone +namespace Deprecated { // TODO: Handle errors while loading class OrthancVolumeImage : public ISlicedVolume, - public IObserver + public OrthancStone::IObserver { private: OrthancSlicesLoader loader_; - std::auto_ptr<ImageBuffer3D> image_; + std::auto_ptr<OrthancStone::ImageBuffer3D> image_; std::auto_ptr<DownloadStack> downloadStack_; bool computeRange_; size_t pendingSlices_; @@ -59,16 +59,16 @@ unsigned int slice; if (downloadStack_->Pop(slice)) { - loader_.ScheduleLoadSliceImage(slice, SliceImageQuality_Jpeg90); + loader_.ScheduleLoadSliceImage(slice, OrthancStone::SliceImageQuality_Jpeg90); } } - static bool IsCompatible(const Deprecated::Slice& a, - const Deprecated::Slice& b) + static bool IsCompatible(const Slice& a, + const Slice& b) { - if (!GeometryToolbox::IsParallel(a.GetGeometry().GetNormal(), - b.GetGeometry().GetNormal())) + if (!OrthancStone::GeometryToolbox::IsParallel(a.GetGeometry().GetNormal(), + b.GetGeometry().GetNormal())) { LOG(ERROR) << "A slice in the volume image is not parallel to the others."; return false; @@ -87,8 +87,8 @@ return false; } - if (!LinearAlgebra::IsNear(a.GetPixelSpacingX(), b.GetPixelSpacingX()) || - !LinearAlgebra::IsNear(a.GetPixelSpacingY(), b.GetPixelSpacingY())) + if (!OrthancStone::LinearAlgebra::IsNear(a.GetPixelSpacingX(), b.GetPixelSpacingX()) || + !OrthancStone::LinearAlgebra::IsNear(a.GetPixelSpacingY(), b.GetPixelSpacingY())) { LOG(ERROR) << "The pixel spacing of the slices change across the volume image"; return false; @@ -98,8 +98,8 @@ } - static double GetDistance(const Deprecated::Slice& a, - const Deprecated::Slice& b) + static double GetDistance(const Slice& a, + const Slice& b) { return fabs(a.GetGeometry().ProjectAlongNormal(a.GetGeometry().GetOrigin()) - a.GetGeometry().ProjectAlongNormal(b.GetGeometry().GetOrigin())); @@ -141,8 +141,8 @@ for (size_t i = 1; i < loader_.GetSlicesCount(); i++) { - if (!LinearAlgebra::IsNear(spacingZ, GetDistance(loader_.GetSlice(i - 1), loader_.GetSlice(i)), - 0.001 /* this is expressed in mm */)) + if (!OrthancStone::LinearAlgebra::IsNear(spacingZ, GetDistance(loader_.GetSlice(i - 1), loader_.GetSlice(i)), + 0.001 /* this is expressed in mm */)) { LOG(ERROR) << "The distance between successive slices is not constant in a volume image"; BroadcastMessage(ISlicedVolume::GeometryErrorMessage(*this)); @@ -156,7 +156,7 @@ LOG(INFO) << "Creating a volume image of size " << width << "x" << height << "x" << loader_.GetSlicesCount() << " in " << Orthanc::EnumerationToString(format); - image_.reset(new ImageBuffer3D(format, width, height, static_cast<unsigned int>(loader_.GetSlicesCount()), computeRange_)); + image_.reset(new OrthancStone::ImageBuffer3D(format, width, height, static_cast<unsigned int>(loader_.GetSlicesCount()), computeRange_)); image_->GetGeometry().SetAxialGeometry(loader_.GetSlice(0).GetGeometry()); image_->GetGeometry().SetVoxelDimensions(loader_.GetSlice(0).GetPixelSpacingX(), loader_.GetSlice(0).GetPixelSpacingY(), spacingZ); @@ -190,12 +190,12 @@ assert(&message.GetOrigin() == &loader_); { - ImageBuffer3D::SliceWriter writer(*image_, VolumeProjection_Axial, message.GetSliceIndex()); + OrthancStone::ImageBuffer3D::SliceWriter writer(*image_, OrthancStone::VolumeProjection_Axial, message.GetSliceIndex()); Orthanc::ImageProcessing::Copy(writer.GetAccessor(), message.GetImage()); } BroadcastMessage(ISlicedVolume::SliceContentChangedMessage - (*this, message.GetSliceIndex(), message.GetSlice())); + (*this, message.GetSliceIndex(), message.GetSlice())); if (pendingSlices_ == 1) { @@ -221,7 +221,7 @@ public: - OrthancVolumeImage(MessageBroker& broker, + OrthancVolumeImage(OrthancStone::MessageBroker& broker, OrthancApiClient& orthanc, bool computeRange) : ISlicedVolume(broker), @@ -231,19 +231,19 @@ pendingSlices_(0) { loader_.RegisterObserverCallback( - new Callable<OrthancVolumeImage, OrthancSlicesLoader::SliceGeometryReadyMessage> + new OrthancStone::Callable<OrthancVolumeImage, OrthancSlicesLoader::SliceGeometryReadyMessage> (*this, &OrthancVolumeImage::OnSliceGeometryReady)); loader_.RegisterObserverCallback( - new Callable<OrthancVolumeImage, OrthancSlicesLoader::SliceGeometryErrorMessage> + new OrthancStone::Callable<OrthancVolumeImage, OrthancSlicesLoader::SliceGeometryErrorMessage> (*this, &OrthancVolumeImage::OnSliceGeometryError)); loader_.RegisterObserverCallback( - new Callable<OrthancVolumeImage, OrthancSlicesLoader::SliceImageReadyMessage> + new OrthancStone::Callable<OrthancVolumeImage, OrthancSlicesLoader::SliceImageReadyMessage> (*this, &OrthancVolumeImage::OnSliceImageReady)); loader_.RegisterObserverCallback( - new Callable<OrthancVolumeImage, OrthancSlicesLoader::SliceImageErrorMessage> + new OrthancStone::Callable<OrthancVolumeImage, OrthancSlicesLoader::SliceImageErrorMessage> (*this, &OrthancVolumeImage::OnSliceImageError)); } @@ -268,12 +268,12 @@ return loader_.GetSlicesCount(); } - virtual const Deprecated::Slice& GetSlice(size_t index) const + virtual const Slice& GetSlice(size_t index) const { return loader_.GetSlice(index); } - ImageBuffer3D& GetImage() const + OrthancStone::ImageBuffer3D& GetImage() const { if (image_.get() == NULL) { @@ -287,7 +287,7 @@ } bool FitWindowingToRange(RenderStyle& style, - const Deprecated::DicomFrameConverter& converter) const + const DicomFrameConverter& converter) const { if (image_.get() == NULL) { @@ -301,7 +301,7 @@ }; - class OLD_VolumeImageGeometry + class VolumeImageGeometry { private: unsigned int width_; @@ -310,8 +310,8 @@ double pixelSpacingX_; double pixelSpacingY_; double sliceThickness_; - CoordinateSystem3D reference_; - Deprecated::DicomFrameConverter converter_; + OrthancStone::CoordinateSystem3D reference_; + DicomFrameConverter converter_; double ComputeAxialThickness(const OrthancVolumeImage& volume) const { @@ -320,8 +320,8 @@ size_t n = volume.GetSlicesCount(); if (n > 1) { - const Deprecated::Slice& a = volume.GetSlice(0); - const Deprecated::Slice& b = volume.GetSlice(n - 1); + const Slice& a = volume.GetSlice(0); + const Slice& b = volume.GetSlice(n - 1); thickness = ((reference_.ProjectAlongNormal(b.GetGeometry().GetOrigin()) - reference_.ProjectAlongNormal(a.GetGeometry().GetOrigin())) / (static_cast<double>(n) - 1.0)); @@ -345,7 +345,7 @@ void SetupAxial(const OrthancVolumeImage& volume) { - const Deprecated::Slice& axial = volume.GetSlice(0); + const Slice& axial = volume.GetSlice(0); width_ = axial.GetWidth(); height_ = axial.GetHeight(); @@ -360,7 +360,7 @@ void SetupCoronal(const OrthancVolumeImage& volume) { - const Deprecated::Slice& axial = volume.GetSlice(0); + const Slice& axial = volume.GetSlice(0); double axialThickness = ComputeAxialThickness(volume); width_ = axial.GetWidth(); @@ -371,18 +371,18 @@ pixelSpacingY_ = axialThickness; sliceThickness_ = axial.GetPixelSpacingY(); - Vector origin = axial.GetGeometry().GetOrigin(); + OrthancStone::Vector origin = axial.GetGeometry().GetOrigin(); origin += (static_cast<double>(volume.GetSlicesCount() - 1) * - axialThickness * axial.GetGeometry().GetNormal()); + axialThickness * axial.GetGeometry().GetNormal()); - reference_ = CoordinateSystem3D(origin, - axial.GetGeometry().GetAxisX(), - - axial.GetGeometry().GetNormal()); + reference_ = OrthancStone::CoordinateSystem3D(origin, + axial.GetGeometry().GetAxisX(), + - axial.GetGeometry().GetNormal()); } void SetupSagittal(const OrthancVolumeImage& volume) { - const Deprecated::Slice& axial = volume.GetSlice(0); + const Slice& axial = volume.GetSlice(0); double axialThickness = ComputeAxialThickness(volume); width_ = axial.GetHeight(); @@ -393,18 +393,18 @@ pixelSpacingY_ = axialThickness; sliceThickness_ = axial.GetPixelSpacingX(); - Vector origin = axial.GetGeometry().GetOrigin(); + OrthancStone::Vector origin = axial.GetGeometry().GetOrigin(); origin += (static_cast<double>(volume.GetSlicesCount() - 1) * - axialThickness * axial.GetGeometry().GetNormal()); + axialThickness * axial.GetGeometry().GetNormal()); - reference_ = CoordinateSystem3D(origin, - axial.GetGeometry().GetAxisY(), - axial.GetGeometry().GetNormal()); + reference_ = OrthancStone::CoordinateSystem3D(origin, + axial.GetGeometry().GetAxisY(), + axial.GetGeometry().GetNormal()); } public: - OLD_VolumeImageGeometry(const OrthancVolumeImage& volume, - VolumeProjection projection) + VolumeImageGeometry(const OrthancVolumeImage& volume, + OrthancStone::VolumeProjection projection) { if (volume.GetSlicesCount() == 0) { @@ -415,20 +415,20 @@ switch (projection) { - case VolumeProjection_Axial: - SetupAxial(volume); - break; + case OrthancStone::VolumeProjection_Axial: + SetupAxial(volume); + break; - case VolumeProjection_Coronal: - SetupCoronal(volume); - break; + case OrthancStone::VolumeProjection_Coronal: + SetupCoronal(volume); + break; - case VolumeProjection_Sagittal: - SetupSagittal(volume); - break; + case OrthancStone::VolumeProjection_Sagittal: + SetupSagittal(volume); + break; - default: - throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); + default: + throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); } } @@ -437,18 +437,18 @@ return depth_; } - const Vector& GetNormal() const + const OrthancStone::Vector& GetNormal() const { return reference_.GetNormal(); } bool LookupSlice(size_t& index, - const CoordinateSystem3D& slice) const + const OrthancStone::CoordinateSystem3D& slice) const { bool opposite; - if (!GeometryToolbox::IsParallelOrOpposite(opposite, - reference_.GetNormal(), - slice.GetNormal())) + if (!OrthancStone::GeometryToolbox::IsParallelOrOpposite(opposite, + reference_.GetNormal(), + slice.GetNormal())) { return false; } @@ -459,7 +459,7 @@ int s = static_cast<int>(boost::math::iround(z)); if (s < 0 || - s >= static_cast<int>(depth_)) + s >= static_cast<int>(depth_)) { return false; } @@ -470,7 +470,7 @@ } } - Deprecated::Slice* GetSlice(size_t slice) const + Slice* GetSlice(size_t slice) const { if (slice >= depth_) { @@ -478,13 +478,13 @@ } else { - CoordinateSystem3D origin(reference_.GetOrigin() + - static_cast<double>(slice) * sliceThickness_ * reference_.GetNormal(), - reference_.GetAxisX(), - reference_.GetAxisY()); + OrthancStone::CoordinateSystem3D origin(reference_.GetOrigin() + + static_cast<double>(slice) * sliceThickness_ * reference_.GetNormal(), + reference_.GetAxisX(), + reference_.GetAxisY()); - return new Deprecated::Slice(origin, pixelSpacingX_, pixelSpacingY_, sliceThickness_, - width_, height_, converter_); + return new Slice(origin, pixelSpacingX_, pixelSpacingY_, sliceThickness_, + width_, height_, converter_); } } }; @@ -493,23 +493,23 @@ class VolumeImageMPRSlicer : public IVolumeSlicer, - public IObserver + public OrthancStone::IObserver { private: class RendererFactory : public LayerReadyMessage::IRendererFactory { private: const Orthanc::ImageAccessor& frame_; - const Deprecated::Slice& slice_; + const Slice& slice_; bool isFullQuality_; public: RendererFactory(const Orthanc::ImageAccessor& frame, - const Deprecated::Slice& slice, + const Slice& slice, bool isFullQuality) : - frame_(frame), - slice_(slice), - isFullQuality_(isFullQuality) + frame_(frame), + slice_(slice), + isFullQuality_(isFullQuality) { } @@ -521,9 +521,9 @@ OrthancVolumeImage& volume_; - std::auto_ptr<OLD_VolumeImageGeometry> axialGeometry_; - std::auto_ptr<OLD_VolumeImageGeometry> coronalGeometry_; - std::auto_ptr<OLD_VolumeImageGeometry> sagittalGeometry_; + std::auto_ptr<VolumeImageGeometry> axialGeometry_; + std::auto_ptr<VolumeImageGeometry> coronalGeometry_; + std::auto_ptr<VolumeImageGeometry> sagittalGeometry_; bool IsGeometryReady() const @@ -536,9 +536,9 @@ assert(&message.GetOrigin() == &volume_); // These 3 values are only used to speed up the IVolumeSlicer - axialGeometry_.reset(new OLD_VolumeImageGeometry(volume_, VolumeProjection_Axial)); - coronalGeometry_.reset(new OLD_VolumeImageGeometry(volume_, VolumeProjection_Coronal)); - sagittalGeometry_.reset(new OLD_VolumeImageGeometry(volume_, VolumeProjection_Sagittal)); + axialGeometry_.reset(new VolumeImageGeometry(volume_, OrthancStone::VolumeProjection_Axial)); + coronalGeometry_.reset(new VolumeImageGeometry(volume_, OrthancStone::VolumeProjection_Coronal)); + sagittalGeometry_.reset(new VolumeImageGeometry(volume_, OrthancStone::VolumeProjection_Sagittal)); BroadcastMessage(IVolumeSlicer::GeometryReadyMessage(*this)); } @@ -567,7 +567,7 @@ BroadcastMessage(IVolumeSlicer::ContentChangedMessage(*this)); } - const OLD_VolumeImageGeometry& GetProjectionGeometry(VolumeProjection projection) + const VolumeImageGeometry& GetProjectionGeometry(OrthancStone::VolumeProjection projection) { if (!IsGeometryReady()) { @@ -576,45 +576,45 @@ switch (projection) { - case VolumeProjection_Axial: - return *axialGeometry_; + case OrthancStone::VolumeProjection_Axial: + return *axialGeometry_; - case VolumeProjection_Sagittal: - return *sagittalGeometry_; + case OrthancStone::VolumeProjection_Sagittal: + return *sagittalGeometry_; - case VolumeProjection_Coronal: - return *coronalGeometry_; + case OrthancStone::VolumeProjection_Coronal: + return *coronalGeometry_; - default: - throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError); + default: + throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError); } } - bool DetectProjection(VolumeProjection& projection, - const CoordinateSystem3D& viewportSlice) + bool DetectProjection(OrthancStone::VolumeProjection& projection, + const OrthancStone::CoordinateSystem3D& viewportSlice) { bool isOpposite; // Ignored - if (GeometryToolbox::IsParallelOrOpposite(isOpposite, - viewportSlice.GetNormal(), - axialGeometry_->GetNormal())) + if (OrthancStone::GeometryToolbox::IsParallelOrOpposite(isOpposite, + viewportSlice.GetNormal(), + axialGeometry_->GetNormal())) { - projection = VolumeProjection_Axial; + projection = OrthancStone::VolumeProjection_Axial; return true; } - else if (GeometryToolbox::IsParallelOrOpposite(isOpposite, - viewportSlice.GetNormal(), - sagittalGeometry_->GetNormal())) + else if (OrthancStone::GeometryToolbox::IsParallelOrOpposite(isOpposite, + viewportSlice.GetNormal(), + sagittalGeometry_->GetNormal())) { - projection = VolumeProjection_Sagittal; + projection = OrthancStone::VolumeProjection_Sagittal; return true; } - else if (GeometryToolbox::IsParallelOrOpposite(isOpposite, - viewportSlice.GetNormal(), - coronalGeometry_->GetNormal())) + else if (OrthancStone::GeometryToolbox::IsParallelOrOpposite(isOpposite, + viewportSlice.GetNormal(), + coronalGeometry_->GetNormal())) { - projection = VolumeProjection_Coronal; + projection = OrthancStone::VolumeProjection_Coronal; return true; } else @@ -625,33 +625,33 @@ public: - VolumeImageMPRSlicer(MessageBroker& broker, + VolumeImageMPRSlicer(OrthancStone::MessageBroker& broker, OrthancVolumeImage& volume) : - IVolumeSlicer(broker), - IObserver(broker), - volume_(volume) + IVolumeSlicer(broker), + IObserver(broker), + volume_(volume) { volume_.RegisterObserverCallback( - new Callable<VolumeImageMPRSlicer, ISlicedVolume::GeometryReadyMessage> + new OrthancStone::Callable<VolumeImageMPRSlicer, ISlicedVolume::GeometryReadyMessage> (*this, &VolumeImageMPRSlicer::OnGeometryReady)); volume_.RegisterObserverCallback( - new Callable<VolumeImageMPRSlicer, ISlicedVolume::GeometryErrorMessage> + new OrthancStone::Callable<VolumeImageMPRSlicer, ISlicedVolume::GeometryErrorMessage> (*this, &VolumeImageMPRSlicer::OnGeometryError)); volume_.RegisterObserverCallback( - new Callable<VolumeImageMPRSlicer, ISlicedVolume::ContentChangedMessage> + new OrthancStone::Callable<VolumeImageMPRSlicer, ISlicedVolume::ContentChangedMessage> (*this, &VolumeImageMPRSlicer::OnContentChanged)); volume_.RegisterObserverCallback( - new Callable<VolumeImageMPRSlicer, ISlicedVolume::SliceContentChangedMessage> + new OrthancStone::Callable<VolumeImageMPRSlicer, ISlicedVolume::SliceContentChangedMessage> (*this, &VolumeImageMPRSlicer::OnSliceContentChanged)); } - virtual bool GetExtent(std::vector<Vector>& points, - const CoordinateSystem3D& viewportSlice) ORTHANC_OVERRIDE + virtual bool GetExtent(std::vector<OrthancStone::Vector>& points, + const OrthancStone::CoordinateSystem3D& viewportSlice) ORTHANC_OVERRIDE { - VolumeProjection projection; + OrthancStone::VolumeProjection projection; if (!IsGeometryReady() || !DetectProjection(projection, viewportSlice)) @@ -662,21 +662,21 @@ { // As the slices of the volumic image are arranged in a box, // we only consider one single reference slice (the one with index 0). - std::auto_ptr<Deprecated::Slice> slice(GetProjectionGeometry(projection).GetSlice(0)); + std::auto_ptr<Slice> slice(GetProjectionGeometry(projection).GetSlice(0)); slice->GetExtent(points); return true; } } - virtual void ScheduleLayerCreation(const CoordinateSystem3D& viewportSlice) ORTHANC_OVERRIDE + virtual void ScheduleLayerCreation(const OrthancStone::CoordinateSystem3D& viewportSlice) ORTHANC_OVERRIDE { - VolumeProjection projection; + OrthancStone::VolumeProjection projection; if (IsGeometryReady() && DetectProjection(projection, viewportSlice)) { - const OLD_VolumeImageGeometry& geometry = GetProjectionGeometry(projection); + const VolumeImageGeometry& geometry = GetProjectionGeometry(projection); size_t closest; @@ -687,13 +687,13 @@ std::auto_ptr<Orthanc::Image> frame; { - ImageBuffer3D::SliceReader reader(volume_.GetImage(), projection, static_cast<unsigned int>(closest)); + OrthancStone::ImageBuffer3D::SliceReader reader(volume_.GetImage(), projection, static_cast<unsigned int>(closest)); // TODO Transfer ownership if non-axial, to avoid memcpy frame.reset(Orthanc::Image::Clone(reader.GetAccessor())); } - std::auto_ptr<Deprecated::Slice> slice(geometry.GetSlice(closest)); + std::auto_ptr<Slice> slice(geometry.GetSlice(closest)); RendererFactory factory(*frame, *slice, isFullQuality); @@ -703,7 +703,7 @@ } // Error - CoordinateSystem3D slice; + OrthancStone::CoordinateSystem3D slice; BroadcastMessage(IVolumeSlicer::LayerErrorMessage(*this, slice)); } }; @@ -711,12 +711,12 @@ class VolumeImageInteractor : public IWorldSceneInteractor, - public IObserver + public OrthancStone::IObserver { private: SliceViewerWidget& widget_; - VolumeProjection projection_; - std::auto_ptr<OLD_VolumeImageGeometry> slices_; + OrthancStone::VolumeProjection projection_; + std::auto_ptr<VolumeImageGeometry> slices_; size_t slice_; protected: @@ -727,7 +727,7 @@ const OrthancVolumeImage& image = dynamic_cast<const OrthancVolumeImage&>(message.GetOrigin()); - slices_.reset(new OLD_VolumeImageGeometry(image, projection_)); + slices_.reset(new VolumeImageGeometry(image, projection_)); SetSlice(slices_->GetSlicesCount() / 2); widget_.FitContent(); @@ -736,8 +736,8 @@ virtual IWorldSceneMouseTracker* CreateMouseTracker(WorldSceneWidget& widget, const ViewportGeometry& view, - MouseButton button, - KeyboardModifiers modifiers, + OrthancStone::MouseButton button, + OrthancStone::KeyboardModifiers modifiers, int viewportX, int viewportY, double x, @@ -748,7 +748,7 @@ return NULL; } - virtual void MouseOver(CairoContext& context, + virtual void MouseOver(OrthancStone::CairoContext& context, WorldSceneWidget& widget, const ViewportGeometry& view, double x, @@ -758,57 +758,57 @@ } virtual void MouseWheel(WorldSceneWidget& widget, - MouseWheelDirection direction, - KeyboardModifiers modifiers, + OrthancStone::MouseWheelDirection direction, + OrthancStone::KeyboardModifiers modifiers, IStatusBar* statusBar) ORTHANC_OVERRIDE { - int scale = (modifiers & KeyboardModifiers_Control ? 10 : 1); + int scale = (modifiers & OrthancStone::KeyboardModifiers_Control ? 10 : 1); switch (direction) { - case MouseWheelDirection_Up: - OffsetSlice(-scale); - break; + case OrthancStone::MouseWheelDirection_Up: + OffsetSlice(-scale); + break; - case MouseWheelDirection_Down: - OffsetSlice(scale); - break; + case OrthancStone::MouseWheelDirection_Down: + OffsetSlice(scale); + break; - default: - break; + default: + break; } } virtual void KeyPressed(WorldSceneWidget& widget, - KeyboardKeys key, + OrthancStone::KeyboardKeys key, char keyChar, - KeyboardModifiers modifiers, + OrthancStone::KeyboardModifiers modifiers, IStatusBar* statusBar) ORTHANC_OVERRIDE { switch (keyChar) { - case 's': - widget.FitContent(); - break; + case 's': + widget.FitContent(); + break; - default: - break; + default: + break; } } public: - VolumeImageInteractor(MessageBroker& broker, + VolumeImageInteractor(OrthancStone::MessageBroker& broker, OrthancVolumeImage& volume, SliceViewerWidget& widget, - VolumeProjection projection) : - IObserver(broker), - widget_(widget), - projection_(projection) + OrthancStone::VolumeProjection projection) : + IObserver(broker), + widget_(widget), + projection_(projection) { widget.SetInteractor(*this); volume.RegisterObserverCallback( - new Callable<VolumeImageInteractor, ISlicedVolume::GeometryReadyMessage> + new OrthancStone::Callable<VolumeImageInteractor, ISlicedVolume::GeometryReadyMessage> (*this, &VolumeImageInteractor::OnGeometryReady)); } @@ -858,7 +858,7 @@ { slice_ = slice; - std::auto_ptr<Deprecated::Slice> tmp(slices_->GetSlice(slice_)); + std::auto_ptr<Slice> tmp(slices_->GetSlice(slice_)); widget_.SetSlice(tmp->GetGeometry()); } } @@ -876,14 +876,14 @@ double y1_; double x2_; double y2_; - const CoordinateSystem3D& slice_; + const OrthancStone::CoordinateSystem3D& slice_; public: RendererFactory(double x1, double y1, double x2, double y2, - const CoordinateSystem3D& slice) : + const OrthancStone::CoordinateSystem3D& slice) : x1_(x1), y1_(y1), x2_(x2), @@ -901,7 +901,7 @@ SliceViewerWidget& otherPlane_; public: - ReferenceLineSource(MessageBroker& broker, + ReferenceLineSource(OrthancStone::MessageBroker& broker, SliceViewerWidget& otherPlane) : IVolumeSlicer(broker), otherPlane_(otherPlane) @@ -909,24 +909,24 @@ BroadcastMessage(IVolumeSlicer::GeometryReadyMessage(*this)); } - virtual bool GetExtent(std::vector<Vector>& points, - const CoordinateSystem3D& viewportSlice) + virtual bool GetExtent(std::vector<OrthancStone::Vector>& points, + const OrthancStone::CoordinateSystem3D& viewportSlice) { return false; } - virtual void ScheduleLayerCreation(const CoordinateSystem3D& viewportSlice) + virtual void ScheduleLayerCreation(const OrthancStone::CoordinateSystem3D& viewportSlice) { - Deprecated::Slice reference(viewportSlice, 0.001); + Slice reference(viewportSlice, 0.001); - Vector p, d; + OrthancStone::Vector p, d; - const CoordinateSystem3D& slice = otherPlane_.GetSlice(); + const OrthancStone::CoordinateSystem3D& slice = otherPlane_.GetSlice(); // Compute the line of intersection between the two slices - if (!GeometryToolbox::IntersectTwoPlanes(p, d, - slice.GetOrigin(), slice.GetNormal(), - viewportSlice.GetOrigin(), viewportSlice.GetNormal())) + if (!OrthancStone::GeometryToolbox::IntersectTwoPlanes(p, d, + slice.GetOrigin(), slice.GetNormal(), + viewportSlice.GetOrigin(), viewportSlice.GetNormal())) { // The two slice are parallel, don't try and display the intersection BroadcastMessage(IVolumeSlicer::LayerErrorMessage(*this, reference.GetGeometry())); @@ -937,12 +937,12 @@ viewportSlice.ProjectPoint(x1, y1, p); viewportSlice.ProjectPoint(x2, y2, p + 1000.0 * d); - const Extent2D extent = otherPlane_.GetSceneExtent(); + const OrthancStone::Extent2D extent = otherPlane_.GetSceneExtent(); - if (GeometryToolbox::ClipLineToRectangle(x1, y1, x2, y2, - x1, y1, x2, y2, - extent.GetX1(), extent.GetY1(), - extent.GetX2(), extent.GetY2())) + if (OrthancStone::GeometryToolbox::ClipLineToRectangle(x1, y1, x2, y2, + x1, y1, x2, y2, + extent.GetX1(), extent.GetY1(), + extent.GetX2(), extent.GetY2())) { RendererFactory factory(x1, y1, x2, y2, slice); BroadcastMessage(IVolumeSlicer::LayerReadyMessage(*this, factory, reference.GetGeometry()));
--- a/Platforms/Generic/DelayedCallCommand.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Platforms/Generic/DelayedCallCommand.cpp Tue May 21 11:43:25 2019 +0200 @@ -24,13 +24,13 @@ #include <iostream> -namespace OrthancStone +namespace Deprecated { - DelayedCallCommand::DelayedCallCommand(MessageBroker& broker, - MessageHandler<IDelayedCallExecutor::TimeoutMessage>* callback, // takes ownership + DelayedCallCommand::DelayedCallCommand(OrthancStone::MessageBroker& broker, + OrthancStone::MessageHandler<IDelayedCallExecutor::TimeoutMessage>* callback, // takes ownership unsigned int timeoutInMs, Orthanc::IDynamicObject* payload /* takes ownership */, - NativeStoneApplicationContext& context + OrthancStone::NativeStoneApplicationContext& context ) : IObservable(broker), callback_(callback), @@ -55,7 +55,7 @@ // We want to make sure that, i.e, the UpdateThread is not // triggered while we are updating the "model" with the result of // an OracleCommand - NativeStoneApplicationContext::GlobalMutexLocker lock(context_); + OrthancStone::NativeStoneApplicationContext::GlobalMutexLocker lock(context_); if (callback_.get() != NULL) {
--- a/Platforms/Generic/DelayedCallCommand.h Mon May 20 16:26:34 2019 +0200 +++ b/Platforms/Generic/DelayedCallCommand.h Tue May 21 11:43:25 2019 +0200 @@ -30,23 +30,23 @@ #include <boost/date_time/posix_time/posix_time.hpp> -namespace OrthancStone +namespace Deprecated { - class DelayedCallCommand : public IOracleCommand, IObservable + class DelayedCallCommand : public IOracleCommand, OrthancStone::IObservable { protected: - std::auto_ptr<MessageHandler<IDelayedCallExecutor::TimeoutMessage> > callback_; + std::auto_ptr<OrthancStone::MessageHandler<IDelayedCallExecutor::TimeoutMessage> > callback_; std::auto_ptr<Orthanc::IDynamicObject> payload_; - NativeStoneApplicationContext& context_; + OrthancStone::NativeStoneApplicationContext& context_; boost::posix_time::ptime expirationTimePoint_; unsigned int timeoutInMs_; public: - DelayedCallCommand(MessageBroker& broker, - MessageHandler<IDelayedCallExecutor::TimeoutMessage>* callback, // takes ownership + DelayedCallCommand(OrthancStone::MessageBroker& broker, + OrthancStone::MessageHandler<IDelayedCallExecutor::TimeoutMessage>* callback, // takes ownership unsigned int timeoutInMs, Orthanc::IDynamicObject* payload /* takes ownership */, - NativeStoneApplicationContext& context + OrthancStone::NativeStoneApplicationContext& context ); virtual void Execute();
--- a/Platforms/Generic/IOracleCommand.h Mon May 20 16:26:34 2019 +0200 +++ b/Platforms/Generic/IOracleCommand.h Tue May 21 11:43:25 2019 +0200 @@ -23,7 +23,7 @@ #include <Core/IDynamicObject.h> -namespace OrthancStone +namespace Deprecated { class IOracleCommand : public Orthanc::IDynamicObject {
--- a/Platforms/Generic/Oracle.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Platforms/Generic/Oracle.cpp Tue May 21 11:43:25 2019 +0200 @@ -29,7 +29,7 @@ #include <stdio.h> #include <boost/thread/mutex.hpp> -namespace OrthancStone +namespace Deprecated { class Oracle::PImpl {
--- a/Platforms/Generic/Oracle.h Mon May 20 16:26:34 2019 +0200 +++ b/Platforms/Generic/Oracle.h Tue May 21 11:43:25 2019 +0200 @@ -25,7 +25,7 @@ #include <boost/shared_ptr.hpp> -namespace OrthancStone +namespace Deprecated { class Oracle : public boost::noncopyable {
--- a/Platforms/Generic/OracleDelayedCallExecutor.h Mon May 20 16:26:34 2019 +0200 +++ b/Platforms/Generic/OracleDelayedCallExecutor.h Tue May 21 11:43:25 2019 +0200 @@ -26,26 +26,26 @@ #include "../../Applications/Generic/NativeStoneApplicationContext.h" #include "DelayedCallCommand.h" -namespace OrthancStone +namespace Deprecated { // The OracleTimeout executes callbacks after a delay. class OracleDelayedCallExecutor : public IDelayedCallExecutor { private: Oracle& oracle_; - NativeStoneApplicationContext& context_; + OrthancStone::NativeStoneApplicationContext& context_; public: - OracleDelayedCallExecutor(MessageBroker& broker, + OracleDelayedCallExecutor(OrthancStone::MessageBroker& broker, Oracle& oracle, - NativeStoneApplicationContext& context) : + OrthancStone::NativeStoneApplicationContext& context) : IDelayedCallExecutor(broker), oracle_(oracle), context_(context) { } - virtual void Schedule(MessageHandler<IDelayedCallExecutor::TimeoutMessage>* callback, + virtual void Schedule(OrthancStone::MessageHandler<IDelayedCallExecutor::TimeoutMessage>* callback, unsigned int timeoutInMs = 1000) { oracle_.Submit(new DelayedCallCommand(broker_, callback, timeoutInMs, NULL, context_));
--- a/Platforms/Generic/OracleWebService.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Platforms/Generic/OracleWebService.cpp Tue May 21 11:43:25 2019 +0200 @@ -22,24 +22,24 @@ #include "OracleWebService.h" #include "../../Framework/Toolbox/IWebService.h" -namespace OrthancStone +namespace Deprecated { - class OracleWebService::WebServiceCachedGetCommand : public IOracleCommand, IObservable + class OracleWebService::WebServiceCachedGetCommand : public IOracleCommand, OrthancStone::IObservable { protected: - std::auto_ptr<MessageHandler<IWebService::HttpRequestSuccessMessage> > successCallback_; + std::auto_ptr<OrthancStone::MessageHandler<IWebService::HttpRequestSuccessMessage> > successCallback_; std::auto_ptr<Orthanc::IDynamicObject> payload_; boost::shared_ptr<BaseWebService::CachedHttpRequestSuccessMessage> cachedMessage_; - NativeStoneApplicationContext& context_; + OrthancStone::NativeStoneApplicationContext& context_; public: - WebServiceCachedGetCommand(MessageBroker& broker, - MessageHandler<IWebService::HttpRequestSuccessMessage>* successCallback, // takes ownership + WebServiceCachedGetCommand(OrthancStone::MessageBroker& broker, + OrthancStone::MessageHandler<IWebService::HttpRequestSuccessMessage>* successCallback, // takes ownership boost::shared_ptr<BaseWebService::CachedHttpRequestSuccessMessage> cachedMessage, Orthanc::IDynamicObject* payload /* takes ownership */, - NativeStoneApplicationContext& context + OrthancStone::NativeStoneApplicationContext& context ) : IObservable(broker), successCallback_(successCallback), @@ -59,7 +59,7 @@ // We want to make sure that, i.e, the UpdateThread is not // triggered while we are updating the "model" with the result of // a WebServiceCommand - NativeStoneApplicationContext::GlobalMutexLocker lock(context_); + OrthancStone::NativeStoneApplicationContext::GlobalMutexLocker lock(context_); IWebService::HttpRequestSuccessMessage successMessage(cachedMessage_->GetUri(), cachedMessage_->GetAnswer(), @@ -73,7 +73,7 @@ void OracleWebService::NotifyHttpSuccessLater(boost::shared_ptr<BaseWebService::CachedHttpRequestSuccessMessage> cachedMessage, Orthanc::IDynamicObject* payload, // takes ownership - MessageHandler<IWebService::HttpRequestSuccessMessage>* successCallback) + OrthancStone::MessageHandler<IWebService::HttpRequestSuccessMessage>* successCallback) { oracle_.Submit(new WebServiceCachedGetCommand(GetBroker(), successCallback, cachedMessage, payload, context_)); }
--- a/Platforms/Generic/OracleWebService.h Mon May 20 16:26:34 2019 +0200 +++ b/Platforms/Generic/OracleWebService.h Tue May 21 11:43:25 2019 +0200 @@ -28,7 +28,7 @@ #include "WebServiceDeleteCommand.h" #include "../../Applications/Generic/NativeStoneApplicationContext.h" -namespace OrthancStone +namespace Deprecated { // The OracleWebService performs HTTP requests in a native environment. // It uses a thread pool to handle multiple HTTP requests in a same time. @@ -37,16 +37,16 @@ { private: Oracle& oracle_; - NativeStoneApplicationContext& context_; + OrthancStone::NativeStoneApplicationContext& context_; Orthanc::WebServiceParameters parameters_; class WebServiceCachedGetCommand; public: - OracleWebService(MessageBroker& broker, + OracleWebService(OrthancStone::MessageBroker& broker, Oracle& oracle, const Orthanc::WebServiceParameters& parameters, - NativeStoneApplicationContext& context) : + OrthancStone::NativeStoneApplicationContext& context) : BaseWebService(broker), oracle_(oracle), context_(context), @@ -58,8 +58,8 @@ const HttpHeaders& headers, const std::string& body, Orthanc::IDynamicObject* payload, // takes ownership - MessageHandler<IWebService::HttpRequestSuccessMessage>* successCallback, // takes ownership - MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback = NULL, // takes ownership + OrthancStone::MessageHandler<IWebService::HttpRequestSuccessMessage>* successCallback, // takes ownership + OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback = NULL, // takes ownership unsigned int timeoutInSeconds = 60) { oracle_.Submit(new WebServicePostCommand(GetBroker(), successCallback, failureCallback, parameters_, uri, headers, timeoutInSeconds, body, payload, context_)); @@ -68,8 +68,8 @@ virtual void DeleteAsync(const std::string& uri, const HttpHeaders& headers, Orthanc::IDynamicObject* payload, - MessageHandler<IWebService::HttpRequestSuccessMessage>* successCallback, - MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback = NULL, + OrthancStone::MessageHandler<IWebService::HttpRequestSuccessMessage>* successCallback, + OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback = NULL, unsigned int timeoutInSeconds = 60) { oracle_.Submit(new WebServiceDeleteCommand(GetBroker(), successCallback, failureCallback, parameters_, uri, headers, timeoutInSeconds, payload, context_)); @@ -79,8 +79,8 @@ virtual void GetAsyncInternal(const std::string& uri, const HttpHeaders& headers, Orthanc::IDynamicObject* payload, // takes ownership - MessageHandler<IWebService::HttpRequestSuccessMessage>* successCallback, // takes ownership - MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback = NULL,// takes ownership + OrthancStone::MessageHandler<IWebService::HttpRequestSuccessMessage>* successCallback, // takes ownership + OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback = NULL,// takes ownership unsigned int timeoutInSeconds = 60) { oracle_.Submit(new WebServiceGetCommand(GetBroker(), successCallback, failureCallback, parameters_, uri, headers, timeoutInSeconds, payload, context_)); @@ -88,7 +88,7 @@ virtual void NotifyHttpSuccessLater(boost::shared_ptr<BaseWebService::CachedHttpRequestSuccessMessage> cachedHttpMessage, Orthanc::IDynamicObject* payload, // takes ownership - MessageHandler<IWebService::HttpRequestSuccessMessage>* successCallback); + OrthancStone::MessageHandler<IWebService::HttpRequestSuccessMessage>* successCallback); }; }
--- a/Platforms/Generic/WebServiceCommandBase.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Platforms/Generic/WebServiceCommandBase.cpp Tue May 21 11:43:25 2019 +0200 @@ -23,17 +23,17 @@ #include <Core/HttpClient.h> -namespace OrthancStone +namespace Deprecated { - WebServiceCommandBase::WebServiceCommandBase(MessageBroker& broker, - MessageHandler<IWebService::HttpRequestSuccessMessage>* successCallback, - MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback, + WebServiceCommandBase::WebServiceCommandBase(OrthancStone::MessageBroker& broker, + OrthancStone::MessageHandler<IWebService::HttpRequestSuccessMessage>* successCallback, + OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback, const Orthanc::WebServiceParameters& parameters, const std::string& url, const IWebService::HttpHeaders& headers, unsigned int timeoutInSeconds, Orthanc::IDynamicObject* payload /* takes ownership */, - NativeStoneApplicationContext& context) : + OrthancStone::NativeStoneApplicationContext& context) : IObservable(broker), successCallback_(successCallback), failureCallback_(failureCallback), @@ -52,7 +52,7 @@ // We want to make sure that, i.e, the UpdateThread is not // triggered while we are updating the "model" with the result of // a WebServiceCommand - NativeStoneApplicationContext::GlobalMutexLocker lock(context_); + OrthancStone::NativeStoneApplicationContext::GlobalMutexLocker lock(context_); if (success_ && successCallback_.get() != NULL) {
--- a/Platforms/Generic/WebServiceCommandBase.h Mon May 20 16:26:34 2019 +0200 +++ b/Platforms/Generic/WebServiceCommandBase.h Tue May 21 11:43:25 2019 +0200 @@ -32,13 +32,13 @@ #include <memory> -namespace OrthancStone +namespace Deprecated { - class WebServiceCommandBase : public IOracleCommand, IObservable + class WebServiceCommandBase : public IOracleCommand, OrthancStone::IObservable { protected: - std::auto_ptr<MessageHandler<IWebService::HttpRequestSuccessMessage> > successCallback_; - std::auto_ptr<MessageHandler<IWebService::HttpRequestErrorMessage> > failureCallback_; + std::auto_ptr<OrthancStone::MessageHandler<IWebService::HttpRequestSuccessMessage> > successCallback_; + std::auto_ptr<OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage> > failureCallback_; Orthanc::WebServiceParameters parameters_; std::string url_; IWebService::HttpHeaders headers_; @@ -46,19 +46,19 @@ bool success_; std::string answer_; IWebService::HttpHeaders answerHeaders_; - NativeStoneApplicationContext& context_; + OrthancStone::NativeStoneApplicationContext& context_; unsigned int timeoutInSeconds_; public: - WebServiceCommandBase(MessageBroker& broker, - MessageHandler<IWebService::HttpRequestSuccessMessage>* successCallback, // takes ownership - MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback, // takes ownership + WebServiceCommandBase(OrthancStone::MessageBroker& broker, + OrthancStone::MessageHandler<IWebService::HttpRequestSuccessMessage>* successCallback, // takes ownership + OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback, // takes ownership const Orthanc::WebServiceParameters& parameters, const std::string& url, const IWebService::HttpHeaders& headers, unsigned int timeoutInSeconds, Orthanc::IDynamicObject* payload /* takes ownership */, - NativeStoneApplicationContext& context + OrthancStone::NativeStoneApplicationContext& context ); virtual void Execute() = 0;
--- a/Platforms/Generic/WebServiceDeleteCommand.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Platforms/Generic/WebServiceDeleteCommand.cpp Tue May 21 11:43:25 2019 +0200 @@ -23,17 +23,17 @@ #include <Core/HttpClient.h> -namespace OrthancStone +namespace Deprecated { - WebServiceDeleteCommand::WebServiceDeleteCommand(MessageBroker& broker, - MessageHandler<IWebService::HttpRequestSuccessMessage>* successCallback, // takes ownership - MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback, // takes ownership + WebServiceDeleteCommand::WebServiceDeleteCommand(OrthancStone::MessageBroker& broker, + OrthancStone::MessageHandler<Deprecated::IWebService::HttpRequestSuccessMessage>* successCallback, // takes ownership + OrthancStone::MessageHandler<Deprecated::IWebService::HttpRequestErrorMessage>* failureCallback, // takes ownership const Orthanc::WebServiceParameters& parameters, const std::string& url, - const IWebService::HttpHeaders& headers, + const Deprecated::IWebService::HttpHeaders& headers, unsigned int timeoutInSeconds, Orthanc::IDynamicObject* payload /* takes ownership */, - NativeStoneApplicationContext& context) : + OrthancStone::NativeStoneApplicationContext& context) : WebServiceCommandBase(broker, successCallback, failureCallback, parameters, url, headers, timeoutInSeconds, payload, context) { } @@ -45,7 +45,7 @@ client.SetTimeout(timeoutInSeconds_); client.SetMethod(Orthanc::HttpMethod_Delete); - for (IWebService::HttpHeaders::const_iterator it = headers_.begin(); it != headers_.end(); it++ ) + for (Deprecated::IWebService::HttpHeaders::const_iterator it = headers_.begin(); it != headers_.end(); it++ ) { client.AddHeader(it->first, it->second); }
--- a/Platforms/Generic/WebServiceDeleteCommand.h Mon May 20 16:26:34 2019 +0200 +++ b/Platforms/Generic/WebServiceDeleteCommand.h Tue May 21 11:43:25 2019 +0200 @@ -23,20 +23,20 @@ #include "WebServiceCommandBase.h" -namespace OrthancStone +namespace Deprecated { class WebServiceDeleteCommand : public WebServiceCommandBase { public: - WebServiceDeleteCommand(MessageBroker& broker, - MessageHandler<IWebService::HttpRequestSuccessMessage>* successCallback, // takes ownership - MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback, // takes ownership + WebServiceDeleteCommand(OrthancStone::MessageBroker& broker, + OrthancStone::MessageHandler<IWebService::HttpRequestSuccessMessage>* successCallback, // takes ownership + OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback, // takes ownership const Orthanc::WebServiceParameters& parameters, const std::string& url, const IWebService::HttpHeaders& headers, unsigned int timeoutInSeconds, Orthanc::IDynamicObject* payload /* takes ownership */, - NativeStoneApplicationContext& context); + OrthancStone::NativeStoneApplicationContext& context); virtual void Execute(); };
--- a/Platforms/Generic/WebServiceGetCommand.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Platforms/Generic/WebServiceGetCommand.cpp Tue May 21 11:43:25 2019 +0200 @@ -23,18 +23,18 @@ #include <Core/HttpClient.h> -namespace OrthancStone +namespace Deprecated { - WebServiceGetCommand::WebServiceGetCommand(MessageBroker& broker, - MessageHandler<IWebService::HttpRequestSuccessMessage>* successCallback, // takes ownership - MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback, // takes ownership + WebServiceGetCommand::WebServiceGetCommand(OrthancStone::MessageBroker& broker, + OrthancStone::MessageHandler<IWebService::HttpRequestSuccessMessage>* successCallback, // takes ownership + OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback, // takes ownership const Orthanc::WebServiceParameters& parameters, const std::string& url, const IWebService::HttpHeaders& headers, unsigned int timeoutInSeconds, Orthanc::IDynamicObject* payload /* takes ownership */, - NativeStoneApplicationContext& context) : + OrthancStone::NativeStoneApplicationContext& context) : WebServiceCommandBase(broker, successCallback, failureCallback, parameters, url, headers, timeoutInSeconds, payload, context) { }
--- a/Platforms/Generic/WebServiceGetCommand.h Mon May 20 16:26:34 2019 +0200 +++ b/Platforms/Generic/WebServiceGetCommand.h Tue May 21 11:43:25 2019 +0200 @@ -23,20 +23,20 @@ #include "WebServiceCommandBase.h" -namespace OrthancStone +namespace Deprecated { class WebServiceGetCommand : public WebServiceCommandBase { public: - WebServiceGetCommand(MessageBroker& broker, - MessageHandler<IWebService::HttpRequestSuccessMessage>* successCallback, // takes ownership - MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback, // takes ownership + WebServiceGetCommand(OrthancStone::MessageBroker& broker, + OrthancStone::MessageHandler<IWebService::HttpRequestSuccessMessage>* successCallback, // takes ownership + OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback, // takes ownership const Orthanc::WebServiceParameters& parameters, const std::string& url, const IWebService::HttpHeaders& headers, unsigned int timeoutInSeconds, Orthanc::IDynamicObject* payload /* takes ownership */, - NativeStoneApplicationContext& context); + OrthancStone::NativeStoneApplicationContext& context); virtual void Execute(); };
--- a/Platforms/Generic/WebServicePostCommand.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Platforms/Generic/WebServicePostCommand.cpp Tue May 21 11:43:25 2019 +0200 @@ -23,18 +23,18 @@ #include <Core/HttpClient.h> -namespace OrthancStone +namespace Deprecated { - WebServicePostCommand::WebServicePostCommand(MessageBroker& broker, - MessageHandler<IWebService::HttpRequestSuccessMessage>* successCallback, // takes ownership - MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback, // takes ownership + WebServicePostCommand::WebServicePostCommand(OrthancStone::MessageBroker& broker, + OrthancStone::MessageHandler<Deprecated::IWebService::HttpRequestSuccessMessage>* successCallback, // takes ownership + OrthancStone::MessageHandler<Deprecated::IWebService::HttpRequestErrorMessage>* failureCallback, // takes ownership const Orthanc::WebServiceParameters& parameters, const std::string& url, - const IWebService::HttpHeaders& headers, + const Deprecated::IWebService::HttpHeaders& headers, unsigned int timeoutInSeconds, const std::string& body, Orthanc::IDynamicObject* payload /* takes ownership */, - NativeStoneApplicationContext& context) : + OrthancStone::NativeStoneApplicationContext& context) : WebServiceCommandBase(broker, successCallback, failureCallback, parameters, url, headers, timeoutInSeconds, payload, context), body_(body) { @@ -48,7 +48,7 @@ client.SetMethod(Orthanc::HttpMethod_Post); client.GetBody().swap(body_); - for (IWebService::HttpHeaders::const_iterator it = headers_.begin(); it != headers_.end(); it++ ) + for (Deprecated::IWebService::HttpHeaders::const_iterator it = headers_.begin(); it != headers_.end(); it++ ) { client.AddHeader(it->first, it->second); }
--- a/Platforms/Generic/WebServicePostCommand.h Mon May 20 16:26:34 2019 +0200 +++ b/Platforms/Generic/WebServicePostCommand.h Tue May 21 11:43:25 2019 +0200 @@ -23,7 +23,7 @@ #include "WebServiceCommandBase.h" -namespace OrthancStone +namespace Deprecated { class WebServicePostCommand : public WebServiceCommandBase { @@ -31,16 +31,16 @@ std::string body_; public: - WebServicePostCommand(MessageBroker& broker, - MessageHandler<IWebService::HttpRequestSuccessMessage>* successCallback, // takes ownership - MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback, // takes ownership + WebServicePostCommand(OrthancStone::MessageBroker& broker, + OrthancStone::MessageHandler<IWebService::HttpRequestSuccessMessage>* successCallback, // takes ownership + OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback, // takes ownership const Orthanc::WebServiceParameters& parameters, const std::string& url, const IWebService::HttpHeaders& headers, unsigned int timeoutInSeconds, const std::string& body, Orthanc::IDynamicObject* payload /* takes ownership */, - NativeStoneApplicationContext& context); + OrthancStone::NativeStoneApplicationContext& context); virtual void Execute(); };
--- a/Platforms/Wasm/Defaults.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Platforms/Wasm/Defaults.cpp Tue May 21 11:43:25 2019 +0200 @@ -26,16 +26,16 @@ static OrthancStone::ViewportContentChangedObserver viewportContentChangedObserver_(broker); static OrthancStone::StatusBar statusBar_; -static std::list<std::shared_ptr<OrthancStone::WidgetViewport>> viewports_; +static std::list<std::shared_ptr<Deprecated::WidgetViewport>> viewports_; -std::shared_ptr<OrthancStone::WidgetViewport> FindViewportSharedPtr(ViewportHandle viewport) { +std::shared_ptr<Deprecated::WidgetViewport> FindViewportSharedPtr(ViewportHandle viewport) { for (const auto& v : viewports_) { if (v.get() == viewport) { return v; } } assert(false); - return std::shared_ptr<OrthancStone::WidgetViewport>(); + return std::shared_ptr<Deprecated::WidgetViewport>(); } #ifdef __cplusplus @@ -47,7 +47,7 @@ // when WASM needs a C++ viewport ViewportHandle EMSCRIPTEN_KEEPALIVE CreateCppViewport() { - std::shared_ptr<OrthancStone::WidgetViewport> viewport(new OrthancStone::WidgetViewport(broker)); + std::shared_ptr<Deprecated::WidgetViewport> viewport(new Deprecated::WidgetViewport(broker)); printf("viewport %x\n", (int)viewport.get()); viewports_.push_back(viewport); @@ -57,7 +57,7 @@ viewport->SetStatusBar(statusBar_); viewport->RegisterObserverCallback( - new Callable<ViewportContentChangedObserver, IViewport::ViewportChangedMessage> + new Callable<ViewportContentChangedObserver, Deprecated::IViewport::ViewportChangedMessage> (viewportContentChangedObserver_, &ViewportContentChangedObserver::OnViewportChanged)); return viewport.get(); @@ -65,7 +65,7 @@ // when WASM does not need a viewport anymore, it should release it void EMSCRIPTEN_KEEPALIVE ReleaseCppViewport(ViewportHandle viewport) { - viewports_.remove_if([viewport](const std::shared_ptr<OrthancStone::WidgetViewport>& v) { return v.get() == viewport;}); + viewports_.remove_if([viewport](const std::shared_ptr<Deprecated::WidgetViewport>& v) { return v.get() == viewport;}); printf("There are now %lu viewports in C++\n", viewports_.size()); } @@ -76,8 +76,8 @@ application.reset(CreateUserApplication(broker)); applicationWasmAdapter.reset(CreateWasmApplicationAdapter(broker, application.get())); - WasmWebService::SetBroker(broker); - WasmDelayedCallExecutor::SetBroker(broker); + Deprecated::WasmWebService::SetBroker(broker); + Deprecated::WasmDelayedCallExecutor::SetBroker(broker); startupParametersBuilder.Clear(); } @@ -104,8 +104,8 @@ context.reset(new OrthancStone::StoneApplicationContext(broker)); context->SetOrthancBaseUrl(baseUri); printf("Base URL to Orthanc API: [%s]\n", baseUri); - context->SetWebService(OrthancStone::WasmWebService::GetInstance()); - context->SetDelayedCallExecutor(OrthancStone::WasmDelayedCallExecutor::GetInstance()); + context->SetWebService(Deprecated::WasmWebService::GetInstance()); + context->SetDelayedCallExecutor(Deprecated::WasmDelayedCallExecutor::GetInstance()); application->Initialize(context.get(), statusBar_, parameters); application->InitializeWasm(); @@ -208,7 +208,7 @@ return; // Unknown button } - viewport->MouseDown(button, x, y, OrthancStone::KeyboardModifiers_None, std::vector<OrthancStone::Touch>()); + viewport->MouseDown(button, x, y, OrthancStone::KeyboardModifiers_None, std::vector<Deprecated::Touch>()); } @@ -239,10 +239,10 @@ int x, int y) { - viewport->MouseMove(x, y, std::vector<OrthancStone::Touch>()); + viewport->MouseMove(x, y, std::vector<Deprecated::Touch>()); } - void GetTouchVector(std::vector<OrthancStone::Touch>& output, + void GetTouchVector(std::vector<Deprecated::Touch>& output, int touchCount, float x0, float y0, @@ -254,15 +254,15 @@ // TODO: it might be nice to try to pass all the x0,y0 coordinates as arrays but that's not so easy to pass array between JS and C++ if (touchCount > 0) { - output.push_back(OrthancStone::Touch(x0, y0)); + output.push_back(Deprecated::Touch(x0, y0)); } if (touchCount > 1) { - output.push_back(OrthancStone::Touch(x1, y1)); + output.push_back(Deprecated::Touch(x1, y1)); } if (touchCount > 2) { - output.push_back(OrthancStone::Touch(x2, y2)); + output.push_back(Deprecated::Touch(x2, y2)); } } @@ -278,7 +278,7 @@ { printf("touch start with %d touches\n", touchCount); - std::vector<OrthancStone::Touch> touches; + std::vector<Deprecated::Touch> touches; GetTouchVector(touches, touchCount, x0, y0, x1, y1, x2, y2); viewport->TouchStart(touches); } @@ -294,7 +294,7 @@ { printf("touch move with %d touches\n", touchCount); - std::vector<OrthancStone::Touch> touches; + std::vector<Deprecated::Touch> touches; GetTouchVector(touches, touchCount, x0, y0, x1, y1, x2, y2); viewport->TouchMove(touches); } @@ -310,7 +310,7 @@ { printf("touch end with %d touches remaining\n", touchCount); - std::vector<OrthancStone::Touch> touches; + std::vector<Deprecated::Touch> touches; GetTouchVector(touches, touchCount, x0, y0, x1, y1, x2, y2); viewport->TouchEnd(touches); }
--- a/Platforms/Wasm/Defaults.h Mon May 20 16:26:34 2019 +0200 +++ b/Platforms/Wasm/Defaults.h Tue May 21 11:43:25 2019 +0200 @@ -8,7 +8,7 @@ #include <Applications/IStoneApplication.h> #include <Platforms/Wasm/WasmPlatformApplicationAdapter.h> -typedef OrthancStone::WidgetViewport* ViewportHandle; // the objects exchanged between JS and C++ +typedef Deprecated::WidgetViewport* ViewportHandle; // the objects exchanged between JS and C++ #ifdef __cplusplus extern "C" { @@ -57,7 +57,7 @@ isScheduled_ = false; } - void OnViewportChanged(const IViewport::ViewportChangedMessage& message) + void OnViewportChanged(const Deprecated::IViewport::ViewportChangedMessage& message) { if (!isScheduled_) { @@ -68,7 +68,7 @@ }; // default status bar to log messages on the console/stdout - class StatusBar : public OrthancStone::IStatusBar + class StatusBar : public Deprecated::IStatusBar { public: virtual void ClearMessage()
--- a/Platforms/Wasm/WasmDelayedCallExecutor.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Platforms/Wasm/WasmDelayedCallExecutor.cpp Tue May 21 11:43:25 2019 +0200 @@ -21,8 +21,8 @@ } else { - reinterpret_cast<OrthancStone::MessageHandler<OrthancStone::IDelayedCallExecutor::TimeoutMessage>*>(callable)-> - Apply(OrthancStone::IDelayedCallExecutor::TimeoutMessage()); // uri, reinterpret_cast<Orthanc::IDynamicObject*>(payload))); + reinterpret_cast<OrthancStone::MessageHandler<Deprecated::IDelayedCallExecutor::TimeoutMessage>*>(callable)-> + Apply(Deprecated::IDelayedCallExecutor::TimeoutMessage()); // uri, reinterpret_cast<Orthanc::IDynamicObject*>(payload))); } } @@ -33,12 +33,12 @@ -namespace OrthancStone +namespace Deprecated { - MessageBroker* WasmDelayedCallExecutor::broker_ = NULL; + OrthancStone::MessageBroker* WasmDelayedCallExecutor::broker_ = NULL; - void WasmDelayedCallExecutor::Schedule(MessageHandler<IDelayedCallExecutor::TimeoutMessage>* callback, + void WasmDelayedCallExecutor::Schedule(OrthancStone::MessageHandler<IDelayedCallExecutor::TimeoutMessage>* callback, unsigned int timeoutInMs) { WasmDelayedCallExecutor_Schedule(callback, timeoutInMs);
--- a/Platforms/Wasm/WasmDelayedCallExecutor.h Mon May 20 16:26:34 2019 +0200 +++ b/Platforms/Wasm/WasmDelayedCallExecutor.h Tue May 21 11:43:25 2019 +0200 @@ -3,15 +3,15 @@ #include <Framework/Toolbox/IDelayedCallExecutor.h> #include <Core/OrthancException.h> -namespace OrthancStone +namespace Deprecated { class WasmDelayedCallExecutor : public IDelayedCallExecutor { private: - static MessageBroker* broker_; + static OrthancStone::MessageBroker* broker_; // Private constructor => Singleton design pattern - WasmDelayedCallExecutor(MessageBroker& broker) : + WasmDelayedCallExecutor(OrthancStone::MessageBroker& broker) : IDelayedCallExecutor(broker) { } @@ -28,12 +28,12 @@ return instance; } - static void SetBroker(MessageBroker& broker) + static void SetBroker(OrthancStone::MessageBroker& broker) { broker_ = &broker; } - virtual void Schedule(MessageHandler<IDelayedCallExecutor::TimeoutMessage>* callback, + virtual void Schedule(OrthancStone::MessageHandler<IDelayedCallExecutor::TimeoutMessage>* callback, unsigned int timeoutInMs = 1000); };
--- a/Platforms/Wasm/WasmViewport.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Platforms/Wasm/WasmViewport.cpp Tue May 21 11:43:25 2019 +0200 @@ -3,11 +3,11 @@ #include <vector> #include <memory> -std::vector<std::shared_ptr<OrthancStone::WidgetViewport>> wasmViewports; +std::vector<std::shared_ptr<Deprecated::WidgetViewport>> wasmViewports; -void AttachWidgetToWasmViewport(const char* htmlCanvasId, OrthancStone::IWidget* centralWidget) { - std::shared_ptr<OrthancStone::WidgetViewport> viewport(CreateWasmViewportFromCpp(htmlCanvasId)); +void AttachWidgetToWasmViewport(const char* htmlCanvasId, Deprecated::IWidget* centralWidget) { + std::shared_ptr<Deprecated::WidgetViewport> viewport(CreateWasmViewportFromCpp(htmlCanvasId)); viewport->SetCentralWidget(centralWidget); wasmViewports.push_back(viewport); -} \ No newline at end of file +}
--- a/Platforms/Wasm/WasmViewport.h Mon May 20 16:26:34 2019 +0200 +++ b/Platforms/Wasm/WasmViewport.h Tue May 21 11:43:25 2019 +0200 @@ -9,10 +9,10 @@ #endif // JS methods accessible from C++ - extern OrthancStone::WidgetViewport* CreateWasmViewportFromCpp(const char* htmlCanvasId); + extern Deprecated::WidgetViewport* CreateWasmViewportFromCpp(const char* htmlCanvasId); #ifdef __cplusplus } #endif -extern void AttachWidgetToWasmViewport(const char* htmlCanvasId, OrthancStone::IWidget* centralWidget); +extern void AttachWidgetToWasmViewport(const char* htmlCanvasId, Deprecated::IWidget* centralWidget);
--- a/Platforms/Wasm/WasmWebService.cpp Mon May 20 16:26:34 2019 +0200 +++ b/Platforms/Wasm/WasmWebService.cpp Tue May 21 11:43:25 2019 +0200 @@ -6,9 +6,9 @@ struct CachedSuccessNotification { - boost::shared_ptr<OrthancStone::BaseWebService::CachedHttpRequestSuccessMessage> cachedMessage; + boost::shared_ptr<Deprecated::BaseWebService::CachedHttpRequestSuccessMessage> cachedMessage; std::auto_ptr<Orthanc::IDynamicObject> payload; - OrthancStone::MessageHandler<OrthancStone::IWebService::HttpRequestSuccessMessage>* successCallback; + OrthancStone::MessageHandler<Deprecated::IWebService::HttpRequestSuccessMessage>* successCallback; }; @@ -47,8 +47,8 @@ { if (failureCallable != NULL) { - reinterpret_cast<OrthancStone::MessageHandler<OrthancStone::IWebService::HttpRequestErrorMessage>*>(failureCallable)-> - Apply(OrthancStone::IWebService::HttpRequestErrorMessage(uri, reinterpret_cast<Orthanc::IDynamicObject*>(payload))); + reinterpret_cast<OrthancStone::MessageHandler<Deprecated::IWebService::HttpRequestErrorMessage>*>(failureCallable)-> + Apply(Deprecated::IWebService::HttpRequestErrorMessage(uri, reinterpret_cast<Orthanc::IDynamicObject*>(payload))); } } @@ -57,7 +57,7 @@ // notification has been allocated in C++ and passed to JS. It must be deleted by this method std::auto_ptr<CachedSuccessNotification> notification(reinterpret_cast<CachedSuccessNotification*>(notification_)); - notification->successCallback->Apply(OrthancStone::IWebService::HttpRequestSuccessMessage( + notification->successCallback->Apply(Deprecated::IWebService::HttpRequestSuccessMessage( notification->cachedMessage->GetUri(), notification->cachedMessage->GetAnswer(), notification->cachedMessage->GetAnswerSize(), @@ -75,13 +75,13 @@ { if (successCallable != NULL) { - OrthancStone::IWebService::HttpHeaders headers; + Deprecated::IWebService::HttpHeaders headers; // TODO - Parse "answerHeaders" //printf("TODO: parse headers [%s]\n", answerHeaders); - reinterpret_cast<OrthancStone::MessageHandler<OrthancStone::IWebService::HttpRequestSuccessMessage>*>(successCallable)-> - Apply(OrthancStone::IWebService::HttpRequestSuccessMessage(uri, body, bodySize, headers, + reinterpret_cast<OrthancStone::MessageHandler<Deprecated::IWebService::HttpRequestSuccessMessage>*>(successCallable)-> + Apply(Deprecated::IWebService::HttpRequestSuccessMessage(uri, body, bodySize, headers, reinterpret_cast<Orthanc::IDynamicObject*>(payload))); } } @@ -92,9 +92,9 @@ -namespace OrthancStone +namespace Deprecated { - MessageBroker* WasmWebService::broker_ = NULL; + OrthancStone::MessageBroker* WasmWebService::broker_ = NULL; void ToJsonString(std::string& output, const IWebService::HttpHeaders& headers) { @@ -116,8 +116,8 @@ const HttpHeaders& headers, const std::string& body, Orthanc::IDynamicObject* payload, - MessageHandler<IWebService::HttpRequestSuccessMessage>* successCallable, - MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallable, + OrthancStone::MessageHandler<IWebService::HttpRequestSuccessMessage>* successCallable, + OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallable, unsigned int timeoutInSeconds) { std::string headersInJsonString; @@ -129,8 +129,8 @@ void WasmWebService::DeleteAsync(const std::string& relativeUri, const HttpHeaders& headers, Orthanc::IDynamicObject* payload, - MessageHandler<IWebService::HttpRequestSuccessMessage>* successCallable, - MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallable, + OrthancStone::MessageHandler<IWebService::HttpRequestSuccessMessage>* successCallable, + OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallable, unsigned int timeoutInSeconds) { std::string headersInJsonString; @@ -142,8 +142,8 @@ void WasmWebService::GetAsyncInternal(const std::string &relativeUri, const HttpHeaders &headers, Orthanc::IDynamicObject *payload, - MessageHandler<IWebService::HttpRequestSuccessMessage> *successCallable, - MessageHandler<IWebService::HttpRequestErrorMessage> *failureCallable, + OrthancStone::MessageHandler<IWebService::HttpRequestSuccessMessage> *successCallable, + OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage> *failureCallable, unsigned int timeoutInSeconds) { std::string headersInJsonString; @@ -153,8 +153,8 @@ } void WasmWebService::NotifyHttpSuccessLater(boost::shared_ptr<BaseWebService::CachedHttpRequestSuccessMessage> cachedMessage, - Orthanc::IDynamicObject* payload, // takes ownership - MessageHandler<IWebService::HttpRequestSuccessMessage>* successCallback) + Orthanc::IDynamicObject* payload, // takes ownership + OrthancStone::MessageHandler<IWebService::HttpRequestSuccessMessage>* successCallback) { CachedSuccessNotification* notification = new CachedSuccessNotification(); // allocated on the heap, it will be passed to JS and deleted when coming back to C++ notification->cachedMessage = cachedMessage;
--- a/Platforms/Wasm/WasmWebService.h Mon May 20 16:26:34 2019 +0200 +++ b/Platforms/Wasm/WasmWebService.h Tue May 21 11:43:25 2019 +0200 @@ -3,15 +3,15 @@ #include <Framework/Toolbox/BaseWebService.h> #include <Core/OrthancException.h> -namespace OrthancStone +namespace Deprecated { class WasmWebService : public BaseWebService { private: - static MessageBroker *broker_; + static OrthancStone::MessageBroker *broker_; // Private constructor => Singleton design pattern - WasmWebService(MessageBroker &broker) : BaseWebService(broker) + WasmWebService(OrthancStone::MessageBroker &broker) : BaseWebService(broker) { } @@ -27,7 +27,7 @@ return instance; } - static void SetBroker(MessageBroker &broker) + static void SetBroker(OrthancStone::MessageBroker &broker) { broker_ = &broker; } @@ -36,27 +36,27 @@ const HttpHeaders &headers, const std::string &body, Orthanc::IDynamicObject *payload, - MessageHandler<IWebService::HttpRequestSuccessMessage> *successCallable, - MessageHandler<IWebService::HttpRequestErrorMessage> *failureCallable = NULL, + OrthancStone::MessageHandler<IWebService::HttpRequestSuccessMessage> *successCallable, + OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage> *failureCallable = NULL, unsigned int timeoutInSeconds = 60); virtual void DeleteAsync(const std::string &uri, const HttpHeaders &headers, Orthanc::IDynamicObject *payload, - MessageHandler<IWebService::HttpRequestSuccessMessage> *successCallable, - MessageHandler<IWebService::HttpRequestErrorMessage> *failureCallable = NULL, + OrthancStone::MessageHandler<IWebService::HttpRequestSuccessMessage> *successCallable, + OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage> *failureCallable = NULL, unsigned int timeoutInSeconds = 60); protected: virtual void GetAsyncInternal(const std::string &uri, const HttpHeaders &headers, Orthanc::IDynamicObject *payload, - MessageHandler<IWebService::HttpRequestSuccessMessage> *successCallable, - MessageHandler<IWebService::HttpRequestErrorMessage> *failureCallable = NULL, + OrthancStone::MessageHandler<IWebService::HttpRequestSuccessMessage> *successCallable, + OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage> *failureCallable = NULL, unsigned int timeoutInSeconds = 60); virtual void NotifyHttpSuccessLater(boost::shared_ptr<BaseWebService::CachedHttpRequestSuccessMessage> cachedHttpMessage, Orthanc::IDynamicObject *payload, // takes ownership - MessageHandler<IWebService::HttpRequestSuccessMessage> *successCallback); + OrthancStone::MessageHandler<IWebService::HttpRequestSuccessMessage> *successCallback); }; -} // namespace OrthancStone +} // namespace Deprecated