Mercurial > hg > orthanc-stone
changeset 1298:8a0a62189f46
replacing std::auto_ptr by std::unique_ptr
line wrap: on
line diff
--- a/Applications/Generic/GuiAdapter.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Applications/Generic/GuiAdapter.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -34,6 +34,8 @@ # include "../../Framework/Messages/LockingEmitter.h" #endif +#include <Core/Compatibility.h> + namespace OrthancStone { std::ostream& operator<<( @@ -195,7 +197,7 @@ // userData is OnMouseWheelFuncAdapterPayload FuncAdapterPayload<GenericFunc>* payload = reinterpret_cast<FuncAdapterPayload<GenericFunc>*>(userData); - //std::auto_ptr< FuncAdapterPayload<GenericFunc> > deleter(payload); + //std::unique_ptr< FuncAdapterPayload<GenericFunc> > deleter(payload); bool ret = (*(payload->callback))(time, payload->userData); return static_cast<EM_BOOL>(ret); } @@ -214,7 +216,7 @@ // here FuncAdapterPayload<GenericFunc>* payload = new FuncAdapterPayload<GenericFunc>(); - std::auto_ptr<FuncAdapterPayload<GenericFunc> > payloadP(payload); + std::unique_ptr<FuncAdapterPayload<GenericFunc> > payloadP(payload); payload->canvasId = canvasId; payload->callback = func; payload->userData = userData; @@ -239,7 +241,7 @@ EmscriptenSetCallbackFunc emFunc, std::string canvasId, void* userData, bool capture, GenericFunc func) { - std::auto_ptr<FuncAdapterPayload<GenericFunc> > payload( + std::unique_ptr<FuncAdapterPayload<GenericFunc> > payload( new FuncAdapterPayload<GenericFunc>() ); payload->canvasId = canvasId; @@ -262,7 +264,7 @@ void* userData, GenericFunc func) { // LOG(ERROR) << "SetAnimationFrameCallback !!!!!! (RequestAnimationFrame)"; - std::auto_ptr<FuncAdapterPayload<GenericFunc> > payload( + std::unique_ptr<FuncAdapterPayload<GenericFunc> > payload( new FuncAdapterPayload<GenericFunc>() ); payload->canvasId = "UNDEFINED";
--- a/Applications/Qt/QCairoWidget.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Applications/Qt/QCairoWidget.h Mon Mar 02 16:31:30 2020 +0100 @@ -49,10 +49,10 @@ } }; - std::auto_ptr<QImage> image_; + std::unique_ptr<QImage> image_; OrthancStone::CairoSurface surface_; OrthancStone::NativeStoneApplicationContext* context_; - std::auto_ptr<StoneObserver> observer_; + std::unique_ptr<StoneObserver> observer_; protected: virtual void paintEvent(QPaintEvent *event);
--- a/Applications/Qt/QtStoneApplicationRunner.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Applications/Qt/QtStoneApplicationRunner.h Mon Mar 02 16:31:30 2020 +0100 @@ -33,7 +33,7 @@ class QtStoneApplicationRunner : public NativeStoneApplicationRunner { protected: - std::auto_ptr<QStoneMainWindow> window_; + std::unique_ptr<QStoneMainWindow> window_; public: QtStoneApplicationRunner(MessageBroker& broker,
--- a/Applications/Samples/BasicPetCtFusionApplication.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Applications/Samples/BasicPetCtFusionApplication.h Mon Mar 02 16:31:30 2020 +0100 @@ -179,9 +179,9 @@ VolumeImage& petVolume = context.AddSeriesVolume(pet, true /* progressive download */, 1); // Take the PET volume as the reference for the slices - std::auto_ptr<Interactor> interactor(new Interactor(petVolume, VolumeProjection_Axial, false /* don't reverse normal */)); + std::unique_ptr<Interactor> interactor(new Interactor(petVolume, VolumeProjection_Axial, false /* don't reverse normal */)); - std::auto_ptr<LayeredSceneWidget> widget(new LayeredSceneWidget); + std::unique_ptr<LayeredSceneWidget> widget(new LayeredSceneWidget); widget->AddLayer(new VolumeImage::LayerFactory(ctVolume)); widget->AddLayer(new VolumeImage::LayerFactory(petVolume)); widget->SetSlice(interactor->GetCursor().GetCurrentSlice());
--- a/Applications/Samples/LayoutPetCtFusionApplication.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Applications/Samples/LayoutPetCtFusionApplication.h Mon Mar 02 16:31:30 2020 +0100 @@ -208,7 +208,7 @@ LayeredSceneWidget* CreateWidget() { - std::auto_ptr<LayeredSceneWidget> widget(new LayeredSceneWidget); + std::unique_ptr<LayeredSceneWidget> widget(new LayeredSceneWidget); widget->Register(dynamic_cast<WorldSceneWidget::IWorldObserver&>(*this)); widget->Register(dynamic_cast<LayeredSceneWidget::ISliceObserver&>(*this)); return widget.release(); @@ -217,7 +217,7 @@ void CreateLayout(BasicApplicationContext& context) { - std::auto_ptr<OrthancStone::LayoutWidget> layout(new OrthancStone::LayoutWidget); + std::unique_ptr<OrthancStone::LayoutWidget> layout(new OrthancStone::LayoutWidget); layout->SetBackgroundCleared(true); //layout->SetBackgroundColor(255,0,0); layout->SetPadding(5);
--- a/Applications/Samples/SampleInteractor.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Applications/Samples/SampleInteractor.h Mon Mar 02 16:31:30 2020 +0100 @@ -47,7 +47,7 @@ VolumeProjection projection, bool reverse) { - std::auto_ptr<ParallelSlices> slices(volume.GetGeometry(projection, reverse)); + std::unique_ptr<ParallelSlices> slices(volume.GetGeometry(projection, reverse)); cursor_.SetGeometry(*slices); } @@ -56,7 +56,7 @@ { if (reverse) { - std::auto_ptr<ParallelSlices> slices(series.GetGeometry().Reverse()); + std::unique_ptr<ParallelSlices> slices(series.GetGeometry().Reverse()); cursor_.SetGeometry(*slices); } else
--- a/Applications/Samples/SimpleViewer/SimpleViewerApplication.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Applications/Samples/SimpleViewer/SimpleViewerApplication.h Mon Mar 02 16:31:30 2020 +0100 @@ -81,8 +81,8 @@ private: Tool currentTool_; - std::auto_ptr<MainWidgetInteractor> mainWidgetInteractor_; - std::auto_ptr<ThumbnailInteractor> thumbnailInteractor_; + std::unique_ptr<MainWidgetInteractor> mainWidgetInteractor_; + std::unique_ptr<ThumbnailInteractor> thumbnailInteractor_; Deprecated::LayoutWidget* mainLayout_; Deprecated::LayoutWidget* thumbnailsLayout_; Deprecated::SliceViewerWidget* mainWidget_; @@ -94,7 +94,7 @@ Deprecated::WidgetViewport* wasmViewport2_; Deprecated::IStatusBar* statusBar_; - std::auto_ptr<Deprecated::SmartLoader> smartLoader_; + std::unique_ptr<Deprecated::SmartLoader> smartLoader_; Orthanc::Font font_;
--- a/Applications/Samples/SimpleViewerApplicationSingleFile.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Applications/Samples/SimpleViewerApplicationSingleFile.h Mon Mar 02 16:31:30 2020 +0100 @@ -239,8 +239,8 @@ }; Tool currentTool_; - std::auto_ptr<MainWidgetInteractor> mainWidgetInteractor_; - std::auto_ptr<ThumbnailInteractor> thumbnailInteractor_; + std::unique_ptr<MainWidgetInteractor> mainWidgetInteractor_; + std::unique_ptr<ThumbnailInteractor> thumbnailInteractor_; Deprecated::LayoutWidget* mainLayout_; Deprecated::LayoutWidget* thumbnailsLayout_; std::vector<Deprecated::SliceViewerWidget*> thumbnails_; @@ -253,7 +253,7 @@ Deprecated::WidgetViewport* wasmViewport2_; Deprecated::IStatusBar* statusBar_; - std::auto_ptr<Deprecated::SmartLoader> smartLoader_; + std::unique_ptr<Deprecated::SmartLoader> smartLoader_; Orthanc::Font font_;
--- a/Applications/Samples/SingleFrameApplication.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Applications/Samples/SingleFrameApplication.h Mon Mar 02 16:31:30 2020 +0100 @@ -197,7 +197,7 @@ GetMainWidget().FitContent(); } - std::auto_ptr<Interactor> mainWidgetInteractor_; + std::unique_ptr<Interactor> mainWidgetInteractor_; const Deprecated::DicomSeriesVolumeSlicer* source_; unsigned int slice_; @@ -245,7 +245,7 @@ mainWidget_ = new Deprecated::SliceViewerWidget(GetBroker(), "main-widget"); - std::auto_ptr<Deprecated::DicomSeriesVolumeSlicer> layer(new Deprecated::DicomSeriesVolumeSlicer(GetBroker(), context->GetOrthancApiClient())); + std::unique_ptr<Deprecated::DicomSeriesVolumeSlicer> layer(new Deprecated::DicomSeriesVolumeSlicer(GetBroker(), context->GetOrthancApiClient())); source_ = layer.get(); layer->LoadFrame(instance, frame); layer->RegisterObserverCallback(new Callable<SingleFrameApplication, Deprecated::IVolumeSlicer::GeometryReadyMessage>(*this, &SingleFrameApplication::OnMainWidgetGeometryReady));
--- a/Applications/Samples/SingleFrameEditorApplication.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Applications/Samples/SingleFrameEditorApplication.h Mon Mar 02 16:31:30 2020 +0100 @@ -509,7 +509,7 @@ interactor_.SetMaskLayer(maskLayer_); { - std::auto_ptr<Orthanc::ImageAccessor> renderedTextAlpha(TextRenderer::Render(Orthanc::EmbeddedResources::UBUNTU_FONT, 100, + std::unique_ptr<Orthanc::ImageAccessor> renderedTextAlpha(TextRenderer::Render(Orthanc::EmbeddedResources::UBUNTU_FONT, 100, "%öÇaA&#")); RadiographyLayer& layer = scene_->LoadAlphaBitmap(renderedTextAlpha.release(), NULL); dynamic_cast<RadiographyAlphaLayer&>(layer).SetForegroundValue(200.0f * 256.0f);
--- a/Applications/Samples/SingleVolumeApplication.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Applications/Samples/SingleVolumeApplication.h Mon Mar 02 16:31:30 2020 +0100 @@ -170,10 +170,10 @@ throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); } - std::auto_ptr<SliceViewerWidget> widget(new SliceViewerWidget); + std::unique_ptr<SliceViewerWidget> widget(new SliceViewerWidget); #if 1 - std::auto_ptr<OrthancVolumeImage> volume(new OrthancVolumeImage(context.GetWebService(), true)); + std::unique_ptr<OrthancVolumeImage> volume(new OrthancVolumeImage(context.GetWebService(), true)); if (series.empty()) { volume->ScheduleLoadInstance(instance); @@ -206,14 +206,14 @@ widget->SetLayerStyle(0, s); } #else - std::auto_ptr<OrthancVolumeImage> ct(new OrthancVolumeImage(context_->GetWebService(), false)); + std::unique_ptr<OrthancVolumeImage> ct(new OrthancVolumeImage(context_->GetWebService(), false)); //ct->ScheduleLoadSeries("15a6f44a-ac7b88fe-19c462d9-dddd918e-b01550d8"); // 0178023P //ct->ScheduleLoadSeries("dd069910-4f090474-7d2bba07-e5c10783-f9e4fb1d"); //ct->ScheduleLoadSeries("a04ecf01-79b2fc33-58239f7e-ad9db983-28e81afa"); // IBA //ct->ScheduleLoadSeries("03677739-1d8bca40-db1daf59-d74ff548-7f6fc9c0"); // 0522c0001 TCIA ct->ScheduleLoadSeries("295e8a13-dfed1320-ba6aebb2-9a13e20f-1b3eb953"); // Captain - std::auto_ptr<OrthancVolumeImage> pet(new OrthancVolumeImage(context_->GetWebService(), true)); + std::unique_ptr<OrthancVolumeImage> pet(new OrthancVolumeImage(context_->GetWebService(), true)); //pet->ScheduleLoadSeries("48d2997f-8e25cd81-dd715b64-bd79cdcc-e8fcee53"); // 0178023P //pet->ScheduleLoadSeries("aabad2e7-80702b5d-e599d26c-4f13398e-38d58a9e"); //pet->ScheduleLoadInstance("830a69ff-8e4b5ee3-b7f966c8-bccc20fb-d322dceb"); // IBA 1 @@ -223,7 +223,7 @@ pet->ScheduleLoadInstance("f080888c-0ab7528a-f7d9c28c-84980eb1-ff3b0ae6"); // Captain 1 //pet->ScheduleLoadInstance("4f78055b-6499a2c5-1e089290-394acc05-3ec781c1"); // Captain 2 - std::auto_ptr<StructureSetLoader> rtStruct(new StructureSetLoader(context_->GetWebService())); + std::unique_ptr<StructureSetLoader> rtStruct(new StructureSetLoader(context_->GetWebService())); //rtStruct->ScheduleLoadInstance("c2ebc17b-6b3548db-5e5da170-b8ecab71-ea03add3"); // 0178023P //rtStruct->ScheduleLoadInstance("54460695-ba3885ee-ddf61ac0-f028e31d-a6e474d9"); // IBA //rtStruct->ScheduleLoadInstance("17cd032b-ad92a438-ca05f06a-f9e96668-7e3e9e20"); // 0522c0001 TCIA
--- a/Applications/Samples/StoneSampleCommands_generated.hpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Applications/Samples/StoneSampleCommands_generated.hpp Mon Mar 02 16:31:30 2020 +0100 @@ -18,7 +18,7 @@ //#define STONEGEN_NO_CPP11 1 #ifdef STONEGEN_NO_CPP11 -#define StoneSmartPtr std::auto_ptr +#define StoneSmartPtr std::unique_ptr #else #define StoneSmartPtr std::unique_ptr #endif
--- a/Applications/Samples/SynchronizedSeriesApplication.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Applications/Samples/SynchronizedSeriesApplication.h Mon Mar 02 16:31:30 2020 +0100 @@ -40,12 +40,12 @@ LayeredSceneWidget* CreateSeriesWidget(BasicApplicationContext& context, const std::string& series) { - std::auto_ptr<ISeriesLoader> loader + std::unique_ptr<ISeriesLoader> loader (new OrthancSeriesLoader(context.GetWebService().GetConnection(), series)); - std::auto_ptr<SampleInteractor> interactor(new SampleInteractor(*loader, false)); + std::unique_ptr<SampleInteractor> interactor(new SampleInteractor(*loader, false)); - std::auto_ptr<LayeredSceneWidget> widget(new LayeredSceneWidget); + std::unique_ptr<LayeredSceneWidget> widget(new LayeredSceneWidget); widget->AddLayer(new SeriesFrameRendererFactory(loader.release(), false)); widget->SetSlice(interactor->GetCursor().GetCurrentSlice()); widget->SetInteractor(*interactor); @@ -83,19 +83,19 @@ throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); } - std::auto_ptr<LayeredSceneWidget> a(CreateSeriesWidget(context, parameters["a"].as<std::string>())); - std::auto_ptr<LayeredSceneWidget> b(CreateSeriesWidget(context, parameters["b"].as<std::string>())); - std::auto_ptr<LayeredSceneWidget> c(CreateSeriesWidget(context, parameters["c"].as<std::string>())); + std::unique_ptr<LayeredSceneWidget> a(CreateSeriesWidget(context, parameters["a"].as<std::string>())); + std::unique_ptr<LayeredSceneWidget> b(CreateSeriesWidget(context, parameters["b"].as<std::string>())); + std::unique_ptr<LayeredSceneWidget> c(CreateSeriesWidget(context, parameters["c"].as<std::string>())); ReferenceLineFactory::Configure(*a, *b); ReferenceLineFactory::Configure(*a, *c); ReferenceLineFactory::Configure(*b, *c); - std::auto_ptr<LayoutWidget> layout(new LayoutWidget); + std::unique_ptr<LayoutWidget> layout(new LayoutWidget); layout->SetPadding(5); layout->AddWidget(a.release()); - std::auto_ptr<LayoutWidget> layoutB(new LayoutWidget); + std::unique_ptr<LayoutWidget> layoutB(new LayoutWidget); layoutB->SetVertical(); layoutB->SetPadding(5); layoutB->AddWidget(b.release());
--- a/Applications/Samples/TestPatternApplication.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Applications/Samples/TestPatternApplication.h Mon Mar 02 16:31:30 2020 +0100 @@ -49,7 +49,7 @@ { using namespace OrthancStone; - std::auto_ptr<LayoutWidget> layout(new LayoutWidget); + std::unique_ptr<LayoutWidget> layout(new LayoutWidget); layout->SetPadding(10); layout->SetBackgroundCleared(true); layout->AddWidget(new TestCairoWidget(parameters["animate"].as<bool>()));
--- a/Applications/Samples/rt-viewer-demo/main.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Applications/Samples/rt-viewer-demo/main.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -506,14 +506,14 @@ SliceViewerWidget& widget, StructureSetLoader& loader); SliceViewerWidget* CreateDoseCtWidget( - std::auto_ptr<OrthancVolumeImage>& ct, - std::auto_ptr<OrthancVolumeImage>& dose, - std::auto_ptr<StructureSetLoader>& structLoader, + std::unique_ptr<OrthancVolumeImage>& ct, + std::unique_ptr<OrthancVolumeImage>& dose, + std::unique_ptr<StructureSetLoader>& structLoader, VolumeProjection projection); void AddCtLayer(SliceViewerWidget& widget, OrthancVolumeImage& volume); - std::auto_ptr<Interactor> mainWidgetInteractor_; + std::unique_ptr<Interactor> mainWidgetInteractor_; const DicomSeriesVolumeSlicer* source_; unsigned int slice_; @@ -521,9 +521,9 @@ std::string doseInstance_; std::string doseSeries_; std::string structInstance_; - std::auto_ptr<OrthancStone::OrthancVolumeImage> dose_; - std::auto_ptr<OrthancStone::OrthancVolumeImage> ct_; - std::auto_ptr<OrthancStone::StructureSetLoader> struct_; + std::unique_ptr<OrthancStone::OrthancVolumeImage> dose_; + std::unique_ptr<OrthancStone::OrthancVolumeImage> ct_; + std::unique_ptr<OrthancStone::StructureSetLoader> struct_; public: RtViewerDemoApplication(MessageBroker& broker) : @@ -729,7 +729,7 @@ (ct_, dose_, struct_, OrthancStone::VolumeProjection_Axial); mainWidget_->AddWidget(axialWidget); - std::auto_ptr<OrthancStone::LayoutWidget> subLayout( + std::unique_ptr<OrthancStone::LayoutWidget> subLayout( new OrthancStone::LayoutWidget("main-layout")); subLayout->SetVertical(); subLayout->SetPadding(5); @@ -774,12 +774,12 @@ } SliceViewerWidget* RtViewerDemoApplication::CreateDoseCtWidget( - std::auto_ptr<OrthancVolumeImage>& ct, - std::auto_ptr<OrthancVolumeImage>& dose, - std::auto_ptr<StructureSetLoader>& structLoader, + std::unique_ptr<OrthancVolumeImage>& ct, + std::unique_ptr<OrthancVolumeImage>& dose, + std::unique_ptr<StructureSetLoader>& structLoader, VolumeProjection projection) { - std::auto_ptr<OrthancStone::SliceViewerWidget> widget( + std::unique_ptr<OrthancStone::SliceViewerWidget> widget( new OrthancStone::SliceViewerWidget(IObserver::GetBroker(), "ct-dose-widget"));
--- a/Applications/Sdl/SdlCairoSurface.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Applications/Sdl/SdlCairoSurface.h Mon Mar 02 16:31:30 2020 +0100 @@ -27,6 +27,8 @@ #include "../../Framework/Wrappers/CairoSurface.h" #include "../../Framework/Deprecated/Viewport/IViewport.h" +#include <Core/Compatibility.h> + #include <boost/thread/mutex.hpp> namespace OrthancStone @@ -34,7 +36,7 @@ class SdlCairoSurface : public boost::noncopyable { private: - std::auto_ptr<CairoSurface> cairoSurface_; + std::unique_ptr<CairoSurface> cairoSurface_; SdlWindow& window_; SDL_Surface* sdlSurface_;
--- a/Applications/Sdl/SdlOrthancSurface.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Applications/Sdl/SdlOrthancSurface.h Mon Mar 02 16:31:30 2020 +0100 @@ -25,7 +25,9 @@ #include "../../Framework/Viewport/SdlWindow.h" +#include <Core/Compatibility.h> #include <Core/Images/ImageAccessor.h> + #include <boost/thread/mutex.hpp> namespace OrthancStone @@ -33,7 +35,7 @@ class SdlOrthancSurface : public boost::noncopyable { private: - std::auto_ptr<Orthanc::ImageAccessor> image_; + std::unique_ptr<Orthanc::ImageAccessor> image_; SdlWindow& window_; SDL_Surface* sdlSurface_;
--- a/Applications/StoneApplicationContext.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Applications/StoneApplicationContext.h Mon Mar 02 16:31:30 2020 +0100 @@ -62,7 +62,7 @@ MessageBroker& broker_; Deprecated::IWebService* webService_; Deprecated::IDelayedCallExecutor* delayedCallExecutor_; - std::auto_ptr<Deprecated::OrthancApiClient> orthanc_; + std::unique_ptr<Deprecated::OrthancApiClient> orthanc_; std::string orthancBaseUrl_; void InitializeOrthanc();
--- a/Framework/Deprecated/Layers/ColorFrameRenderer.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Layers/ColorFrameRenderer.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -29,7 +29,7 @@ { OrthancStone::CairoSurface* ColorFrameRenderer::GenerateDisplay(const RenderStyle& style) { - std::auto_ptr<OrthancStone::CairoSurface> display + std::unique_ptr<OrthancStone::CairoSurface> display (new OrthancStone::CairoSurface(frame_->GetWidth(), frame_->GetHeight(), false /* no alpha */)); Orthanc::ImageAccessor target;
--- a/Framework/Deprecated/Layers/ColorFrameRenderer.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Layers/ColorFrameRenderer.h Mon Mar 02 16:31:30 2020 +0100 @@ -28,7 +28,7 @@ class ColorFrameRenderer : public FrameRenderer { private: - std::auto_ptr<Orthanc::ImageAccessor> frame_; // In RGB24 + std::unique_ptr<Orthanc::ImageAccessor> frame_; // In RGB24 protected: virtual OrthancStone::CairoSurface* GenerateDisplay(const RenderStyle& style);
--- a/Framework/Deprecated/Layers/FrameRenderer.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Layers/FrameRenderer.h Mon Mar 02 16:31:30 2020 +0100 @@ -35,7 +35,7 @@ double pixelSpacingY_; RenderStyle style_; bool isFullQuality_; - std::auto_ptr<OrthancStone::CairoSurface> display_; + std::unique_ptr<OrthancStone::CairoSurface> display_; protected: virtual OrthancStone::CairoSurface* GenerateDisplay(const RenderStyle& style) = 0;
--- a/Framework/Deprecated/Layers/GrayscaleFrameRenderer.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Layers/GrayscaleFrameRenderer.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -30,7 +30,7 @@ { assert(frame_->GetFormat() == Orthanc::PixelFormat_Float32); - std::auto_ptr<OrthancStone::CairoSurface> result; + std::unique_ptr<OrthancStone::CairoSurface> result; float windowCenter, windowWidth; style.ComputeWindowing(windowCenter, windowWidth,
--- a/Framework/Deprecated/Layers/GrayscaleFrameRenderer.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Layers/GrayscaleFrameRenderer.h Mon Mar 02 16:31:30 2020 +0100 @@ -29,7 +29,7 @@ class GrayscaleFrameRenderer : public FrameRenderer { private: - std::auto_ptr<Orthanc::ImageAccessor> frame_; // In Float32 + std::unique_ptr<Orthanc::ImageAccessor> frame_; // In Float32 float defaultWindowCenter_; float defaultWindowWidth_; Orthanc::PhotometricInterpretation photometric_;
--- a/Framework/Deprecated/Layers/SeriesFrameRendererFactory.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Layers/SeriesFrameRendererFactory.h Mon Mar 02 16:31:30 2020 +0100 @@ -30,11 +30,11 @@ class SeriesFrameRendererFactory : public ILayerRendererFactory { private: - std::auto_ptr<ISeriesLoader> loader_; + std::unique_ptr<ISeriesLoader> loader_; size_t currentFrame_; bool fast_; - std::auto_ptr<OrthancPlugins::IDicomDataset> currentDataset_; + std::unique_ptr<OrthancPlugins::IDicomDataset> currentDataset_; void ReadCurrentFrameDataset(size_t frame);
--- a/Framework/Deprecated/Layers/SingleFrameRendererFactory.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Layers/SingleFrameRendererFactory.h Mon Mar 02 16:31:30 2020 +0100 @@ -30,7 +30,7 @@ { private: OrthancPlugins::IOrthancConnection& orthanc_; - std::auto_ptr<OrthancPlugins::IDicomDataset> dicom_; + std::unique_ptr<OrthancPlugins::IDicomDataset> dicom_; std::string instance_; unsigned int frame_;
--- a/Framework/Deprecated/SmartLoader.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/SmartLoader.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -62,7 +62,7 @@ }; unsigned int sliceIndex_; - std::auto_ptr<Slice> slice_; + std::unique_ptr<Slice> slice_; boost::shared_ptr<Orthanc::ImageAccessor> image_; SliceImageQuality effectiveQuality_; CachedSliceStatus status_; @@ -140,7 +140,7 @@ // the messages to its observables // in both cases, we must be carefull about objects lifecycle !!! - std::auto_ptr<IVolumeSlicer> layerSource; + std::unique_ptr<IVolumeSlicer> layerSource; std::string sliceKeyId = instanceId + ":" + boost::lexical_cast<std::string>(frame); SmartLoader::CachedSlice* cachedSlice = NULL; @@ -199,7 +199,7 @@ cachedSlices_[sliceKeyId] = boost::shared_ptr<CachedSlice>(cachedSlice); - std::auto_ptr<IVolumeSlicer> layerSource(new DicomSeriesVolumeSlicer(IObserver::GetBroker(), orthancApiClient_)); + std::unique_ptr<IVolumeSlicer> layerSource(new DicomSeriesVolumeSlicer(IObserver::GetBroker(), orthancApiClient_)); dynamic_cast<DicomSeriesVolumeSlicer*>(layerSource.get())->SetImageQuality(imageQuality_); layerSource->RegisterObserverCallback(new OrthancStone::Callable<SmartLoader, IVolumeSlicer::GeometryReadyMessage>(*this, &SmartLoader::OnLayerGeometryReady));
--- a/Framework/Deprecated/Toolbox/BaseWebService.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Toolbox/BaseWebService.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -37,9 +37,9 @@ class BaseWebService::BaseWebServicePayload : public Orthanc::IDynamicObject { private: - std::auto_ptr< OrthancStone::MessageHandler<IWebService::HttpRequestSuccessMessage> > userSuccessHandler_; - std::auto_ptr< OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage> > userFailureHandler_; - std::auto_ptr< Orthanc::IDynamicObject> userPayload_; + std::unique_ptr< OrthancStone::MessageHandler<IWebService::HttpRequestSuccessMessage> > userSuccessHandler_; + std::unique_ptr< OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage> > userFailureHandler_; + std::unique_ptr< Orthanc::IDynamicObject> userPayload_; public: BaseWebServicePayload(OrthancStone::MessageHandler<IWebService::HttpRequestSuccessMessage>* userSuccessHandler,
--- a/Framework/Deprecated/Toolbox/DicomFrameConverter.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Toolbox/DicomFrameConverter.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -174,7 +174,7 @@ } - void DicomFrameConverter::ConvertFrameInplace(std::auto_ptr<Orthanc::ImageAccessor>& source) const + void DicomFrameConverter::ConvertFrameInplace(std::unique_ptr<Orthanc::ImageAccessor>& source) const { assert(sizeof(float) == 4); @@ -210,7 +210,7 @@ if (sourceFormat == Orthanc::PixelFormat_RGB24) { // This is the case of a color image. No conversion has to be done (*) - std::auto_ptr<Orthanc::Image> converted(new Orthanc::Image(Orthanc::PixelFormat_RGB24, + std::unique_ptr<Orthanc::Image> converted(new Orthanc::Image(Orthanc::PixelFormat_RGB24, source.GetWidth(), source.GetHeight(), false)); @@ -224,7 +224,7 @@ sourceFormat == Orthanc::PixelFormat_SignedGrayscale16); // This is the case of a grayscale frame. Convert it to Float32. - std::auto_ptr<Orthanc::Image> converted(new Orthanc::Image(Orthanc::PixelFormat_Float32, + std::unique_ptr<Orthanc::Image> converted(new Orthanc::Image(Orthanc::PixelFormat_Float32, source.GetWidth(), source.GetHeight(), false));
--- a/Framework/Deprecated/Toolbox/DicomFrameConverter.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Toolbox/DicomFrameConverter.h Mon Mar 02 16:31:30 2020 +0100 @@ -22,6 +22,7 @@ #pragma once #include <Plugins/Samples/Common/IDicomDataset.h> +#include <Core/Compatibility.h> #include <Core/DicomFormat/DicomMap.h> #include <Core/Images/ImageAccessor.h> @@ -63,7 +64,7 @@ { // TODO: check whether this dtor is called or not // An MSVC warning explains that declaring an - // std::auto_ptr with a forward-declared type + // std::unique_ptr with a forward-declared type // prevents its dtor from being called. Does not // seem an issue here (only POD types inside), but // definitely something to keep an eye on. @@ -157,7 +158,7 @@ return rescaleSlope_; } - void ConvertFrameInplace(std::auto_ptr<Orthanc::ImageAccessor>& source) const; + void ConvertFrameInplace(std::unique_ptr<Orthanc::ImageAccessor>& source) const; Orthanc::ImageAccessor* ConvertFrame(const Orthanc::ImageAccessor& source) const;
--- a/Framework/Deprecated/Toolbox/MessagingToolbox.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Toolbox/MessagingToolbox.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -251,7 +251,7 @@ throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); } - std::auto_ptr<Orthanc::PngReader> result(new Orthanc::PngReader); + std::unique_ptr<Orthanc::PngReader> result(new Orthanc::PngReader); result->ReadFromMemory(compressed); if (targetFormat == Orthanc::PixelFormat_SignedGrayscale16) @@ -328,7 +328,7 @@ std::string jpeg; Orthanc::Toolbox::DecodeBase64(jpeg, info["PixelData"].asString()); - std::auto_ptr<Orthanc::JpegReader> reader(new Orthanc::JpegReader); + std::unique_ptr<Orthanc::JpegReader> reader(new Orthanc::JpegReader); reader->ReadFromMemory(jpeg); if (reader->GetFormat() == Orthanc::PixelFormat_RGB24) // This is a color image @@ -386,7 +386,7 @@ } // Decode a grayscale JPEG 8bpp image coming from the Web viewer - std::auto_ptr<Orthanc::ImageAccessor> image + std::unique_ptr<Orthanc::ImageAccessor> image (new Orthanc::Image(targetFormat, reader->GetWidth(), reader->GetHeight(), false)); float scaling = static_cast<float>(stretchHigh - stretchLow) / 255.0f;
--- a/Framework/Deprecated/Toolbox/OrthancApiClient.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Toolbox/OrthancApiClient.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -68,11 +68,11 @@ class OrthancApiClient::WebServicePayload : public Orthanc::IDynamicObject { private: - 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_; + std::unique_ptr< OrthancStone::MessageHandler<EmptyResponseReadyMessage> > emptyHandler_; + std::unique_ptr< OrthancStone::MessageHandler<JsonResponseReadyMessage> > jsonHandler_; + std::unique_ptr< OrthancStone::MessageHandler<BinaryResponseReadyMessage> > binaryHandler_; + std::unique_ptr< OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage> > failureHandler_; + std::unique_ptr< Orthanc::IDynamicObject > userPayload_; OrthancStone::MessageBroker& broker_; void NotifyConversionError(const IWebService::HttpRequestSuccessMessage& message) const {
--- a/Framework/Deprecated/Toolbox/OrthancSlicesLoader.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Toolbox/OrthancSlicesLoader.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -128,7 +128,7 @@ static Operation* DownloadInstanceGeometry(const std::string& instanceId) { - std::auto_ptr<Operation> operation(new Operation(Mode_InstanceGeometry)); + std::unique_ptr<Operation> operation(new Operation(Mode_InstanceGeometry)); operation->instanceId_ = instanceId; return operation.release(); } @@ -136,7 +136,7 @@ static Operation* DownloadFrameGeometry(const std::string& instanceId, unsigned int frame) { - std::auto_ptr<Operation> operation(new Operation(Mode_FrameGeometry)); + std::unique_ptr<Operation> operation(new Operation(Mode_FrameGeometry)); operation->instanceId_ = instanceId; operation->frame_ = frame; return operation.release(); @@ -146,7 +146,7 @@ const Slice& slice, SliceImageQuality quality) { - std::auto_ptr<Operation> tmp(new Operation(Mode_LoadImage)); + std::unique_ptr<Operation> tmp(new Operation(Mode_LoadImage)); tmp->sliceIndex_ = sliceIndex; tmp->slice_ = &slice; tmp->quality_ = quality; @@ -156,7 +156,7 @@ static Operation* DownloadSliceRawImage(unsigned int sliceIndex, const Slice& slice) { - std::auto_ptr<Operation> tmp(new Operation(Mode_LoadRawImage)); + std::unique_ptr<Operation> tmp(new Operation(Mode_LoadRawImage)); tmp->sliceIndex_ = sliceIndex; tmp->slice_ = &slice; tmp->quality_ = SliceImageQuality_InternalRaw; @@ -165,7 +165,7 @@ static Operation* DownloadDicomFile(const Slice& slice) { - std::auto_ptr<Operation> tmp(new Operation(Mode_LoadDicomFile)); + std::unique_ptr<Operation> tmp(new Operation(Mode_LoadDicomFile)); tmp->slice_ = &slice; return tmp.release(); } @@ -241,7 +241,7 @@ for (unsigned int frame = 0; frame < frames; frame++) { - std::auto_ptr<Slice> slice(new Slice); + std::unique_ptr<Slice> slice(new Slice); if (slice->ParseOrthancFrame(dicom, instances[i], frame)) { OrthancStone::CoordinateSystem3D geometry = slice->GetGeometry(); @@ -277,7 +277,7 @@ for (unsigned int frame = 0; frame < frames; frame++) { - std::auto_ptr<Slice> slice(new Slice); + std::unique_ptr<Slice> slice(new Slice); if (slice->ParseOrthancFrame(dicom, instanceId, frame)) { OrthancStone::CoordinateSystem3D geometry = slice->GetGeometry(); @@ -308,7 +308,7 @@ Orthanc::DicomMap dicom; MessagingToolbox::ConvertDataset(dicom, dataset); - std::auto_ptr<Slice> slice(new Slice); + std::unique_ptr<Slice> slice(new Slice); if (slice->ParseOrthancFrame(dicom, instanceId, frame)) { LOG(INFO) << "Loaded instance geometry " << instanceId; @@ -329,7 +329,7 @@ void OrthancSlicesLoader::ParseSliceImagePng(const OrthancApiClient::BinaryResponseReadyMessage& message) { const Operation& operation = dynamic_cast<const OrthancSlicesLoader::Operation&>(message.GetPayload()); - std::auto_ptr<Orthanc::ImageAccessor> image; + std::unique_ptr<Orthanc::ImageAccessor> image; try { @@ -369,7 +369,7 @@ void OrthancSlicesLoader::ParseSliceImagePam(const OrthancApiClient::BinaryResponseReadyMessage& message) { const Operation& operation = dynamic_cast<const OrthancSlicesLoader::Operation&>(message.GetPayload()); - std::auto_ptr<Orthanc::ImageAccessor> image; + std::unique_ptr<Orthanc::ImageAccessor> image; try { @@ -449,7 +449,7 @@ } } - std::auto_ptr<Orthanc::ImageAccessor> reader; + std::unique_ptr<Orthanc::ImageAccessor> reader; { std::string jpeg; @@ -536,7 +536,7 @@ } // Decode a grayscale JPEG 8bpp image coming from the Web viewer - std::auto_ptr<Orthanc::ImageAccessor> image + std::unique_ptr<Orthanc::ImageAccessor> image (new Orthanc::Image(expectedFormat, reader->GetWidth(), reader->GetHeight(), false)); Orthanc::ImageProcessing::Convert(*image, *reader); @@ -599,7 +599,7 @@ { // This is the case of RT-DOSE (uint32_t values) - std::auto_ptr<Orthanc::ImageAccessor> image + std::unique_ptr<Orthanc::ImageAccessor> image (new StringImage(Orthanc::PixelFormat_Grayscale32, info.GetWidth(), info.GetHeight(), raw)); @@ -623,7 +623,7 @@ info.GetPhotometricInterpretation() == Orthanc::PhotometricInterpretation_Monochrome2 && raw.size() == info.GetWidth() * info.GetHeight() * 2) { - std::auto_ptr<Orthanc::ImageAccessor> image + std::unique_ptr<Orthanc::ImageAccessor> image (new StringImage(Orthanc::PixelFormat_Grayscale16, info.GetWidth(), info.GetHeight(), raw));
--- a/Framework/Deprecated/Toolbox/ParallelSlices.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Toolbox/ParallelSlices.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -143,7 +143,7 @@ ParallelSlices* ParallelSlices::Reverse() const { - std::auto_ptr<ParallelSlices> reversed(new ParallelSlices); + std::unique_ptr<ParallelSlices> reversed(new ParallelSlices); for (size_t i = slices_.size(); i > 0; i--) { @@ -164,7 +164,7 @@ const OrthancStone::Vector dimensions = geometry.GetVoxelDimensions(OrthancStone::VolumeProjection_Axial); const OrthancStone::CoordinateSystem3D& axial = geometry.GetAxialGeometry(); - std::auto_ptr<ParallelSlices> result(new ParallelSlices); + std::unique_ptr<ParallelSlices> result(new ParallelSlices); switch (projection) {
--- a/Framework/Deprecated/Toolbox/ParallelSlicesCursor.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Toolbox/ParallelSlicesCursor.h Mon Mar 02 16:31:30 2020 +0100 @@ -24,12 +24,14 @@ #include "ParallelSlices.h" #include "../../StoneEnumerations.h" +#include <Core/Compatibility.h> + namespace Deprecated { class ParallelSlicesCursor : public boost::noncopyable { private: - std::auto_ptr<ParallelSlices> slices_; + std::unique_ptr<ParallelSlices> slices_; size_t currentSlice_; size_t GetDefaultSlice();
--- a/Framework/Deprecated/Toolbox/Slice.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Toolbox/Slice.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -48,7 +48,7 @@ Slice* Slice::Clone() const { - std::auto_ptr<Slice> target(new Slice()); + std::unique_ptr<Slice> target(new Slice()); target->type_ = type_; target->orthancInstanceId_ = orthancInstanceId_;
--- a/Framework/Deprecated/Toolbox/Slice.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Toolbox/Slice.h Mon Mar 02 16:31:30 2020 +0100 @@ -59,7 +59,7 @@ unsigned int height_; // TODO : Redundant with "imageInformation_" DicomFrameConverter converter_; // TODO : Partially redundant with "imageInformation_" - std::auto_ptr<Orthanc::DicomImageInformation> imageInformation_; + std::unique_ptr<Orthanc::DicomImageInformation> imageInformation_; public: Slice() :
--- a/Framework/Deprecated/Viewport/WidgetViewport.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Viewport/WidgetViewport.h Mon Mar 02 16:31:30 2020 +0100 @@ -24,6 +24,8 @@ #include "IViewport.h" #include "../Widgets/IWidget.h" +#include <Core/Compatibility.h> + #include <memory> namespace Deprecated @@ -31,9 +33,9 @@ class WidgetViewport : public IViewport { private: - std::auto_ptr<IWidget> centralWidget_; + std::unique_ptr<IWidget> centralWidget_; IStatusBar* statusBar_; - std::auto_ptr<IMouseTracker> mouseTracker_; + std::unique_ptr<IMouseTracker> mouseTracker_; bool isMouseOver_; int lastMouseX_; int lastMouseY_;
--- a/Framework/Deprecated/Volumes/StructureSetLoader.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Volumes/StructureSetLoader.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -122,7 +122,7 @@ const std::string uri = "/instances/" + instanceId + "/tags?ignore-length=3006-0050"; OrthancPlugins::FullOrthancDataset dataset(orthanc, uri); - std::auto_ptr<OrthancStone::DicomStructureSet> result + std::unique_ptr<OrthancStone::DicomStructureSet> result (new OrthancStone::DicomStructureSet(dataset)); std::set<std::string> instances;
--- a/Framework/Deprecated/Volumes/StructureSetLoader.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Volumes/StructureSetLoader.h Mon Mar 02 16:31:30 2020 +0100 @@ -25,6 +25,8 @@ #include "../Toolbox/OrthancApiClient.h" #include "IVolumeLoader.h" +#include <Core/Compatibility.h> + namespace Deprecated { class StructureSetLoader : @@ -33,7 +35,7 @@ { private: OrthancApiClient& orthanc_; - std::auto_ptr<OrthancStone::DicomStructureSet> structureSet_; + std::unique_ptr<OrthancStone::DicomStructureSet> structureSet_; void OnReferencedSliceLoaded(const OrthancApiClient::JsonResponseReadyMessage& message);
--- a/Framework/Deprecated/Widgets/LayoutWidget.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Widgets/LayoutWidget.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -31,7 +31,7 @@ class LayoutWidget::LayoutMouseTracker : public IMouseTracker { private: - std::auto_ptr<IMouseTracker> tracker_; + std::unique_ptr<IMouseTracker> tracker_; int left_; int top_; unsigned int width_; @@ -85,7 +85,7 @@ class LayoutWidget::ChildWidget : public boost::noncopyable { private: - std::auto_ptr<IWidget> widget_; + std::unique_ptr<IWidget> widget_; int left_; int top_; unsigned int width_;
--- a/Framework/Deprecated/Widgets/LayoutWidget.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Widgets/LayoutWidget.h Mon Mar 02 16:31:30 2020 +0100 @@ -38,7 +38,7 @@ bool isHorizontal_; unsigned int width_; unsigned int height_; - std::auto_ptr<IMouseTracker> mouseTracker_; + std::unique_ptr<IMouseTracker> mouseTracker_; unsigned int paddingLeft_; unsigned int paddingTop_; unsigned int paddingRight_;
--- a/Framework/Deprecated/Widgets/SliceViewerWidget.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Widgets/SliceViewerWidget.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -327,7 +327,7 @@ { LOG(INFO) << "Updating layer " << index; - std::auto_ptr<ILayerRenderer> tmp(renderer); + std::unique_ptr<ILayerRenderer> tmp(renderer); if (renderer == NULL) { @@ -357,7 +357,12 @@ !currentScene_->IsComplete() || pendingScene_->IsComplete()) { - currentScene_ = pendingScene_; +#if __cplusplus < 201103L + currentScene_.reset(pendingScene_.release()); +#else + currentScene_ = std::move(pendingScene_); +#endif + NotifyContentChanged(); } } @@ -518,7 +523,11 @@ (pendingScene_.get() != NULL && pendingScene_->IsComplete())) { - currentScene_ = pendingScene_; +#if __cplusplus < 201103L + currentScene_.reset(pendingScene_.release()); +#else + currentScene_ = std::move(pendingScene_); +#endif } plane_ = plane;
--- a/Framework/Deprecated/Widgets/SliceViewerWidget.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Widgets/SliceViewerWidget.h Mon Mar 02 16:31:30 2020 +0100 @@ -75,8 +75,8 @@ std::vector<IVolumeSlicer*> layers_; std::vector<RenderStyle> styles_; OrthancStone::CoordinateSystem3D plane_; - std::auto_ptr<Scene> currentScene_; - std::auto_ptr<Scene> pendingScene_; + std::unique_ptr<Scene> currentScene_; + std::unique_ptr<Scene> pendingScene_; std::vector<bool> changedLayers_; bool LookupLayer(size_t& index /* out */,
--- a/Framework/Deprecated/Widgets/TestWorldSceneWidget.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Widgets/TestWorldSceneWidget.h Mon Mar 02 16:31:30 2020 +0100 @@ -34,7 +34,7 @@ private: class Interactor; - std::auto_ptr<Interactor> interactor_; + std::unique_ptr<Interactor> interactor_; bool animate_; unsigned int count_;
--- a/Framework/Deprecated/Widgets/WorldSceneWidget.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Widgets/WorldSceneWidget.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -42,7 +42,7 @@ { private: ViewportGeometry view_; - std::auto_ptr<IWorldSceneMouseTracker> tracker_; + std::unique_ptr<IWorldSceneMouseTracker> tracker_; public: SceneMouseTracker(const ViewportGeometry& view, @@ -166,7 +166,7 @@ view_.MapPixelCenterToScene(sceneX, sceneY, x, y); // asks the Widget Interactor to provide a mouse tracker - std::auto_ptr<IWorldSceneMouseTracker> tracker; + std::unique_ptr<IWorldSceneMouseTracker> tracker; if (interactor_) {
--- a/Framework/Deprecated/dev.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/dev.h Mon Mar 02 16:31:30 2020 +0100 @@ -47,8 +47,8 @@ { private: OrthancSlicesLoader loader_; - std::auto_ptr<OrthancStone::ImageBuffer3D> image_; - std::auto_ptr<DownloadStack> downloadStack_; + std::unique_ptr<OrthancStone::ImageBuffer3D> image_; + std::unique_ptr<DownloadStack> downloadStack_; bool computeRange_; size_t pendingSlices_; @@ -521,9 +521,9 @@ OrthancVolumeImage& volume_; - std::auto_ptr<VolumeImageGeometry> axialGeometry_; - std::auto_ptr<VolumeImageGeometry> coronalGeometry_; - std::auto_ptr<VolumeImageGeometry> sagittalGeometry_; + std::unique_ptr<VolumeImageGeometry> axialGeometry_; + std::unique_ptr<VolumeImageGeometry> coronalGeometry_; + std::unique_ptr<VolumeImageGeometry> sagittalGeometry_; bool IsGeometryReady() const @@ -662,7 +662,7 @@ { // 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<Slice> slice(GetProjectionGeometry(projection).GetSlice(0)); + std::unique_ptr<Slice> slice(GetProjectionGeometry(projection).GetSlice(0)); slice->GetExtent(points); return true; @@ -684,7 +684,7 @@ { bool isFullQuality = true; // TODO - std::auto_ptr<Orthanc::Image> frame; + std::unique_ptr<Orthanc::Image> frame; { OrthancStone::ImageBuffer3D::SliceReader reader(volume_.GetImage(), projection, static_cast<unsigned int>(closest)); @@ -693,7 +693,7 @@ frame.reset(Orthanc::Image::Clone(reader.GetAccessor())); } - std::auto_ptr<Slice> slice(geometry.GetSlice(closest)); + std::unique_ptr<Slice> slice(geometry.GetSlice(closest)); RendererFactory factory(*frame, *slice, isFullQuality); @@ -716,7 +716,7 @@ private: SliceViewerWidget& widget_; OrthancStone::VolumeProjection projection_; - std::auto_ptr<VolumeImageGeometry> slices_; + std::unique_ptr<VolumeImageGeometry> slices_; size_t slice_; protected: @@ -858,7 +858,7 @@ { slice_ = slice; - std::auto_ptr<Slice> tmp(slices_->GetSlice(slice_)); + std::unique_ptr<Slice> tmp(slices_->GetSlice(slice_)); widget_.SetSlice(tmp->GetGeometry()); } }
--- a/Framework/Fonts/FontRenderer.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Fonts/FontRenderer.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -141,7 +141,7 @@ face_->glyph->bitmap.pitch, face_->glyph->bitmap.buffer); - std::auto_ptr<Glyph> glyph( + std::unique_ptr<Glyph> glyph( new Glyph(bitmap.GetWidth(), bitmap.GetHeight(), face_->glyph->bitmap_left,
--- a/Framework/Fonts/Glyph.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Fonts/Glyph.h Mon Mar 02 16:31:30 2020 +0100 @@ -21,6 +21,7 @@ #pragma once +#include <Core/Compatibility.h> #include <Core/IDynamicObject.h> #include <memory> @@ -38,7 +39,7 @@ int advanceX_; unsigned int lineHeight_; - std::auto_ptr<Orthanc::IDynamicObject> payload_; + std::unique_ptr<Orthanc::IDynamicObject> payload_; public: // WARNING: This does not copy the payload
--- a/Framework/Fonts/GlyphAlphabet.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Fonts/GlyphAlphabet.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -43,12 +43,12 @@ const Glyph& glyph, Orthanc::IDynamicObject* payload) { - std::auto_ptr<Orthanc::IDynamicObject> protection(payload); + std::unique_ptr<Orthanc::IDynamicObject> protection(payload); // Don't add twice the same character if (content_.find(unicode) == content_.end()) { - std::auto_ptr<Glyph> raii(new Glyph(glyph)); + std::unique_ptr<Glyph> raii(new Glyph(glyph)); if (payload != NULL) { @@ -65,7 +65,7 @@ void GlyphAlphabet::Register(FontRenderer& renderer, uint32_t unicode) { - std::auto_ptr<Glyph> glyph(renderer.Render(unicode)); + std::unique_ptr<Glyph> glyph(renderer.Render(unicode)); if (glyph.get() != NULL) {
--- a/Framework/Fonts/GlyphBitmapAlphabet.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Fonts/GlyphBitmapAlphabet.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -98,7 +98,7 @@ { TextBoundingBox box(alphabet_, utf8); - std::auto_ptr<Orthanc::ImageAccessor> bitmap( + std::unique_ptr<Orthanc::ImageAccessor> bitmap( new Orthanc::Image(Orthanc::PixelFormat_Grayscale8, box.GetWidth(), box.GetHeight(), true /* force minimal pitch */));
--- a/Framework/Fonts/GlyphTextureAlphabet.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Fonts/GlyphTextureAlphabet.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -77,7 +77,7 @@ class GlyphTextureAlphabet::TextureGenerator : public GlyphAlphabet::IGlyphVisitor { private: - std::auto_ptr<Orthanc::ImageAccessor> texture_; + std::unique_ptr<Orthanc::ImageAccessor> texture_; unsigned int countColumns_; unsigned int countRows_; @@ -289,7 +289,7 @@ { TextBoundingBox box(alphabet_, utf8); - std::auto_ptr<Orthanc::ImageAccessor> bitmap( + std::unique_ptr<Orthanc::ImageAccessor> bitmap( new Orthanc::Image(Orthanc::PixelFormat_RGBA32, box.GetWidth(), box.GetHeight(), true /* force minimal pitch */));
--- a/Framework/Fonts/GlyphTextureAlphabet.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Fonts/GlyphTextureAlphabet.h Mon Mar 02 16:31:30 2020 +0100 @@ -61,7 +61,7 @@ class RenderTextVisitor; GlyphAlphabet alphabet_; - std::auto_ptr<Orthanc::ImageAccessor> texture_; + std::unique_ptr<Orthanc::ImageAccessor> texture_; unsigned int textureWidth_; unsigned int textureHeight_;
--- a/Framework/Loaders/BasicFetchingStrategy.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Loaders/BasicFetchingStrategy.h Mon Mar 02 16:31:30 2020 +0100 @@ -24,6 +24,8 @@ #include "IFetchingItemsSorter.h" #include "IFetchingStrategy.h" +#include <Core/Compatibility.h> + #include <memory> namespace OrthancStone @@ -56,7 +58,7 @@ } }; - std::auto_ptr<IFetchingItemsSorter> sorter_; + std::unique_ptr<IFetchingItemsSorter> sorter_; std::vector<unsigned int> nextQuality_; unsigned int maxQuality_; std::vector<ContentItem> content_;
--- a/Framework/Loaders/DicomStructureSetLoader.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Loaders/DicomStructureSetLoader.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -140,7 +140,7 @@ const std::string instanceId = lookup[0]["ID"].asString(); { - std::auto_ptr<OrthancRestApiCommand> command(new OrthancRestApiCommand); + std::unique_ptr<OrthancRestApiCommand> command(new OrthancRestApiCommand); command->SetHttpHeader("Accept-Encoding", "gzip"); std::string uri = "/instances/" + instanceId + "/tags"; command->SetUri(uri); @@ -227,7 +227,7 @@ for (std::set<std::string>::const_iterator it = nonEmptyInstances.begin(); it != nonEmptyInstances.end(); ++it) { - std::auto_ptr<OrthancRestApiCommand> command(new OrthancRestApiCommand); + std::unique_ptr<OrthancRestApiCommand> command(new OrthancRestApiCommand); command->SetUri("/tools/lookup"); command->SetMethod(Orthanc::HttpMethod_Post); command->SetBody(*it); @@ -292,7 +292,7 @@ { assert(isValid_); - std::auto_ptr<PolylineSceneLayer> layer(new PolylineSceneLayer); + std::unique_ptr<PolylineSceneLayer> layer(new PolylineSceneLayer); layer->SetThickness(2); for (size_t i = 0; i < content_.GetStructuresCount(); i++) @@ -377,7 +377,7 @@ initiallyVisibleStructures_ = initiallyVisibleStructures; { - std::auto_ptr<OrthancRestApiCommand> command(new OrthancRestApiCommand); + std::unique_ptr<OrthancRestApiCommand> command(new OrthancRestApiCommand); command->SetHttpHeader("Accept-Encoding", "gzip"); std::string uri = "/instances/" + instanceId + "/tags?ignore-length=3006-0050";
--- a/Framework/Loaders/DicomStructureSetLoader.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Loaders/DicomStructureSetLoader.h Mon Mar 02 16:31:30 2020 +0100 @@ -42,7 +42,7 @@ class LookupInstance; // 2nd state class LoadStructure; // 1st state - std::auto_ptr<DicomStructureSet> content_; + std::unique_ptr<DicomStructureSet> content_; uint64_t revision_; std::string instanceId_; unsigned int countProcessedInstances_;
--- a/Framework/Loaders/DicomStructureSetLoader2.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Loaders/DicomStructureSetLoader2.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -81,7 +81,7 @@ void DicomStructureSetLoader2::LoadInstance(const std::string& instanceId) { - std::auto_ptr<OrthancRestApiCommand> command(new OrthancRestApiCommand); + std::unique_ptr<OrthancRestApiCommand> command(new OrthancRestApiCommand); command->SetHttpHeader("Accept-Encoding", "gzip"); std::string uri = "/instances/" + instanceId + "/tags?ignore-length=3006-0050";
--- a/Framework/Loaders/LoaderStateMachine.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Loaders/LoaderStateMachine.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -47,7 +47,7 @@ { LOG(TRACE) << "LoaderStateMachine(" << std::hex << this << std::dec << ")::Schedule()"; - std::auto_ptr<OracleCommandWithPayload> protection(command); + std::unique_ptr<OracleCommandWithPayload> protection(command); if (command == NULL) {
--- a/Framework/Loaders/OrthancMultiframeVolumeLoader.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Loaders/OrthancMultiframeVolumeLoader.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -29,7 +29,7 @@ class OrthancMultiframeVolumeLoader::LoadRTDoseGeometry : public LoaderStateMachine::State { private: - std::auto_ptr<Orthanc::DicomMap> dicom_; + std::unique_ptr<Orthanc::DicomMap> dicom_; public: LoadRTDoseGeometry(OrthancMultiframeVolumeLoader& that, @@ -90,7 +90,7 @@ throw Orthanc::OrthancException(Orthanc::ErrorCode_NetworkProtocol); } - std::auto_ptr<Orthanc::DicomMap> dicom(new Orthanc::DicomMap); + std::unique_ptr<Orthanc::DicomMap> dicom(new Orthanc::DicomMap); dicom->FromDicomAsJson(body); if (StringToSopClassUid(GetSopClassUid(*dicom)) == SopClassUid_RTDose) @@ -98,7 +98,7 @@ // Download the "Grid Frame Offset Vector" DICOM tag, that is // mandatory for RT-DOSE, but is too long to be returned by default - std::auto_ptr<OrthancRestApiCommand> command(new OrthancRestApiCommand); + std::unique_ptr<OrthancRestApiCommand> command(new OrthancRestApiCommand); command->SetUri("/instances/" + loader.GetInstanceId() + "/content/" + Orthanc::DICOM_TAG_GRID_FRAME_OFFSET_VECTOR.Format()); command->SetPayload(new LoadRTDoseGeometry(loader, dicom.release())); @@ -171,7 +171,7 @@ transferSyntaxUid_ == "1.2.840.10008.1.2.1" || transferSyntaxUid_ == "1.2.840.10008.1.2.2") { - std::auto_ptr<OrthancRestApiCommand> command(new OrthancRestApiCommand); + std::unique_ptr<OrthancRestApiCommand> command(new OrthancRestApiCommand); command->SetHttpHeader("Accept-Encoding", "gzip"); command->SetUri("/instances/" + instanceId_ + "/content/" + Orthanc::DICOM_TAG_PIXEL_DATA.Format() + "/0"); @@ -563,7 +563,7 @@ instanceId_ = instanceId; { - std::auto_ptr<OrthancRestApiCommand> command(new OrthancRestApiCommand); + std::unique_ptr<OrthancRestApiCommand> command(new OrthancRestApiCommand); command->SetHttpHeader("Accept-Encoding", "gzip"); command->SetUri("/instances/" + instanceId + "/tags"); command->SetPayload(new LoadGeometry(*this)); @@ -571,7 +571,7 @@ } { - std::auto_ptr<OrthancRestApiCommand> command(new OrthancRestApiCommand); + std::unique_ptr<OrthancRestApiCommand> command(new OrthancRestApiCommand); command->SetUri("/instances/" + instanceId + "/metadata/TransferSyntax"); command->SetPayload(new LoadTransferSyntax(*this)); Schedule(command.release());
--- a/Framework/Loaders/OrthancSeriesVolumeProgressiveLoader.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Loaders/OrthancSeriesVolumeProgressiveLoader.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -261,11 +261,11 @@ throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError); } - std::auto_ptr<OracleCommandWithPayload> command; + std::unique_ptr<OracleCommandWithPayload> command; if (quality == BEST_QUALITY) { - std::auto_ptr<GetOrthancImageCommand> tmp(new GetOrthancImageCommand); + std::unique_ptr<GetOrthancImageCommand> tmp(new GetOrthancImageCommand); // TODO: review the following comment. // - Commented out by bgo on 2019-07-19 | reason: Alain has seen cases // where gzipping the uint16 image took 11 sec to produce 5mb. @@ -281,7 +281,7 @@ } else { - std::auto_ptr<GetOrthancWebViewerJpegCommand> tmp(new GetOrthancWebViewerJpegCommand); + std::unique_ptr<GetOrthancWebViewerJpegCommand> tmp(new GetOrthancWebViewerJpegCommand); // TODO: review the following comment. Commented out by bgo on 2019-07-19 // (gzip for jpeg seems overkill) //tmp->SetHttpHeader("Accept-Encoding", "gzip"); @@ -325,7 +325,7 @@ Orthanc::DicomMap dicom; dicom.FromDicomAsJson(body[instances[i]]); - std::auto_ptr<DicomInstanceParameters> instance(new DicomInstanceParameters(dicom)); + std::unique_ptr<DicomInstanceParameters> instance(new DicomInstanceParameters(dicom)); instance->SetOrthancInstanceIdentifier(instances[i]); // the 3D plane corresponding to the slice @@ -481,7 +481,7 @@ { active_ = true; - std::auto_ptr<OrthancRestApiCommand> command(new OrthancRestApiCommand); + std::unique_ptr<OrthancRestApiCommand> command(new OrthancRestApiCommand); command->SetUri("/series/" + seriesId + "/instances-tags"); // LOG(TRACE) << "OrthancSeriesVolumeProgressiveLoader::LoadSeries about to call oracle_.Schedule";
--- a/Framework/Loaders/OrthancSeriesVolumeProgressiveLoader.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Loaders/OrthancSeriesVolumeProgressiveLoader.h Mon Mar 02 16:31:30 2020 +0100 @@ -67,7 +67,7 @@ void CheckSliceIndex(size_t index) const; - std::auto_ptr<VolumeImageGeometry> geometry_; + std::unique_ptr<VolumeImageGeometry> geometry_; std::vector<DicomInstanceParameters*> slices_; std::vector<uint64_t> slicesRevision_; @@ -111,8 +111,8 @@ unsigned int simultaneousDownloads_; SeriesGeometry seriesGeometry_; boost::shared_ptr<DicomVolumeImage> volume_; - std::auto_ptr<IFetchingItemsSorter::IFactory> sorter_; - std::auto_ptr<IFetchingStrategy> strategy_; + std::unique_ptr<IFetchingItemsSorter::IFactory> sorter_; + std::unique_ptr<IFetchingStrategy> strategy_; std::vector<unsigned int> slicesQuality_; bool volumeImageReadyInHighQuality_;
--- a/Framework/Oracle/GetOrthancImageCommand.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Oracle/GetOrthancImageCommand.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -102,7 +102,7 @@ } } - std::auto_ptr<Orthanc::ImageAccessor> image; + std::unique_ptr<Orthanc::ImageAccessor> image; switch (contentType) {
--- a/Framework/Oracle/GetOrthancImageCommand.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Oracle/GetOrthancImageCommand.h Mon Mar 02 16:31:30 2020 +0100 @@ -40,7 +40,7 @@ ORTHANC_STONE_MESSAGE(__FILE__, __LINE__); private: - std::auto_ptr<Orthanc::ImageAccessor> image_; + std::unique_ptr<Orthanc::ImageAccessor> image_; Orthanc::MimeType mime_; public:
--- a/Framework/Oracle/GetOrthancWebViewerJpegCommand.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Oracle/GetOrthancWebViewerJpegCommand.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -126,7 +126,7 @@ } } - std::auto_ptr<Orthanc::ImageAccessor> reader; + std::unique_ptr<Orthanc::ImageAccessor> reader; { std::string jpeg; @@ -197,7 +197,7 @@ } // Decode a grayscale JPEG 8bpp image coming from the Web viewer - std::auto_ptr<Orthanc::ImageAccessor> image + std::unique_ptr<Orthanc::ImageAccessor> image (new Orthanc::Image(expectedFormat_, reader->GetWidth(), reader->GetHeight(), false)); Orthanc::ImageProcessing::Convert(*image, *reader);
--- a/Framework/Oracle/GetOrthancWebViewerJpegCommand.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Oracle/GetOrthancWebViewerJpegCommand.h Mon Mar 02 16:31:30 2020 +0100 @@ -40,7 +40,7 @@ ORTHANC_STONE_MESSAGE(__FILE__, __LINE__); private: - std::auto_ptr<Orthanc::ImageAccessor> image_; + std::unique_ptr<Orthanc::ImageAccessor> image_; public: SuccessMessage(const GetOrthancWebViewerJpegCommand& command,
--- a/Framework/Oracle/OracleCommandWithPayload.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Oracle/OracleCommandWithPayload.h Mon Mar 02 16:31:30 2020 +0100 @@ -23,6 +23,7 @@ #include "IOracleCommand.h" +#include <Core/Compatibility.h> #include <Core/IDynamicObject.h> #include <memory> @@ -32,7 +33,7 @@ class OracleCommandWithPayload : public IOracleCommand { private: - std::auto_ptr<Orthanc::IDynamicObject> payload_; + std::unique_ptr<Orthanc::IDynamicObject> payload_; public: void SetPayload(Orthanc::IDynamicObject* payload);
--- a/Framework/Oracle/ThreadedOracle.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Oracle/ThreadedOracle.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -40,7 +40,7 @@ { private: const IObserver& receiver_; - std::auto_ptr<IOracleCommand> command_; + std::unique_ptr<IOracleCommand> command_; public: Item(const IObserver& receiver, @@ -74,7 +74,7 @@ { private: const IObserver& receiver_; - std::auto_ptr<SleepOracleCommand> command_; + std::unique_ptr<SleepOracleCommand> command_; boost::posix_time::ptime expiration_; public: @@ -310,7 +310,7 @@ void ThreadedOracle::Step() { - std::auto_ptr<Orthanc::IDynamicObject> object(queue_.Dequeue(100)); + std::unique_ptr<Orthanc::IDynamicObject> object(queue_.Dequeue(100)); if (object.get() != NULL) { @@ -324,7 +324,7 @@ { SleepOracleCommand& command = dynamic_cast<SleepOracleCommand&>(item.GetCommand()); - std::auto_ptr<SleepOracleCommand> copy(new SleepOracleCommand(command.GetDelay())); + std::unique_ptr<SleepOracleCommand> copy(new SleepOracleCommand(command.GetDelay())); if (command.HasPayload()) {
--- a/Framework/Oracle/WebAssemblyOracle.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Oracle/WebAssemblyOracle.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -43,7 +43,7 @@ private: WebAssemblyOracle& oracle_; const IObserver& receiver_; - std::auto_ptr<SleepOracleCommand> command_; + std::unique_ptr<SleepOracleCommand> command_; public: TimeoutContext(WebAssemblyOracle& oracle, @@ -70,7 +70,7 @@ static void Callback(void *userData) { - std::auto_ptr<TimeoutContext> context(reinterpret_cast<TimeoutContext*>(userData)); + std::unique_ptr<TimeoutContext> context(reinterpret_cast<TimeoutContext*>(userData)); context->EmitMessage(); } }; @@ -110,7 +110,7 @@ private: Emitter emitter_; const IObserver& receiver_; - std::auto_ptr<IOracleCommand> command_; + std::unique_ptr<IOracleCommand> command_; std::string expectedContentType_; int64_t receiverFingerprint_; @@ -213,7 +213,7 @@ * free data associated with the fetch. **/ - std::auto_ptr<FetchContext> context(reinterpret_cast<FetchContext*>(fetch->userData)); + std::unique_ptr<FetchContext> context(reinterpret_cast<FetchContext*>(fetch->userData)); // an UUID is 36 chars : 32 hex chars + 4 hyphens: char #0 --> char #35 // char #36 is \0. @@ -352,7 +352,7 @@ static void FailureCallback(emscripten_fetch_t *fetch) { - std::auto_ptr<FetchContext> context(reinterpret_cast<FetchContext*>(fetch->userData)); + std::unique_ptr<FetchContext> context(reinterpret_cast<FetchContext*>(fetch->userData)); { const size_t kEmscriptenStatusTextSize = sizeof(emscripten_fetch_t::statusText); @@ -389,7 +389,7 @@ private: WebAssemblyOracle& oracle_; const IObserver& receiver_; - std::auto_ptr<IOracleCommand> command_; + std::unique_ptr<IOracleCommand> command_; Orthanc::HttpMethod method_; std::string url_; std::string body_; @@ -702,7 +702,7 @@ << std::hex << &receiver << std::dec << " | Current fingerprint is " << receiver.GetFingerprint(); - std::auto_ptr<IOracleCommand> protection(command); + std::unique_ptr<IOracleCommand> protection(command); if (command == NULL) {
--- a/Framework/Radiography/RadiographyAlphaLayer.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Radiography/RadiographyAlphaLayer.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -23,8 +23,10 @@ #include "RadiographyScene.h" +#include <Core/Compatibility.h> #include <Core/Images/Image.h> #include <Core/OrthancException.h> + #include "../Toolbox/ImageGeometry.h" namespace OrthancStone @@ -32,7 +34,7 @@ void RadiographyAlphaLayer::SetAlpha(Orthanc::ImageAccessor* image) { - std::auto_ptr<Orthanc::ImageAccessor> raii(image); + std::unique_ptr<Orthanc::ImageAccessor> raii(image); if (image == NULL) { @@ -45,7 +47,12 @@ } SetSize(image->GetWidth(), image->GetHeight()); - alpha_ = raii; + +#if __cplusplus < 201103L + alpha_.reset(raii.release()); +#else + alpha_ = std::move(raii); +#endif BroadcastMessage(RadiographyLayer::LayerEditedMessage(*this)); }
--- a/Framework/Radiography/RadiographyAlphaLayer.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Radiography/RadiographyAlphaLayer.h Mon Mar 02 16:31:30 2020 +0100 @@ -23,6 +23,8 @@ #include "RadiographyLayer.h" +#include <Core/Compatibility.h> + namespace OrthancStone { class RadiographyScene; @@ -33,7 +35,7 @@ class RadiographyAlphaLayer : public RadiographyLayer { private: - std::auto_ptr<Orthanc::ImageAccessor> alpha_; // Grayscale8 in the range [0, 255] 0 = transparent, 255 = opaque -> the foreground value will be displayed + std::unique_ptr<Orthanc::ImageAccessor> alpha_; // Grayscale8 in the range [0, 255] 0 = transparent, 255 = opaque -> the foreground value will be displayed float foreground_; // in the range [0.0, 65535.0] public:
--- a/Framework/Radiography/RadiographyDicomLayer.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Radiography/RadiographyDicomLayer.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -97,7 +97,7 @@ void RadiographyDicomLayer::SetSourceImage(Orthanc::ImageAccessor* image) // Takes ownership { - std::auto_ptr<Orthanc::ImageAccessor> raii(image); + std::unique_ptr<Orthanc::ImageAccessor> raii(image); if (image == NULL) { @@ -106,7 +106,12 @@ SetSize(image->GetWidth(), image->GetHeight()); - source_ = raii; +#if __cplusplus < 201103L + source_.reset(raii.release()); +#else + source_ = std::move(raii); +#endif + ApplyConverter(); BroadcastMessage(RadiographyLayer::LayerEditedMessage(*this)); @@ -114,7 +119,7 @@ void RadiographyDicomLayer::SetSourceImage(Orthanc::ImageAccessor* image, double newPixelSpacingX, double newPixelSpacingY, bool emitLayerEditedEvent) // Takes ownership { - std::auto_ptr<Orthanc::ImageAccessor> raii(image); + std::unique_ptr<Orthanc::ImageAccessor> raii(image); if (image == NULL) { @@ -123,7 +128,12 @@ SetSize(image->GetWidth(), image->GetHeight(), false); - source_ = raii; +#if __cplusplus < 201103L + source_.reset(raii.release()); +#else + source_ = std::move(raii); +#endif + ApplyConverter(); SetPixelSpacing(newPixelSpacingX, newPixelSpacingY, false);
--- a/Framework/Radiography/RadiographyDicomLayer.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Radiography/RadiographyDicomLayer.h Mon Mar 02 16:31:30 2020 +0100 @@ -33,9 +33,9 @@ class RadiographyDicomLayer : public RadiographyLayer { private: - std::auto_ptr<Orthanc::ImageAccessor> source_; // Content of PixelData - std::auto_ptr<Deprecated::DicomFrameConverter> converter_; - std::auto_ptr<Orthanc::ImageAccessor> converted_; // Float32 + std::unique_ptr<Orthanc::ImageAccessor> source_; // Content of PixelData + std::unique_ptr<Deprecated::DicomFrameConverter> converter_; + std::unique_ptr<Orthanc::ImageAccessor> converted_; // Float32 std::string instanceId_; unsigned int frame_;
--- a/Framework/Radiography/RadiographyMaskLayer.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Radiography/RadiographyMaskLayer.h Mon Mar 02 16:31:30 2020 +0100 @@ -22,8 +22,10 @@ #pragma once #include "RadiographyLayer.h" -#include "Core/Images/Image.h" -#include "Core/Images/ImageProcessing.h" + +#include <Core/Compatibility.h> +#include <Core/Images/Image.h> +#include <Core/Images/ImageProcessing.h> namespace OrthancStone { @@ -38,7 +40,7 @@ mutable bool invalidated_; float foreground_; - mutable std::auto_ptr<Orthanc::ImageAccessor> mask_; + mutable std::unique_ptr<Orthanc::ImageAccessor> mask_; public: RadiographyMaskLayer(MessageBroker& broker, const RadiographyScene& scene, const RadiographyDicomLayer& dicomLayer, float foreground) :
--- a/Framework/Radiography/RadiographyScene.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Radiography/RadiographyScene.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -127,7 +127,7 @@ void RadiographyScene::_RegisterLayer(RadiographyLayer* layer) { - std::auto_ptr<RadiographyLayer> raii(layer); + std::unique_ptr<RadiographyLayer> raii(layer); // LOG(INFO) << "Registering layer: " << countLayers_; @@ -325,7 +325,7 @@ RadiographyLayer::Geometry* centerGeometry, bool isCenterGeometry) { - std::auto_ptr<RadiographyTextLayer> alpha(new RadiographyTextLayer(IObservable::GetBroker(), *this)); + std::unique_ptr<RadiographyTextLayer> alpha(new RadiographyTextLayer(IObservable::GetBroker(), *this)); alpha->SetText(utf8, font, fontSize, foreground); if (centerGeometry != NULL) { @@ -353,7 +353,7 @@ unsigned int height, RadiographyLayer::Geometry* geometry) { - std::auto_ptr<Orthanc::Image> block(new Orthanc::Image(Orthanc::PixelFormat_Grayscale8, width, height, false)); + std::unique_ptr<Orthanc::Image> block(new Orthanc::Image(Orthanc::PixelFormat_Grayscale8, width, height, false)); for (unsigned int padding = 0; (width > 2 * padding) && (height > 2 * padding); @@ -382,7 +382,7 @@ float foreground, RadiographyLayer::Geometry* geometry) { - std::auto_ptr<RadiographyMaskLayer> mask(new RadiographyMaskLayer(IObservable::GetBroker(), *this, dicomLayer, foreground)); + std::unique_ptr<RadiographyMaskLayer> mask(new RadiographyMaskLayer(IObservable::GetBroker(), *this, dicomLayer, foreground)); mask->SetCorners(corners); if (geometry != NULL) { @@ -395,7 +395,7 @@ RadiographyLayer& RadiographyScene::LoadAlphaBitmap(Orthanc::ImageAccessor* bitmap, RadiographyLayer::Geometry *geometry) { - std::auto_ptr<RadiographyAlphaLayer> alpha(new RadiographyAlphaLayer(IObservable::GetBroker(), *this)); + std::unique_ptr<RadiographyAlphaLayer> alpha(new RadiographyAlphaLayer(IObservable::GetBroker(), *this)); alpha->SetAlpha(bitmap); if (geometry != NULL) { @@ -534,7 +534,7 @@ content.assign(reinterpret_cast<const char*>(message.GetAnswer()), message.GetAnswerSize()); } - std::auto_ptr<Orthanc::PamReader> reader(new Orthanc::PamReader); + std::unique_ptr<Orthanc::PamReader> reader(new Orthanc::PamReader); reader->ReadFromMemory(content); dynamic_cast<RadiographyDicomLayer*>(layer->second)->SetSourceImage(reader.release()); @@ -725,7 +725,7 @@ Render(layers, view, interpolation, applyWindowing); - std::auto_ptr<Orthanc::Image> rendered(new Orthanc::Image(Orthanc::PixelFormat_Grayscale16, + std::unique_ptr<Orthanc::Image> rendered(new Orthanc::Image(Orthanc::PixelFormat_Grayscale16, layers.GetWidth(), layers.GetHeight(), false)); Orthanc::ImageProcessing::Convert(*rendered, layers); @@ -746,7 +746,7 @@ { LOG(INFO) << "Exporting RadiographyScene to DICOM"; - std::auto_ptr<Orthanc::Image> rendered(ExportToImage(pixelSpacingX, pixelSpacingY, interpolation, false)); // note: we don't invert the image in the pixels data because we'll set the PhotometricDisplayMode correctly in the DICOM tags + std::unique_ptr<Orthanc::Image> rendered(ExportToImage(pixelSpacingX, pixelSpacingY, interpolation, false)); // note: we don't invert the image in the pixels data because we'll set the PhotometricDisplayMode correctly in the DICOM tags createDicomRequestContent["Tags"] = dicomTags; @@ -801,7 +801,7 @@ LOG(INFO) << "Exporting RadiographyScene to DICOM"; VLOG(1) << "Exporting RadiographyScene to: export to image"; - std::auto_ptr<Orthanc::Image> rendered(ExportToCreateDicomRequestAndImage(createDicomRequestContent, dicomTags, parentOrthancId, pixelSpacingX, pixelSpacingY, invert, interpolation)); + std::unique_ptr<Orthanc::Image> rendered(ExportToCreateDicomRequestAndImage(createDicomRequestContent, dicomTags, parentOrthancId, pixelSpacingX, pixelSpacingY, invert, interpolation)); // convert the image into base64 for inclusing in the createDicomRequest std::string base64;
--- a/Framework/Radiography/RadiographySceneReader.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Radiography/RadiographySceneReader.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -55,7 +55,7 @@ RadiographyDicomLayer* RadiographySceneGeometryReader::LoadDicom(const std::string& instanceId, unsigned int frame, RadiographyLayer::Geometry* geometry) { - std::auto_ptr<RadiographyPlaceholderLayer> layer(new RadiographyPlaceholderLayer(dynamic_cast<IObservable&>(scene_).GetBroker(), scene_)); + std::unique_ptr<RadiographyPlaceholderLayer> layer(new RadiographyPlaceholderLayer(dynamic_cast<IObservable&>(scene_).GetBroker(), scene_)); layer->SetGeometry(*geometry); layer->SetSize(dicomImageWidth_, dicomImageHeight_); scene_.RegisterLayer(layer.get()); @@ -119,7 +119,7 @@ std::string mimeType; Orthanc::Toolbox::DecodeDataUriScheme(mimeType, pngContent, pngContentBase64); - std::auto_ptr<Orthanc::ImageAccessor> image; + std::unique_ptr<Orthanc::ImageAccessor> image; if (mimeType == "image/png") { image.reset(new Orthanc::PngReader());
--- a/Framework/Radiography/RadiographySceneReader.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Radiography/RadiographySceneReader.h Mon Mar 02 16:31:30 2020 +0100 @@ -52,8 +52,8 @@ { protected: RadiographyScene& scene_; - std::auto_ptr<Orthanc::ImageAccessor> dicomImage_; - std::auto_ptr<Deprecated::DicomFrameConverter> dicomFrameConverter_; + std::unique_ptr<Orthanc::ImageAccessor> dicomImage_; + std::unique_ptr<Deprecated::DicomFrameConverter> dicomFrameConverter_; RadiographyPhotometricDisplayMode preferredPhotometricDisplayMode_; public:
--- a/Framework/Radiography/RadiographyWidget.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Radiography/RadiographyWidget.h Mon Mar 02 16:31:30 2020 +0100 @@ -39,8 +39,8 @@ private: boost::shared_ptr<RadiographyScene> scene_; - std::auto_ptr<Orthanc::ImageAccessor> floatBuffer_; - std::auto_ptr<CairoSurface> cairoBuffer_; + std::unique_ptr<Orthanc::ImageAccessor> floatBuffer_; + std::unique_ptr<CairoSurface> cairoBuffer_; bool invert_; ImageInterpolation interpolation_; bool hasSelection_;
--- a/Framework/Scene2D/CairoCompositor.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Scene2D/CairoCompositor.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -118,7 +118,7 @@ } else { - std::auto_ptr<GlyphBitmapAlphabet> protection(dict); + std::unique_ptr<GlyphBitmapAlphabet> protection(dict); Fonts::iterator found = fonts_.find(index); @@ -146,7 +146,7 @@ FontRenderer renderer; renderer.LoadFont(resource, fontSize); - std::auto_ptr<GlyphBitmapAlphabet> alphabet(new GlyphBitmapAlphabet); + std::unique_ptr<GlyphBitmapAlphabet> alphabet(new GlyphBitmapAlphabet); alphabet->LoadCodepage(renderer, codepage); SetFont(index, alphabet.release());
--- a/Framework/Scene2D/CairoCompositor.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Scene2D/CairoCompositor.h Mon Mar 02 16:31:30 2020 +0100 @@ -42,7 +42,7 @@ Fonts fonts_; // Only valid during a call to "Refresh()" - std::auto_ptr<CairoContext> context_; + std::unique_ptr<CairoContext> context_; virtual cairo_t* GetCairoContext() ORTHANC_OVERRIDE;
--- a/Framework/Scene2D/ColorTextureSceneLayer.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Scene2D/ColorTextureSceneLayer.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -42,7 +42,7 @@ ISceneLayer* ColorTextureSceneLayer::Clone() const { - std::auto_ptr<ColorTextureSceneLayer> cloned(new ColorTextureSceneLayer(GetTexture())); + std::unique_ptr<ColorTextureSceneLayer> cloned(new ColorTextureSceneLayer(GetTexture())); cloned->CopyParameters(*this); return cloned.release(); }
--- a/Framework/Scene2D/FloatTextureSceneLayer.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Scene2D/FloatTextureSceneLayer.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -33,7 +33,7 @@ inverted_(false) { { - std::auto_ptr<Orthanc::ImageAccessor> t( + std::unique_ptr<Orthanc::ImageAccessor> t( new Orthanc::Image(Orthanc::PixelFormat_Float32, texture.GetWidth(), texture.GetHeight(), @@ -118,7 +118,7 @@ ISceneLayer* FloatTextureSceneLayer::Clone() const { - std::auto_ptr<FloatTextureSceneLayer> cloned + std::unique_ptr<FloatTextureSceneLayer> cloned (new FloatTextureSceneLayer(GetTexture())); cloned->CopyParameters(*this);
--- a/Framework/Scene2D/GrayscaleStyleConfigurator.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Scene2D/GrayscaleStyleConfigurator.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -70,7 +70,7 @@ const Orthanc::ImageAccessor& frame, const DicomInstanceParameters& parameters) const { - std::auto_ptr<TextureBaseSceneLayer> layer(parameters.CreateTexture(frame)); + std::unique_ptr<TextureBaseSceneLayer> layer(parameters.CreateTexture(frame)); if (layer.get() == NULL || layer->GetTexture().GetFormat() != Orthanc::PixelFormat_Float32)
--- a/Framework/Scene2D/InfoPanelSceneLayer.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Scene2D/InfoPanelSceneLayer.h Mon Mar 02 16:31:30 2020 +0100 @@ -24,6 +24,7 @@ #include "ISceneLayer.h" #include "../StoneEnumerations.h" +#include <Core/Compatibility.h> #include <Core/Images/ImageAccessor.h> #include <memory> @@ -33,7 +34,7 @@ class InfoPanelSceneLayer : public ISceneLayer { private: - std::auto_ptr<Orthanc::ImageAccessor> texture_; + std::unique_ptr<Orthanc::ImageAccessor> texture_; BitmapAnchor anchor_; bool isLinearInterpolation_;
--- a/Framework/Scene2D/Internals/CairoBaseRenderer.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Scene2D/Internals/CairoBaseRenderer.h Mon Mar 02 16:31:30 2020 +0100 @@ -24,6 +24,8 @@ #include "ICairoContextProvider.h" #include "CompositorHelper.h" +#include <Core/Compatibility.h> + namespace OrthancStone { namespace Internals @@ -32,7 +34,7 @@ { private: ICairoContextProvider& target_; - std::auto_ptr<ISceneLayer> layer_; + std::unique_ptr<ISceneLayer> layer_; protected: template<typename T>
--- a/Framework/Scene2D/Internals/CairoTextRenderer.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Scene2D/Internals/CairoTextRenderer.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -32,7 +32,7 @@ const TextSceneLayer& layer) : CairoBaseRenderer(target, layer) { - std::auto_ptr<Orthanc::ImageAccessor> source(alphabet.RenderText(layer.GetText())); + std::unique_ptr<Orthanc::ImageAccessor> source(alphabet.RenderText(layer.GetText())); if (source.get() != NULL) {
--- a/Framework/Scene2D/Internals/CompositorHelper.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Scene2D/Internals/CompositorHelper.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -30,7 +30,7 @@ class CompositorHelper::Item : public boost::noncopyable { private: - std::auto_ptr<ILayerRenderer> renderer_; + std::unique_ptr<ILayerRenderer> renderer_; const ISceneLayer& layer_; uint64_t layerIdentifier_; uint64_t lastRevision_; @@ -103,7 +103,7 @@ content_.erase(found); } - std::auto_ptr<ILayerRenderer> renderer(factory_.Create(layer)); + std::unique_ptr<ILayerRenderer> renderer(factory_.Create(layer)); if (renderer.get() != NULL) {
--- a/Framework/Scene2D/Internals/OpenGLAdvancedPolylineRenderer.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Scene2D/Internals/OpenGLAdvancedPolylineRenderer.h Mon Mar 02 16:31:30 2020 +0100 @@ -34,7 +34,7 @@ private: OpenGL::IOpenGLContext& context_; OpenGLLinesProgram& program_; - std::auto_ptr<OpenGLLinesProgram::Data> data_; + std::unique_ptr<OpenGLLinesProgram::Data> data_; void LoadLayer(const PolylineSceneLayer& layer);
--- a/Framework/Scene2D/Internals/OpenGLColorTextureRenderer.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Scene2D/Internals/OpenGLColorTextureRenderer.h Mon Mar 02 16:31:30 2020 +0100 @@ -34,7 +34,7 @@ private: OpenGL::IOpenGLContext& context_; OpenGLColorTextureProgram& program_; - std::auto_ptr<OpenGL::OpenGLTexture> texture_; + std::unique_ptr<OpenGL::OpenGLTexture> texture_; AffineTransform2D layerTransform_; void LoadTexture(const ColorTextureSceneLayer& layer);
--- a/Framework/Scene2D/Internals/OpenGLFloatTextureRenderer.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Scene2D/Internals/OpenGLFloatTextureRenderer.h Mon Mar 02 16:31:30 2020 +0100 @@ -34,7 +34,7 @@ private: OpenGL::IOpenGLContext& context_; OpenGLFloatTextureProgram& program_; - std::auto_ptr<OpenGLFloatTextureProgram::Data> texture_; + std::unique_ptr<OpenGLFloatTextureProgram::Data> texture_; AffineTransform2D layerTransform_; float windowCenter_; float windowWidth_;
--- a/Framework/Scene2D/Internals/OpenGLInfoPanelRenderer.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Scene2D/Internals/OpenGLInfoPanelRenderer.h Mon Mar 02 16:31:30 2020 +0100 @@ -34,7 +34,7 @@ private: OpenGL::IOpenGLContext& context_; OpenGLColorTextureProgram& program_; - std::auto_ptr<OpenGL::OpenGLTexture> texture_; + std::unique_ptr<OpenGL::OpenGLTexture> texture_; BitmapAnchor anchor_; void LoadTexture(const InfoPanelSceneLayer& layer);
--- a/Framework/Scene2D/Internals/OpenGLLinesProgram.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Scene2D/Internals/OpenGLLinesProgram.h Mon Mar 02 16:31:30 2020 +0100 @@ -73,7 +73,7 @@ private: OpenGL::IOpenGLContext& context_; - std::auto_ptr<OpenGL::OpenGLProgram> program_; + std::unique_ptr<OpenGL::OpenGLProgram> program_; public: OpenGLLinesProgram(OpenGL::IOpenGLContext& context);
--- a/Framework/Scene2D/Internals/OpenGLLookupTableTextureRenderer.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Scene2D/Internals/OpenGLLookupTableTextureRenderer.h Mon Mar 02 16:31:30 2020 +0100 @@ -36,8 +36,8 @@ private: OpenGL::IOpenGLContext& context_; OpenGLColorTextureProgram& program_; - std::auto_ptr<OpenGL::OpenGLTexture> glTexture_; - std::auto_ptr<Orthanc::Image> texture_; + std::unique_ptr<OpenGL::OpenGLTexture> glTexture_; + std::unique_ptr<Orthanc::Image> texture_; AffineTransform2D layerTransform_; void LoadTexture(const LookupTableTextureSceneLayer& layer);
--- a/Framework/Scene2D/Internals/OpenGLTextProgram.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Scene2D/Internals/OpenGLTextProgram.h Mon Mar 02 16:31:30 2020 +0100 @@ -120,7 +120,7 @@ private: OpenGL::IOpenGLContext& context_; - std::auto_ptr<OpenGL::OpenGLProgram> program_; + std::unique_ptr<OpenGL::OpenGLProgram> program_; GLint positionLocation_; GLint textureLocation_;
--- a/Framework/Scene2D/Internals/OpenGLTextRenderer.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Scene2D/Internals/OpenGLTextRenderer.h Mon Mar 02 16:31:30 2020 +0100 @@ -35,7 +35,7 @@ OpenGLTextProgram& program_; const GlyphTextureAlphabet& alphabet_; OpenGL::OpenGLTexture& texture_; - std::auto_ptr<OpenGLTextProgram::Data> data_; + std::unique_ptr<OpenGLTextProgram::Data> data_; void LoadLayer(const TextSceneLayer& layer);
--- a/Framework/Scene2D/Internals/OpenGLTextureProgram.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Scene2D/Internals/OpenGLTextureProgram.h Mon Mar 02 16:31:30 2020 +0100 @@ -26,6 +26,8 @@ #include "../../OpenGL/OpenGLTexture.h" #include "../../Toolbox/AffineTransform2D.h" +#include <Core/Compatibility.h> + namespace OrthancStone { namespace Internals @@ -34,7 +36,7 @@ { private: OpenGL::IOpenGLContext& context_; - std::auto_ptr<OpenGL::OpenGLProgram> program_; + std::unique_ptr<OpenGL::OpenGLProgram> program_; GLint positionLocation_; GLint textureLocation_; GLuint buffers_[2];
--- a/Framework/Scene2D/LookupTableTextureSceneLayer.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Scene2D/LookupTableTextureSceneLayer.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -30,7 +30,7 @@ LookupTableTextureSceneLayer::LookupTableTextureSceneLayer(const Orthanc::ImageAccessor& texture) { { - std::auto_ptr<Orthanc::ImageAccessor> t( + std::unique_ptr<Orthanc::ImageAccessor> t( new Orthanc::Image(Orthanc::PixelFormat_Float32, texture.GetWidth(), texture.GetHeight(), @@ -146,7 +146,7 @@ ISceneLayer* LookupTableTextureSceneLayer::Clone() const { - std::auto_ptr<LookupTableTextureSceneLayer> cloned + std::unique_ptr<LookupTableTextureSceneLayer> cloned (new LookupTableTextureSceneLayer(GetTexture()));
--- a/Framework/Scene2D/OpenGLCompositor.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Scene2D/OpenGLCompositor.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -33,8 +33,8 @@ class OpenGLCompositor::Font : public boost::noncopyable { private: - std::auto_ptr<GlyphTextureAlphabet> alphabet_; - std::auto_ptr<OpenGL::OpenGLTexture> texture_; + std::unique_ptr<GlyphTextureAlphabet> alphabet_; + std::unique_ptr<OpenGL::OpenGLTexture> texture_; public: Font(OpenGL::IOpenGLContext& context, const GlyphBitmapAlphabet& dict) @@ -42,7 +42,7 @@ alphabet_.reset(new GlyphTextureAlphabet(dict)); texture_.reset(new OpenGL::OpenGLTexture(context)); - std::auto_ptr<Orthanc::ImageAccessor> bitmap(alphabet_->ReleaseTexture()); + std::unique_ptr<Orthanc::ImageAccessor> bitmap(alphabet_->ReleaseTexture()); texture_->Load(*bitmap, true /* enable linear interpolation */); } @@ -181,7 +181,7 @@ { context_.MakeCurrent(); // this can throw if context lost - std::auto_ptr<Font> font(new Font(context_, dict)); + std::unique_ptr<Font> font(new Font(context_, dict)); Fonts::iterator found = fonts_.find(index);
--- a/Framework/Scene2D/PolylineSceneLayer.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Scene2D/PolylineSceneLayer.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -35,7 +35,7 @@ ISceneLayer* PolylineSceneLayer::Clone() const { - std::auto_ptr<PolylineSceneLayer> cloned(new PolylineSceneLayer); + std::unique_ptr<PolylineSceneLayer> cloned(new PolylineSceneLayer); cloned->Copy(*this); return cloned.release(); }
--- a/Framework/Scene2D/Scene2D.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Scene2D/Scene2D.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -29,7 +29,7 @@ class Scene2D::Item { private: - std::auto_ptr<ISceneLayer> layer_; + std::unique_ptr<ISceneLayer> layer_; uint64_t identifier_; public: @@ -105,7 +105,7 @@ ISceneLayer* layer) // Takes ownership { LOG(TRACE) << "SetLayer(" << depth << ", " << reinterpret_cast<intptr_t>(layer) << ")"; - std::auto_ptr<Item> item(new Item(layer, layerCounter_++)); + std::unique_ptr<Item> item(new Item(layer, layerCounter_++)); if (layer == NULL) { @@ -193,7 +193,7 @@ { assert(found->second != NULL); - std::auto_ptr<ISceneLayer> layer(found->second->ReleaseLayer()); + std::unique_ptr<ISceneLayer> layer(found->second->ReleaseLayer()); assert(layer.get() != NULL); content_.erase(found);
--- a/Framework/Scene2D/TextSceneLayer.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Scene2D/TextSceneLayer.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -21,6 +21,8 @@ #include "TextSceneLayer.h" +#include <Core/Compatibility.h> + namespace OrthancStone { TextSceneLayer::TextSceneLayer() : @@ -36,7 +38,7 @@ ISceneLayer* TextSceneLayer::Clone() const { - std::auto_ptr<TextSceneLayer> cloned(new TextSceneLayer); + std::unique_ptr<TextSceneLayer> cloned(new TextSceneLayer); cloned->SetColor(GetColor()); cloned->x_ = x_; cloned->y_ = y_;
--- a/Framework/Scene2D/TextureBaseSceneLayer.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Scene2D/TextureBaseSceneLayer.h Mon Mar 02 16:31:30 2020 +0100 @@ -24,6 +24,7 @@ #include "ISceneLayer.h" #include "../Toolbox/AffineTransform2D.h" +#include <Core/Compatibility.h> #include <Core/Images/ImageAccessor.h> namespace OrthancStone @@ -31,7 +32,7 @@ class TextureBaseSceneLayer : public ISceneLayer { private: - std::auto_ptr<Orthanc::ImageAccessor> texture_; + std::unique_ptr<Orthanc::ImageAccessor> texture_; double originX_; double originY_; double pixelSpacingX_;
--- a/Framework/Scene2DViewport/LayerHolder.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Scene2DViewport/LayerHolder.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -49,13 +49,13 @@ for (int i = 0; i < polylineLayerCount_; ++i) { - std::auto_ptr<PolylineSceneLayer> layer(new PolylineSceneLayer()); + std::unique_ptr<PolylineSceneLayer> layer(new PolylineSceneLayer()); GetScene().SetLayer(baseLayerIndex_ + i, layer.release()); } for (int i = 0; i < textLayerCount_; ++i) { - std::auto_ptr<TextSceneLayer> layer(new TextSceneLayer()); + std::unique_ptr<TextSceneLayer> layer(new TextSceneLayer()); GetScene().SetLayer( baseLayerIndex_ + polylineLayerCount_ + i, layer.release());
--- a/Framework/Toolbox/DicomInstanceParameters.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Toolbox/DicomInstanceParameters.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -369,7 +369,7 @@ Orthanc::ImageAccessor* DicomInstanceParameters::ConvertToFloat(const Orthanc::ImageAccessor& pixelData) const { - std::auto_ptr<Orthanc::Image> converted(new Orthanc::Image(Orthanc::PixelFormat_Float32, + std::unique_ptr<Orthanc::Image> converted(new Orthanc::Image(Orthanc::PixelFormat_Float32, pixelData.GetWidth(), pixelData.GetHeight(), false)); @@ -404,7 +404,7 @@ else { // This is the case of a grayscale frame. Convert it to Float32. - std::auto_ptr<FloatTextureSceneLayer> texture; + std::unique_ptr<FloatTextureSceneLayer> texture; if (pixelData.GetFormat() == Orthanc::PixelFormat_Float32) { @@ -412,7 +412,7 @@ } else { - std::auto_ptr<Orthanc::ImageAccessor> converted(ConvertToFloat(pixelData)); + std::unique_ptr<Orthanc::ImageAccessor> converted(ConvertToFloat(pixelData)); texture.reset(new FloatTextureSceneLayer(*converted)); } @@ -442,7 +442,7 @@ LookupTableTextureSceneLayer* DicomInstanceParameters::CreateLookupTableTexture (const Orthanc::ImageAccessor& pixelData) const { - std::auto_ptr<FloatTextureSceneLayer> texture; + std::unique_ptr<FloatTextureSceneLayer> texture; if (pixelData.GetFormat() == Orthanc::PixelFormat_Float32) { @@ -450,7 +450,7 @@ } else { - std::auto_ptr<Orthanc::ImageAccessor> converted(ConvertToFloat(pixelData)); + std::unique_ptr<Orthanc::ImageAccessor> converted(ConvertToFloat(pixelData)); return new LookupTableTextureSceneLayer(*converted); } }
--- a/Framework/Toolbox/DynamicBitmap.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Toolbox/DynamicBitmap.h Mon Mar 02 16:31:30 2020 +0100 @@ -21,6 +21,7 @@ #pragma once +#include <Core/Compatibility.h> #include <Core/IDynamicObject.h> #include <Core/Images/ImageAccessor.h> @@ -31,7 +32,7 @@ class DynamicBitmap : public Orthanc::IDynamicObject { private: - std::auto_ptr<Orthanc::ImageAccessor> bitmap_; + std::unique_ptr<Orthanc::ImageAccessor> bitmap_; public: DynamicBitmap(const Orthanc::ImageAccessor& bitmap);
--- a/Framework/Toolbox/FiniteProjectiveCamera.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Toolbox/FiniteProjectiveCamera.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -434,7 +434,7 @@ // to the line joining the camera center and the principal point const VolumeProjection projection = VolumeProjection_Axial; - std::auto_ptr<Orthanc::ImageAccessor> target + std::unique_ptr<Orthanc::ImageAccessor> target (new Orthanc::Image(targetFormat, targetWidth, targetHeight, false)); if (targetFormat == Orthanc::PixelFormat_Grayscale16 &&
--- a/Framework/Toolbox/ShearWarpProjectiveTransform.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Toolbox/ShearWarpProjectiveTransform.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -414,7 +414,7 @@ * for each pixel is stored in the "counter" image. **/ - std::auto_ptr<Orthanc::ImageAccessor> accumulator, counter, intermediate; + std::unique_ptr<Orthanc::ImageAccessor> accumulator, counter, intermediate; accumulator.reset(new Orthanc::Image(Orthanc::PixelFormat_Float32, intermediateWidth, intermediateHeight, false)); @@ -635,7 +635,7 @@ ImageInterpolation shearInterpolation, ImageInterpolation warpInterpolation) { - std::auto_ptr<Orthanc::ImageAccessor> target + std::unique_ptr<Orthanc::ImageAccessor> target (new Orthanc::Image(targetFormat, targetWidth, targetHeight, false)); if (source.GetFormat() == Orthanc::PixelFormat_Grayscale16 &&
--- a/Framework/Toolbox/SlicesSorter.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Toolbox/SlicesSorter.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -33,7 +33,7 @@ CoordinateSystem3D geometry_; double depth_; - std::auto_ptr<Orthanc::IDynamicObject> payload_; + std::unique_ptr<Orthanc::IDynamicObject> payload_; public: SliceWithDepth(const CoordinateSystem3D& geometry,
--- a/Framework/Toolbox/TextRenderer.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Toolbox/TextRenderer.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -44,7 +44,7 @@ renderer.LoadFont(font, fontSize); // add each char to be rendered to the alphabet - std::auto_ptr<GlyphBitmapAlphabet> alphabet(new GlyphBitmapAlphabet); + std::unique_ptr<GlyphBitmapAlphabet> alphabet(new GlyphBitmapAlphabet); size_t posInString = 0; uint32_t unicode; @@ -58,10 +58,10 @@ } - std::auto_ptr<Orthanc::ImageAccessor> renderedText(alphabet->RenderText(utf8String)); + std::unique_ptr<Orthanc::ImageAccessor> renderedText(alphabet->RenderText(utf8String)); // add a blank line on top of the text (to improve bilinear filtering of the topmost line) - std::auto_ptr<Orthanc::Image> renderedTextExtended(new Orthanc::Image(renderedText->GetFormat(), renderedText->GetWidth(), renderedText->GetHeight() + 1, true)); + std::unique_ptr<Orthanc::Image> renderedTextExtended(new Orthanc::Image(renderedText->GetFormat(), renderedText->GetWidth(), renderedText->GetHeight() + 1, true)); Orthanc::ImageAccessor textRegion; Orthanc::ImageAccessor firstLineRegion; @@ -81,8 +81,8 @@ const std::string& utf8String, uint8_t foreground) { - std::auto_ptr<Orthanc::ImageAccessor> renderedText8(Render(resource, fontSize, utf8String)); - std::auto_ptr<Orthanc::Image> target(new Orthanc::Image(Orthanc::PixelFormat_RGBA32, renderedText8->GetWidth(), renderedText8->GetHeight(), true)); + std::unique_ptr<Orthanc::ImageAccessor> renderedText8(Render(resource, fontSize, utf8String)); + std::unique_ptr<Orthanc::Image> target(new Orthanc::Image(Orthanc::PixelFormat_RGBA32, renderedText8->GetWidth(), renderedText8->GetHeight(), true)); Orthanc::ImageProcessing::Set(*target, foreground, foreground, foreground, *renderedText8); return target.release(); @@ -98,18 +98,18 @@ // uint8_t foreground, // uint8_t borderColor) // { - // std::auto_ptr<Orthanc::ImageAccessor> renderedBorderAlpha(RenderWithAlpha(resource, fontSize, utf8String, borderColor)); - // std::auto_ptr<Orthanc::ImageAccessor> renderedTextAlpha(RenderWithAlpha(resource, fontSize, utf8String, foreground)); + // std::unique_ptr<Orthanc::ImageAccessor> renderedBorderAlpha(RenderWithAlpha(resource, fontSize, utf8String, borderColor)); + // std::unique_ptr<Orthanc::ImageAccessor> renderedTextAlpha(RenderWithAlpha(resource, fontSize, utf8String, foreground)); // unsigned int textWidth = renderedBorderAlpha->GetWidth(); // unsigned int textHeight = renderedBorderAlpha->GetHeight(); // Scene2D targetScene; - // std::auto_ptr<ColorTextureSceneLayer> borderLayerLeft(new ColorTextureSceneLayer(*renderedBorderAlpha)); - // std::auto_ptr<ColorTextureSceneLayer> borderLayerRight(new ColorTextureSceneLayer(*renderedBorderAlpha)); - // std::auto_ptr<ColorTextureSceneLayer> borderLayerTop(new ColorTextureSceneLayer(*renderedBorderAlpha)); - // std::auto_ptr<ColorTextureSceneLayer> borderLayerBottom(new ColorTextureSceneLayer(*renderedBorderAlpha)); - // std::auto_ptr<ColorTextureSceneLayer> textLayerCenter(new ColorTextureSceneLayer(*renderedTextAlpha)); + // std::unique_ptr<ColorTextureSceneLayer> borderLayerLeft(new ColorTextureSceneLayer(*renderedBorderAlpha)); + // std::unique_ptr<ColorTextureSceneLayer> borderLayerRight(new ColorTextureSceneLayer(*renderedBorderAlpha)); + // std::unique_ptr<ColorTextureSceneLayer> borderLayerTop(new ColorTextureSceneLayer(*renderedBorderAlpha)); + // std::unique_ptr<ColorTextureSceneLayer> borderLayerBottom(new ColorTextureSceneLayer(*renderedBorderAlpha)); + // std::unique_ptr<ColorTextureSceneLayer> textLayerCenter(new ColorTextureSceneLayer(*renderedTextAlpha)); // borderLayerLeft->SetOrigin(0, 1); // borderLayerRight->SetOrigin(2, 1); @@ -129,7 +129,7 @@ // Orthanc::ImageAccessor canvas; // compositor.GetCanvas().GetReadOnlyAccessor(canvas); - // std::auto_ptr<Orthanc::Image> output(new Orthanc::Image(Orthanc::PixelFormat_RGBA32, canvas.GetWidth(), canvas.GetHeight(), false)); + // std::unique_ptr<Orthanc::Image> output(new Orthanc::Image(Orthanc::PixelFormat_RGBA32, canvas.GetWidth(), canvas.GetHeight(), false)); // Orthanc::ImageProcessing::Convert(*output, canvas); // return output.release(); // }
--- a/Framework/Viewport/SdlViewport.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Viewport/SdlViewport.h Mon Mar 02 16:31:30 2020 +0100 @@ -66,7 +66,7 @@ { private: SdlOpenGLContext context_; - std::auto_ptr<OpenGLCompositor> compositor_; + std::unique_ptr<OpenGLCompositor> compositor_; public: SdlOpenGLViewport(const char* title,
--- a/Framework/Viewport/WebAssemblyViewport.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Viewport/WebAssemblyViewport.h Mon Mar 02 16:31:30 2020 +0100 @@ -57,7 +57,7 @@ { private: OpenGL::WebAssemblyOpenGLContext context_; - std::auto_ptr<OpenGLCompositor> compositor_; + std::unique_ptr<OpenGLCompositor> compositor_; double cssWidth_; double cssHeight_; int pixelWidth_;
--- a/Framework/Volumes/DicomStructureSetSlicer2.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Volumes/DicomStructureSetSlicer2.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -78,7 +78,7 @@ { assert(isValid_); - std::auto_ptr<PolylineSceneLayer> layer(new PolylineSceneLayer); + std::unique_ptr<PolylineSceneLayer> layer(new PolylineSceneLayer); layer->SetThickness(2); // thickness of the on-screen line for (size_t i = 0; i < structureSet_->GetStructuresCount(); i++)
--- a/Framework/Volumes/DicomVolumeImage.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Volumes/DicomVolumeImage.h Mon Mar 02 16:31:30 2020 +0100 @@ -49,9 +49,9 @@ private: uint64_t revision_; - std::auto_ptr<VolumeImageGeometry> geometry_; - std::auto_ptr<ImageBuffer3D> image_; - std::auto_ptr<DicomInstanceParameters> parameters_; + std::unique_ptr<VolumeImageGeometry> geometry_; + std::unique_ptr<ImageBuffer3D> image_; + std::unique_ptr<DicomInstanceParameters> parameters_; void CheckHasGeometry() const;
--- a/Framework/Volumes/DicomVolumeImageMPRSlicer.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Volumes/DicomVolumeImageMPRSlicer.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -77,7 +77,7 @@ "A style configurator is mandatory for textures"); } - std::auto_ptr<TextureBaseSceneLayer> texture; + std::unique_ptr<TextureBaseSceneLayer> texture; { const DicomInstanceParameters& parameters = volume_.GetDicomParameters();
--- a/Framework/Volumes/DicomVolumeImageReslicer.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Volumes/DicomVolumeImageReslicer.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -67,7 +67,7 @@ if (reslicer.IsSuccess()) { - std::auto_ptr<TextureBaseSceneLayer> layer + std::unique_ptr<TextureBaseSceneLayer> layer (configurator->CreateTextureFromDicom(reslicer.GetOutputSlice(), that_.volume_->GetDicomParameters())); if (layer.get() == NULL)
--- a/Framework/Volumes/ImageBuffer3D.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Volumes/ImageBuffer3D.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -81,7 +81,7 @@ throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); } - std::auto_ptr<Orthanc::Image> result(new Orthanc::Image(format_, height_, depth_, false)); + std::unique_ptr<Orthanc::Image> result(new Orthanc::Image(format_, height_, depth_, false)); //LOG(TRACE) << "ImageBuffer3D::ExtractSagittalSlice result will be an image of WIDTH = " << height_ << " and HEIGHT = " << depth_; unsigned int bytesPerPixel = Orthanc::GetBytesPerPixel(format_);
--- a/Framework/Volumes/ImageBuffer3D.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Volumes/ImageBuffer3D.h Mon Mar 02 16:31:30 2020 +0100 @@ -24,6 +24,7 @@ #include "../StoneEnumerations.h" #include "../Toolbox/LinearAlgebra.h" +#include <Core/Compatibility.h> #include <Core/Images/Image.h> namespace OrthancStone @@ -143,7 +144,7 @@ { private: Orthanc::ImageAccessor accessor_; - std::auto_ptr<Orthanc::Image> sagittal_; // Unused for axial and coronal + std::unique_ptr<Orthanc::Image> sagittal_; // Unused for axial and coronal public: SliceReader(const ImageBuffer3D& that, @@ -163,7 +164,7 @@ ImageBuffer3D& that_; bool modified_; Orthanc::ImageAccessor accessor_; - std::auto_ptr<Orthanc::Image> sagittal_; // Unused for axial and coronal + std::unique_ptr<Orthanc::Image> sagittal_; // Unused for axial and coronal void Flush();
--- a/Framework/Volumes/VolumeReslicer.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Volumes/VolumeReslicer.h Mon Mar 02 16:31:30 2020 +0100 @@ -42,7 +42,7 @@ // Output of reslicing bool success_; Extent2D extent_; - std::auto_ptr<Orthanc::Image> slice_; + std::unique_ptr<Orthanc::Image> slice_; double pixelSpacing_; void CheckIterators(const ImageBuffer3D& source,
--- a/Framework/Volumes/VolumeSceneLayerSource.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Volumes/VolumeSceneLayerSource.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -96,7 +96,7 @@ void VolumeSceneLayerSource::Update(const CoordinateSystem3D& plane) { assert(slicer_.get() != NULL); - std::auto_ptr<IVolumeSlicer::IExtractedSlice> slice(slicer_->ExtractSlice(plane)); + std::unique_ptr<IVolumeSlicer::IExtractedSlice> slice(slicer_->ExtractSlice(plane)); if (slice.get() == NULL) { @@ -129,7 +129,7 @@ lastPlane_.reset(new CoordinateSystem3D(plane)); lastRevision_ = slice->GetRevision(); - std::auto_ptr<ISceneLayer> layer(slice->CreateSceneLayer(configurator_.get(), plane)); + std::unique_ptr<ISceneLayer> layer(slice->CreateSceneLayer(configurator_.get(), plane)); if (layer.get() == NULL) { LOG(TRACE) << "VolumeSceneLayerSource::Update -- (layer.get() == NULL)";
--- a/Framework/Volumes/VolumeSceneLayerSource.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Volumes/VolumeSceneLayerSource.h Mon Mar 02 16:31:30 2020 +0100 @@ -41,8 +41,8 @@ Scene2D& scene_; int layerDepth_; boost::shared_ptr<IVolumeSlicer> slicer_; - std::auto_ptr<ILayerStyleConfigurator> configurator_; - std::auto_ptr<CoordinateSystem3D> lastPlane_; + std::unique_ptr<ILayerStyleConfigurator> configurator_; + std::unique_ptr<CoordinateSystem3D> lastPlane_; uint64_t lastRevision_; uint64_t lastConfiguratorRevision_;
--- a/Platforms/Generic/DelayedCallCommand.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Platforms/Generic/DelayedCallCommand.h Mon Mar 02 16:31:30 2020 +0100 @@ -35,8 +35,8 @@ class DelayedCallCommand : public IOracleCommand, OrthancStone::IObservable { protected: - std::auto_ptr<OrthancStone::MessageHandler<IDelayedCallExecutor::TimeoutMessage> > callback_; - std::auto_ptr<Orthanc::IDynamicObject> payload_; + std::unique_ptr<OrthancStone::MessageHandler<IDelayedCallExecutor::TimeoutMessage> > callback_; + std::unique_ptr<Orthanc::IDynamicObject> payload_; OrthancStone::NativeStoneApplicationContext& context_; boost::posix_time::ptime expirationTimePoint_; unsigned int timeoutInMs_;
--- a/Platforms/Generic/Oracle.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Platforms/Generic/Oracle.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -62,7 +62,7 @@ break; } - std::auto_ptr<Orthanc::IDynamicObject> item(that->queue_.Dequeue(100)); + std::unique_ptr<Orthanc::IDynamicObject> item(that->queue_.Dequeue(100)); if (item.get() != NULL) { IOracleCommand& command = dynamic_cast<IOracleCommand&>(*item); @@ -107,7 +107,7 @@ void Submit(IOracleCommand* command) { - std::auto_ptr<IOracleCommand> protection(command); + std::unique_ptr<IOracleCommand> protection(command); if (command == NULL) {
--- a/Platforms/Generic/OracleWebService.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Platforms/Generic/OracleWebService.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -29,8 +29,8 @@ class OracleWebService::WebServiceCachedGetCommand : public IOracleCommand, OrthancStone::IObservable { protected: - std::auto_ptr<OrthancStone::MessageHandler<IWebService::HttpRequestSuccessMessage> > successCallback_; - std::auto_ptr<Orthanc::IDynamicObject> payload_; + std::unique_ptr<OrthancStone::MessageHandler<IWebService::HttpRequestSuccessMessage> > successCallback_; + std::unique_ptr<Orthanc::IDynamicObject> payload_; boost::shared_ptr<BaseWebService::CachedHttpRequestSuccessMessage> cachedMessage_; OrthancStone::NativeStoneApplicationContext& context_;
--- a/Platforms/Generic/WebServiceCommandBase.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Platforms/Generic/WebServiceCommandBase.h Mon Mar 02 16:31:30 2020 +0100 @@ -37,12 +37,12 @@ class WebServiceCommandBase : public IOracleCommand, OrthancStone::IObservable { protected: - std::auto_ptr<OrthancStone::MessageHandler<IWebService::HttpRequestSuccessMessage> > successCallback_; - std::auto_ptr<OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage> > failureCallback_; + std::unique_ptr<OrthancStone::MessageHandler<IWebService::HttpRequestSuccessMessage> > successCallback_; + std::unique_ptr<OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage> > failureCallback_; Orthanc::WebServiceParameters parameters_; std::string url_; IWebService::HttpHeaders headers_; - std::auto_ptr<Orthanc::IDynamicObject> payload_; + std::unique_ptr<Orthanc::IDynamicObject> payload_; bool success_; Orthanc::HttpStatus httpStatus_; std::string answer_;
--- a/Platforms/Wasm/WasmWebService.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Platforms/Wasm/WasmWebService.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -7,7 +7,7 @@ struct CachedSuccessNotification { boost::shared_ptr<Deprecated::BaseWebService::CachedHttpRequestSuccessMessage> cachedMessage; - std::auto_ptr<Orthanc::IDynamicObject> payload; + std::unique_ptr<Orthanc::IDynamicObject> payload; OrthancStone::MessageHandler<Deprecated::IWebService::HttpRequestSuccessMessage>* successCallback; }; @@ -56,7 +56,7 @@ void EMSCRIPTEN_KEEPALIVE WasmWebService_NotifyCachedSuccess(void* notification_) { // 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_)); + std::unique_ptr<CachedSuccessNotification> notification(reinterpret_cast<CachedSuccessNotification*>(notification_)); notification->successCallback->Apply(Deprecated::IWebService::HttpRequestSuccessMessage( notification->cachedMessage->GetUri(),
--- a/Resources/CMake/OrthancStoneParameters.cmake Sun Feb 23 15:25:49 2020 +0100 +++ b/Resources/CMake/OrthancStoneParameters.cmake Mon Mar 02 16:31:30 2020 +0100 @@ -52,6 +52,6 @@ ## the Stone of Orthanc ##################################################################### -set(ENABLE_OPENGL ON CACHE INTERNAL "Enable support of OpenGL") +set(ENABLE_OPENGL ON CACHE BOOL "Enable support of OpenGL") set(ENABLE_WASM OFF CACHE INTERNAL "Enable support of WebAssembly") set(ENABLE_STONE_DEPRECATED OFF CACHE INTERNAL "Enable backward compatibility with deprecated Stone classes")
--- a/Resources/CodeGeneration/template.in.h.j2 Sun Feb 23 15:25:49 2020 +0100 +++ b/Resources/CodeGeneration/template.in.h.j2 Mon Mar 02 16:31:30 2020 +0100 @@ -19,7 +19,7 @@ //#define STONEGEN_NO_CPP11 1 #ifdef STONEGEN_NO_CPP11 -#define StoneSmartPtr std::auto_ptr +#define StoneSmartPtr std::unique_ptr #else #define StoneSmartPtr std::unique_ptr #endif
--- a/Resources/CodeGeneration/testWasmIntegrated/jsoncpp-1.8.4/jsoncpp.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Resources/CodeGeneration/testWasmIntegrated/jsoncpp-1.8.4/jsoncpp.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -287,7 +287,7 @@ #if __cplusplus >= 201103L || (defined(_CPPLIB_VER) && _CPPLIB_VER >= 520) typedef std::unique_ptr<CharReader> CharReaderPtr; #else -typedef std::auto_ptr<CharReader> CharReaderPtr; +typedef std::unique_ptr<CharReader> CharReaderPtr; #endif // Implementation of class Features @@ -4242,7 +4242,7 @@ #if __cplusplus >= 201103L || (defined(_CPPLIB_VER) && _CPPLIB_VER >= 520) typedef std::unique_ptr<StreamWriter> StreamWriterPtr; #else -typedef std::auto_ptr<StreamWriter> StreamWriterPtr; +typedef std::unique_ptr<StreamWriter> StreamWriterPtr; #endif String valueToString(LargestInt value) {
--- a/Resources/Graveyard/ReferenceLineFactory.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Resources/Graveyard/ReferenceLineFactory.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -101,7 +101,7 @@ x1, y1, x2, y2, sx1, sy1, sx2, sy2)) { - std::auto_ptr<ILayerRenderer> layer(new LineLayerRenderer(x1, y1, x2, y2)); + std::unique_ptr<ILayerRenderer> layer(new LineLayerRenderer(x1, y1, x2, y2)); layer->SetLayerStyle(style_); return layer.release(); }
--- a/Resources/Graveyard/Threading/SdlBuffering.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Resources/Graveyard/Threading/SdlBuffering.h Mon Mar 02 16:31:30 2020 +0100 @@ -35,8 +35,8 @@ { private: boost::mutex mutex_; - std::auto_ptr<CairoSurface> offscreenSurface_; - std::auto_ptr<CairoSurface> onscreenSurface_; + std::unique_ptr<CairoSurface> offscreenSurface_; + std::unique_ptr<CairoSurface> onscreenSurface_; SDL_Surface* sdlSurface_; bool pendingFrame_;
--- a/Samples/MultiPlatform/BasicScene/BasicScene.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Samples/MultiPlatform/BasicScene/BasicScene.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -69,7 +69,7 @@ scene.SetLayer(12, new ColorTextureSceneLayer(i)); - std::auto_ptr<ColorTextureSceneLayer> l(new ColorTextureSceneLayer(i)); + std::unique_ptr<ColorTextureSceneLayer> l(new ColorTextureSceneLayer(i)); l->SetOrigin(-3, 2); l->SetPixelSpacing(1.5, 1); l->SetAngle(20.0 / 180.0 * 3.14); @@ -85,7 +85,7 @@ p[1] = 0; p[2] = 0; - std::auto_ptr<ColorTextureSceneLayer> l(new ColorTextureSceneLayer(i)); + std::unique_ptr<ColorTextureSceneLayer> l(new ColorTextureSceneLayer(i)); l->SetOrigin(-2, 1); l->SetAngle(20.0 / 180.0 * 3.14); scene.SetLayer(13, l.release()); @@ -93,7 +93,7 @@ // Some lines { - std::auto_ptr<PolylineSceneLayer> layer(new PolylineSceneLayer); + std::unique_ptr<PolylineSceneLayer> layer(new PolylineSceneLayer); layer->SetThickness(1); @@ -125,7 +125,7 @@ // Some text { - std::auto_ptr<TextSceneLayer> layer(new TextSceneLayer); + std::unique_ptr<TextSceneLayer> layer(new TextSceneLayer); layer->SetText("Hello"); scene.SetLayer(100, layer.release()); } @@ -170,7 +170,7 @@ } else { - std::auto_ptr<TextSceneLayer> + std::unique_ptr<TextSceneLayer> layer(new TextSceneLayer); layer->SetColor(0, 255, 0); layer->SetText(buf);
--- a/Samples/Sdl/BasicScene.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Samples/Sdl/BasicScene.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -78,7 +78,7 @@ scene.SetLayer(12, new ColorTextureSceneLayer(i)); - std::auto_ptr<ColorTextureSceneLayer> l(new ColorTextureSceneLayer(i)); + std::unique_ptr<ColorTextureSceneLayer> l(new ColorTextureSceneLayer(i)); l->SetOrigin(-3, 2); l->SetPixelSpacing(1.5, 1); l->SetAngle(20.0 / 180.0 * M_PI); @@ -94,7 +94,7 @@ p[1] = 0; p[2] = 0; - std::auto_ptr<ColorTextureSceneLayer> l(new ColorTextureSceneLayer(i)); + std::unique_ptr<ColorTextureSceneLayer> l(new ColorTextureSceneLayer(i)); l->SetOrigin(-2, 1); l->SetAngle(20.0 / 180.0 * M_PI); scene.SetLayer(13, l.release()); @@ -102,7 +102,7 @@ // Some lines { - std::auto_ptr<PolylineSceneLayer> layer(new PolylineSceneLayer); + std::unique_ptr<PolylineSceneLayer> layer(new PolylineSceneLayer); layer->SetThickness(10); @@ -133,7 +133,7 @@ // Some text { - std::auto_ptr<TextSceneLayer> layer(new TextSceneLayer); + std::unique_ptr<TextSceneLayer> layer(new TextSceneLayer); layer->SetText("Hello"); scene.SetLayer(100, layer.release()); } @@ -199,7 +199,7 @@ } else { - std::auto_ptr<TextSceneLayer> + std::unique_ptr<TextSceneLayer> layer(new TextSceneLayer); layer->SetColor(0, 255, 0); layer->SetText(buf);
--- a/Samples/Sdl/FusionMprSdl.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Samples/Sdl/FusionMprSdl.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -125,7 +125,7 @@ } else { - std::auto_ptr<TextSceneLayer> layer(new TextSceneLayer); + std::unique_ptr<TextSceneLayer> layer(new TextSceneLayer); layerP = layer.get(); layer->SetColor(0, 255, 0); layer->SetFontIndex(1); @@ -160,7 +160,7 @@ } else { - std::auto_ptr<TextSceneLayer> layer(new TextSceneLayer); + std::unique_ptr<TextSceneLayer> layer(new TextSceneLayer); layer->SetColor(0, 255, 0); layer->SetText(buf); layer->SetBorder(20); @@ -635,7 +635,7 @@ this->SetVolume1(0, ctLoader, new GrayscaleStyleConfigurator); { - std::auto_ptr<LookupTableStyleConfigurator> config(new LookupTableStyleConfigurator); + std::unique_ptr<LookupTableStyleConfigurator> config(new LookupTableStyleConfigurator); config->SetLookupTable(Orthanc::EmbeddedResources::COLORMAP_HOT); boost::shared_ptr<DicomVolumeImageMPRSlicer> tmp(new DicomVolumeImageMPRSlicer(dose));
--- a/Samples/Sdl/Loader.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Samples/Sdl/Loader.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -120,7 +120,7 @@ OrthancStone::CoordinateSystem3D plane_; OrthancStone::IOracle& oracle_; OrthancStone::Scene2D scene_; - std::auto_ptr<OrthancStone::VolumeSceneLayerSource> source1_, source2_, source3_; + std::unique_ptr<OrthancStone::VolumeSceneLayerSource> source1_, source2_, source3_; void Refresh() @@ -342,7 +342,7 @@ { - std::auto_ptr<OrthancStone::LookupTableStyleConfigurator> config(new OrthancStone::LookupTableStyleConfigurator); + std::unique_ptr<OrthancStone::LookupTableStyleConfigurator> config(new OrthancStone::LookupTableStyleConfigurator); config->SetLookupTable(Orthanc::EmbeddedResources::COLORMAP_HOT); boost::shared_ptr<OrthancStone::DicomVolumeImageMPRSlicer> tmp(new OrthancStone::DicomVolumeImageMPRSlicer(dose)); @@ -359,7 +359,7 @@ v["Level"] = "Series"; v["Query"] = Json::objectValue; - std::auto_ptr<OrthancStone::OrthancRestApiCommand> command(new OrthancStone::OrthancRestApiCommand); + std::unique_ptr<OrthancStone::OrthancRestApiCommand> command(new OrthancStone::OrthancRestApiCommand); command->SetMethod(Orthanc::HttpMethod_Post); command->SetUri("/tools/find"); command->SetBody(v); @@ -371,7 +371,7 @@ { if (0) { - std::auto_ptr<OrthancStone::GetOrthancImageCommand> command(new OrthancStone::GetOrthancImageCommand); + std::unique_ptr<OrthancStone::GetOrthancImageCommand> command(new OrthancStone::GetOrthancImageCommand); command->SetHttpHeader("Accept", std::string(Orthanc::EnumerationToString(Orthanc::MimeType_Jpeg))); command->SetUri("/instances/6687cc73-07cae193-52ff29c8-f646cb16-0753ed92/preview"); oracle.Schedule(*toto, command.release()); @@ -379,7 +379,7 @@ if (0) { - std::auto_ptr<OrthancStone::GetOrthancImageCommand> command(new OrthancStone::GetOrthancImageCommand); + std::unique_ptr<OrthancStone::GetOrthancImageCommand> command(new OrthancStone::GetOrthancImageCommand); command->SetHttpHeader("Accept", std::string(Orthanc::EnumerationToString(Orthanc::MimeType_Png))); command->SetUri("/instances/6687cc73-07cae193-52ff29c8-f646cb16-0753ed92/preview"); oracle.Schedule(*toto, command.release()); @@ -387,7 +387,7 @@ if (0) { - std::auto_ptr<OrthancStone::GetOrthancImageCommand> command(new OrthancStone::GetOrthancImageCommand); + std::unique_ptr<OrthancStone::GetOrthancImageCommand> command(new OrthancStone::GetOrthancImageCommand); command->SetHttpHeader("Accept", std::string(Orthanc::EnumerationToString(Orthanc::MimeType_Png))); command->SetUri("/instances/6687cc73-07cae193-52ff29c8-f646cb16-0753ed92/image-uint16"); oracle.Schedule(*toto, command.release()); @@ -395,7 +395,7 @@ if (0) { - std::auto_ptr<OrthancStone::GetOrthancImageCommand> command(new OrthancStone::GetOrthancImageCommand); + std::unique_ptr<OrthancStone::GetOrthancImageCommand> command(new OrthancStone::GetOrthancImageCommand); command->SetHttpHeader("Accept-Encoding", "gzip"); command->SetHttpHeader("Accept", std::string(Orthanc::EnumerationToString(Orthanc::MimeType_Pam))); command->SetUri("/instances/6687cc73-07cae193-52ff29c8-f646cb16-0753ed92/image-uint16"); @@ -404,7 +404,7 @@ if (0) { - std::auto_ptr<OrthancStone::GetOrthancImageCommand> command(new OrthancStone::GetOrthancImageCommand); + std::unique_ptr<OrthancStone::GetOrthancImageCommand> command(new OrthancStone::GetOrthancImageCommand); command->SetHttpHeader("Accept", std::string(Orthanc::EnumerationToString(Orthanc::MimeType_Pam))); command->SetUri("/instances/6687cc73-07cae193-52ff29c8-f646cb16-0753ed92/image-uint16"); oracle.Schedule(*toto, command.release()); @@ -412,7 +412,7 @@ if (0) { - std::auto_ptr<OrthancStone::GetOrthancWebViewerJpegCommand> command(new OrthancStone::GetOrthancWebViewerJpegCommand); + std::unique_ptr<OrthancStone::GetOrthancWebViewerJpegCommand> command(new OrthancStone::GetOrthancWebViewerJpegCommand); command->SetHttpHeader("Accept-Encoding", "gzip"); command->SetInstance("e6c7c20b-c9f65d7e-0d76f2e2-830186f2-3e3c600e"); command->SetQuality(90); @@ -424,7 +424,7 @@ { for (unsigned int i = 0; i < 10; i++) { - std::auto_ptr<OrthancStone::SleepOracleCommand> command(new OrthancStone::SleepOracleCommand(i * 1000)); + std::unique_ptr<OrthancStone::SleepOracleCommand> command(new OrthancStone::SleepOracleCommand(i * 1000)); command->SetPayload(new Orthanc::SingleValueObject<unsigned int>(42 * i)); oracle.Schedule(*toto, command.release()); }
--- a/Samples/Sdl/RadiographyEditor.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Samples/Sdl/RadiographyEditor.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -179,7 +179,7 @@ glEnable(GL_DEBUG_OUTPUT); glDebugMessageCallback(OpenGLMessageCallback, 0); - std::auto_ptr<OpenGlSdlCompositorFactory> compositorFactory(new OpenGlSdlCompositorFactory(window)); + std::unique_ptr<OpenGlSdlCompositorFactory> compositorFactory(new OpenGlSdlCompositorFactory(window)); boost::shared_ptr<RadiographyEditorApp> app(new RadiographyEditorApp(oracle, lock.GetOracleObservable(), compositorFactory.release())); app->PrepareScene(); app->FitContent(window.GetCanvasWidth(), window.GetCanvasHeight());
--- a/Samples/Sdl/TrackerSampleApp.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Samples/Sdl/TrackerSampleApp.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -96,7 +96,7 @@ } else { - std::auto_ptr<TextSceneLayer> layer(new TextSceneLayer); + std::unique_ptr<TextSceneLayer> layer(new TextSceneLayer); layerP = layer.get(); layer->SetColor(0, 255, 0); layer->SetFontIndex(1); @@ -131,7 +131,7 @@ } else { - std::auto_ptr<TextSceneLayer> layer(new TextSceneLayer); + std::unique_ptr<TextSceneLayer> layer(new TextSceneLayer); layer->SetColor(0, 255, 0); layer->SetText(buf); layer->SetBorder(20); @@ -516,7 +516,7 @@ controller_->GetScene().SetLayer(TEXTURE_2x2_1_ZINDEX, new ColorTextureSceneLayer(i)); - std::auto_ptr<ColorTextureSceneLayer> l(new ColorTextureSceneLayer(i)); + std::unique_ptr<ColorTextureSceneLayer> l(new ColorTextureSceneLayer(i)); l->SetOrigin(-3, 2); l->SetPixelSpacing(1.5, 1); l->SetAngle(20.0 / 180.0 * M_PI); @@ -532,7 +532,7 @@ p[1] = 0; p[2] = 0; - std::auto_ptr<ColorTextureSceneLayer> l(new ColorTextureSceneLayer(i)); + std::unique_ptr<ColorTextureSceneLayer> l(new ColorTextureSceneLayer(i)); l->SetOrigin(-2, 1); l->SetAngle(20.0 / 180.0 * M_PI); controller_->GetScene().SetLayer(TEXTURE_1x1_ZINDEX, l.release()); @@ -540,7 +540,7 @@ // Some lines { - std::auto_ptr<PolylineSceneLayer> layer(new PolylineSceneLayer); + std::unique_ptr<PolylineSceneLayer> layer(new PolylineSceneLayer); layer->SetThickness(1); @@ -571,7 +571,7 @@ // Some text { - std::auto_ptr<TextSceneLayer> layer(new TextSceneLayer); + std::unique_ptr<TextSceneLayer> layer(new TextSceneLayer); layer->SetText("Hello"); controller_->GetScene().SetLayer(LINESET_2_ZINDEX, layer.release()); }
--- a/Samples/WebAssembly/BasicMPR.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Samples/WebAssembly/BasicMPR.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -38,7 +38,7 @@ { private: OrthancStone::WebAssemblyViewport viewport_; - std::auto_ptr<VolumeSceneLayerSource> source_; + std::unique_ptr<VolumeSceneLayerSource> source_; VolumeProjection projection_; std::vector<CoordinateSystem3D> planes_; size_t currentPlane_; @@ -155,9 +155,9 @@ boost::shared_ptr<OrthancStone::OrthancSeriesVolumeProgressiveLoader> loader_; -std::auto_ptr<OrthancStone::VolumeSlicerWidget> widget1_; -std::auto_ptr<OrthancStone::VolumeSlicerWidget> widget2_; -std::auto_ptr<OrthancStone::VolumeSlicerWidget> widget3_; +std::unique_ptr<OrthancStone::VolumeSlicerWidget> widget1_; +std::unique_ptr<OrthancStone::VolumeSlicerWidget> widget2_; +std::unique_ptr<OrthancStone::VolumeSlicerWidget> widget3_; OrthancStone::MessageBroker broker_; OrthancStone::WebAssemblyOracle oracle_(broker_); @@ -371,7 +371,7 @@ widget1_.reset(new OrthancStone::VolumeSlicerWidget(broker_, "mycanvas1", OrthancStone::VolumeProjection_Axial)); { - std::auto_ptr<OrthancStone::GrayscaleStyleConfigurator> style(new OrthancStone::GrayscaleStyleConfigurator); + std::unique_ptr<OrthancStone::GrayscaleStyleConfigurator> style(new OrthancStone::GrayscaleStyleConfigurator); style->SetLinearInterpolation(true); style->SetWindowing(OrthancStone::ImageWindowing_Bone); widget1_->SetSlicer(0, loader_, *loader_, style.release()); @@ -380,7 +380,7 @@ widget2_.reset(new OrthancStone::VolumeSlicerWidget(broker_, "mycanvas2", OrthancStone::VolumeProjection_Coronal)); { - std::auto_ptr<OrthancStone::GrayscaleStyleConfigurator> style(new OrthancStone::GrayscaleStyleConfigurator); + std::unique_ptr<OrthancStone::GrayscaleStyleConfigurator> style(new OrthancStone::GrayscaleStyleConfigurator); style->SetLinearInterpolation(true); style->SetWindowing(OrthancStone::ImageWindowing_Bone); widget2_->SetSlicer(0, loader_, *loader_, style.release()); @@ -389,7 +389,7 @@ widget3_.reset(new OrthancStone::VolumeSlicerWidget(broker_, "mycanvas3", OrthancStone::VolumeProjection_Sagittal)); { - std::auto_ptr<OrthancStone::GrayscaleStyleConfigurator> style(new OrthancStone::GrayscaleStyleConfigurator); + std::unique_ptr<OrthancStone::GrayscaleStyleConfigurator> style(new OrthancStone::GrayscaleStyleConfigurator); style->SetLinearInterpolation(true); style->SetWindowing(OrthancStone::ImageWindowing_Bone); widget3_->SetSlicer(0, loader_, *loader_, style.release());
--- a/Samples/WebAssembly/BasicScene.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Samples/WebAssembly/BasicScene.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -62,7 +62,7 @@ scene.SetLayer(12, new ColorTextureSceneLayer(i)); - std::auto_ptr<ColorTextureSceneLayer> l(new ColorTextureSceneLayer(i)); + std::unique_ptr<ColorTextureSceneLayer> l(new ColorTextureSceneLayer(i)); l->SetOrigin(-3, 2); l->SetPixelSpacing(1.5, 1); l->SetAngle(20.0 / 180.0 * M_PI); @@ -79,7 +79,7 @@ p[1] = 0; p[2] = 0; - std::auto_ptr<ColorTextureSceneLayer> l(new ColorTextureSceneLayer(i)); + std::unique_ptr<ColorTextureSceneLayer> l(new ColorTextureSceneLayer(i)); l->SetOrigin(-2, 1); l->SetAngle(20.0 / 180.0 * M_PI); scene.SetLayer(13, l.release()); @@ -88,7 +88,7 @@ // Some lines if (1) { - std::auto_ptr<PolylineSceneLayer> layer(new PolylineSceneLayer); + std::unique_ptr<PolylineSceneLayer> layer(new PolylineSceneLayer); layer->SetThickness(1); @@ -120,16 +120,16 @@ // Some text if (1) { - std::auto_ptr<TextSceneLayer> layer(new TextSceneLayer); + std::unique_ptr<TextSceneLayer> layer(new TextSceneLayer); layer->SetText("Hello"); scene.SetLayer(100, layer.release()); } } -std::auto_ptr<OrthancStone::WebAssemblyViewport> viewport1_; -std::auto_ptr<OrthancStone::WebAssemblyViewport> viewport2_; -std::auto_ptr<OrthancStone::WebAssemblyViewport> viewport3_; +std::unique_ptr<OrthancStone::WebAssemblyViewport> viewport1_; +std::unique_ptr<OrthancStone::WebAssemblyViewport> viewport2_; +std::unique_ptr<OrthancStone::WebAssemblyViewport> viewport3_; boost::shared_ptr<OrthancStone::ViewportController> controller1_; boost::shared_ptr<OrthancStone::ViewportController> controller2_; boost::shared_ptr<OrthancStone::ViewportController> controller3_;
--- a/Samples/WebAssembly/dev.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Samples/WebAssembly/dev.h Mon Mar 02 16:31:30 2020 +0100 @@ -79,7 +79,7 @@ const EmscriptenMouseEvent& source, OrthancStone::IViewport& viewport) { - std::auto_ptr<OrthancStone::PointerEvent> target( + std::unique_ptr<OrthancStone::PointerEvent> target( new OrthancStone::PointerEvent); target->AddPosition(viewport.GetPixelCenterCoordinates( @@ -91,7 +91,7 @@ return target.release(); } -std::auto_ptr<OrthancStone::ActiveTracker> tracker_; +std::unique_ptr<OrthancStone::ActiveTracker> tracker_; EM_BOOL OnMouseEvent(int eventType, const EmscriptenMouseEvent *mouseEvent, @@ -111,7 +111,7 @@ char buf[64]; sprintf(buf, "click %d", count++); - std::auto_ptr<OrthancStone::TextSceneLayer> layer(new OrthancStone::TextSceneLayer); + std::unique_ptr<OrthancStone::TextSceneLayer> layer(new OrthancStone::TextSceneLayer); layer->SetText(buf); controller->GetViewport().GetScene().SetLayer(100, layer.release()); controller->GetViewport().Refresh(); @@ -123,7 +123,7 @@ boost::shared_ptr<OrthancStone::IFlexiblePointerTracker> t; { - std::auto_ptr<OrthancStone::PointerEvent> event( + std::unique_ptr<OrthancStone::PointerEvent> event( ConvertMouseEvent(*mouseEvent, controller->GetViewport())); switch (mouseEvent->button) @@ -165,7 +165,7 @@ case EMSCRIPTEN_EVENT_MOUSEMOVE: if (tracker_.get() != NULL) { - std::auto_ptr<OrthancStone::PointerEvent> event( + std::unique_ptr<OrthancStone::PointerEvent> event( ConvertMouseEvent(*mouseEvent, controller->GetViewport())); tracker_->PointerMove(*event); controller->GetViewport().Refresh(); @@ -175,7 +175,7 @@ case EMSCRIPTEN_EVENT_MOUSEUP: if (tracker_.get() != NULL) { - std::auto_ptr<OrthancStone::PointerEvent> event( + std::unique_ptr<OrthancStone::PointerEvent> event( ConvertMouseEvent(*mouseEvent, controller->GetViewport())); tracker_->PointerUp(*event); controller->GetViewport().Refresh();
--- a/UnitTestsSources/ImageToolboxTests.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/UnitTestsSources/ImageToolboxTests.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -23,6 +23,7 @@ // #include <boost/chrono.hpp> // #include <boost/lexical_cast.hpp> +#include <Core/Compatibility.h> #include <Core/Images/Image.h> #include <Core/Images/PixelTraits.h> @@ -52,7 +53,7 @@ size_t pixCounter = 0; - std::auto_ptr<Orthanc::Image> image(new Orthanc::Image( + std::unique_ptr<Orthanc::Image> image(new Orthanc::Image( Orthanc::PixelFormat_Grayscale8, W, H, false)); for (unsigned int y = 0; y < H; ++y) @@ -92,7 +93,7 @@ size_t pixCounter = 0; - std::auto_ptr<Orthanc::Image> image(new Orthanc::Image( + std::unique_ptr<Orthanc::Image> image(new Orthanc::Image( Orthanc::PixelFormat_Grayscale8, W, H, false)); for (unsigned int y = 0; y < H; ++y) @@ -133,7 +134,7 @@ size_t pixCounter = 0; - std::auto_ptr<Orthanc::Image> image(new Orthanc::Image( + std::unique_ptr<Orthanc::Image> image(new Orthanc::Image( Format, W, H, false)); typedef typename Orthanc::PixelTraits<Format>::PixelType PixelType; @@ -203,7 +204,7 @@ size_t pixCounter = 0; - std::auto_ptr<Orthanc::Image> image(new Orthanc::Image( + std::unique_ptr<Orthanc::Image> image(new Orthanc::Image( Format, W, H, false)); typedef typename Orthanc::PixelTraits<Format>::PixelType PixelType;
--- a/UnitTestsSources/PixelTestPatternsTests.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/UnitTestsSources/PixelTestPatternsTests.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -36,7 +36,7 @@ TEST(PixelTestPatterns, SimpleRedHGradient) { - std::auto_ptr<Orthanc::Image> texture; + std::unique_ptr<Orthanc::Image> texture; texture.reset(new Orthanc::Image( Orthanc::PixelFormat_RGBA32, @@ -72,7 +72,7 @@ TEST(PixelTestPatterns, SimpleRedBlueVGradient) { - std::auto_ptr<Orthanc::Image> texture; + std::unique_ptr<Orthanc::Image> texture; texture.reset(new Orthanc::Image( Orthanc::PixelFormat_RGBA32, @@ -109,7 +109,7 @@ TEST(PixelTestPatterns, MultiGradient) { - std::auto_ptr<Orthanc::Image> texture; + std::unique_ptr<Orthanc::Image> texture; const int CELLW = 64; const int CELLH = 64;
--- a/UnitTestsSources/TestCommands.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/UnitTestsSources/TestCommands.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -60,7 +60,7 @@ // Json::Value cmdJson; // cmdJson["command"] = "noop"; -// std::auto_ptr<OrthancStone::ICommand> command(factory.CreateFromJson(cmdJson)); +// std::unique_ptr<OrthancStone::ICommand> command(factory.CreateFromJson(cmdJson)); // ASSERT_TRUE(command.get() != NULL); // ASSERT_EQ("noop", command->GetName()); @@ -77,7 +77,7 @@ // cmdJson["command"] = "increment"; // cmdJson["args"]["increment"] = 2; -// std::auto_ptr<OrthancStone::ICommand> command(factory.CreateFromJson(cmdJson)); +// std::unique_ptr<OrthancStone::ICommand> command(factory.CreateFromJson(cmdJson)); // ASSERT_TRUE(command.get() != NULL); // CommandIncrement::counter = 0; @@ -93,7 +93,7 @@ // Json::Value cmdJson; // cmdJson["command"] = "unknown"; -// ASSERT_THROW(std::auto_ptr<OrthancStone::ICommand> command(factory.CreateFromJson(cmdJson)), Orthanc::OrthancException); +// ASSERT_THROW(std::unique_ptr<OrthancStone::ICommand> command(factory.CreateFromJson(cmdJson)), Orthanc::OrthancException); //} //TEST(Commands, TryCreateCommandFromInvalidJson) @@ -104,5 +104,5 @@ // Json::Value cmdJson; // cmdJson["command-name"] = "noop"; -// ASSERT_THROW(std::auto_ptr<OrthancStone::ICommand> command(factory.CreateFromJson(cmdJson)), Orthanc::OrthancException); +// ASSERT_THROW(std::unique_ptr<OrthancStone::ICommand> command(factory.CreateFromJson(cmdJson)), Orthanc::OrthancException); //}