# HG changeset patch # User Sebastien Jodogne # Date 1594046860 -7200 # Node ID 169adf9090a60e1d548572728c55e68d47269e76 # Parent f88265c3f8a0d9f1e0ae4cf4a45af587dbc880ac replacing deprecated std::auto_ptr by std::unique_ptr diff -r f88265c3f8a0 -r 169adf9090a6 Samples/Common/RtViewerView.cpp --- a/Samples/Common/RtViewerView.cpp Tue Jun 30 22:00:38 2020 +0200 +++ b/Samples/Common/RtViewerView.cpp Mon Jul 06 16:47:40 2020 +0200 @@ -48,6 +48,7 @@ #include "../../Framework/Volumes/VolumeSceneLayerSource.h" // Orthanc +#include // For std::unique_ptr<> #include #include @@ -286,7 +287,7 @@ /** Configure the CT */ - std::auto_ptr style(new GrayscaleStyleConfigurator); + std::unique_ptr style(new GrayscaleStyleConfigurator); style->SetLinearInterpolation(true); this->SetCtVolumeSlicer(ctLoader, style.release()); diff -r f88265c3f8a0 -r 169adf9090a6 Samples/Sdl/RtViewer/RtViewerSdl.cpp --- a/Samples/Sdl/RtViewer/RtViewerSdl.cpp Tue Jun 30 22:00:38 2020 +0200 +++ b/Samples/Sdl/RtViewer/RtViewerSdl.cpp Mon Jul 06 16:47:40 2020 +0200 @@ -32,6 +32,7 @@ #include "../../../Framework/StoneInitialization.h" // Orthanc (a.o. for screenshot capture) +#include // For std::unique_ptr<> #include #include #include @@ -360,7 +361,7 @@ boost::shared_ptr view = GetViewFromWindowId( views, sdlEvent.window.windowID); - std::auto_ptr lock(view->GetViewport()->Lock()); + std::unique_ptr lock(view->GetViewport()->Lock()); if (lock->HasCompositor()) { OrthancStone::PointerEvent p; diff -r f88265c3f8a0 -r 169adf9090a6 Samples/Sdl/SingleFrameViewer/SdlSimpleViewer.cpp --- a/Samples/Sdl/SingleFrameViewer/SdlSimpleViewer.cpp Tue Jun 30 22:00:38 2020 +0200 +++ b/Samples/Sdl/SingleFrameViewer/SdlSimpleViewer.cpp Mon Jul 06 16:47:40 2020 +0200 @@ -29,6 +29,7 @@ #include "../../../Framework/StoneInitialization.h" #include "../../../Framework/Viewport/SdlViewport.h" +#include // For std::unique_ptr<> #include #include @@ -198,7 +199,7 @@ event.type == SDL_MOUSEMOTION || event.type == SDL_MOUSEBUTTONUP) { - std::auto_ptr lock(viewport->Lock()); + std::unique_ptr lock(viewport->Lock()); if (lock->HasCompositor()) { OrthancStone::PointerEvent p; diff -r f88265c3f8a0 -r 169adf9090a6 Samples/Sdl/SingleFrameViewer/SdlSimpleViewerApplication.h --- a/Samples/Sdl/SingleFrameViewer/SdlSimpleViewerApplication.h Tue Jun 30 22:00:38 2020 +0200 +++ b/Samples/Sdl/SingleFrameViewer/SdlSimpleViewerApplication.h Mon Jul 06 16:47:40 2020 +0200 @@ -27,6 +27,8 @@ #include "../../../Framework/Loaders/SeriesFramesLoader.h" #include "../../../Framework/Loaders/SeriesThumbnailsLoader.h" +#include // For std::unique_ptr<> + #include @@ -56,7 +58,7 @@ boost::shared_ptr application(new SdlSimpleViewerApplication(context, viewport)); { - std::auto_ptr lock(context.Lock()); + std::unique_ptr lock(context.Lock()); application->dicomLoader_ = DicomResourcesLoader::Create(*lock); } @@ -67,7 +69,7 @@ void LoadOrthancFrame(const DicomSource& source, const std::string& instanceId, unsigned int frame) { - std::auto_ptr lock(context_.Lock()); + std::unique_ptr lock(context_.Lock()); dicomLoader_->ScheduleLoadOrthancResource(boost::make_shared(Orthanc::DICOM_TAG_SOP_INSTANCE_UID), 0, source, Orthanc::ResourceType_Instance, instanceId, @@ -81,7 +83,7 @@ const std::string& sopInstanceUid, unsigned int frame) { - std::auto_ptr lock(context_.Lock()); + std::unique_ptr lock(context_.Lock()); // We first must load the "/metadata" to know the number of frames dicomLoader_->ScheduleGetDicomWeb( @@ -93,7 +95,7 @@ void FitContent() { - std::auto_ptr lock(viewport_->Lock()); + std::unique_ptr lock(viewport_->Lock()); lock->GetCompositor().FitContent(lock->GetController().GetScene()); lock->Invalidate(); } @@ -117,12 +119,12 @@ << message.GetImage().GetWidth() << "x" << message.GetImage().GetHeight() << " " << Orthanc::EnumerationToString(message.GetImage().GetFormat()); - std::auto_ptr layer( + std::unique_ptr layer( message.GetInstanceParameters().CreateTexture(message.GetImage())); layer->SetLinearInterpolation(true); { - std::auto_ptr lock(viewport_->Lock()); + std::unique_ptr lock(viewport_->Lock()); lock->GetController().GetScene().SetLayer(0, layer.release()); lock->GetCompositor().FitContent(lock->GetController().GetScene()); lock->Invalidate(); @@ -139,7 +141,7 @@ //message.GetResources()->GetResource(0).Print(stdout); { - std::auto_ptr lock(context_.Lock()); + std::unique_ptr lock(context_.Lock()); SeriesFramesLoader::Factory f(*message.GetResources()); framesLoader_ = boost::dynamic_pointer_cast( diff -r f88265c3f8a0 -r 169adf9090a6 Samples/WebAssembly/SingleFrameViewer/SingleFrameViewer.cpp --- a/Samples/WebAssembly/SingleFrameViewer/SingleFrameViewer.cpp Tue Jun 30 22:00:38 2020 +0200 +++ b/Samples/WebAssembly/SingleFrameViewer/SingleFrameViewer.cpp Mon Jul 06 16:47:40 2020 +0200 @@ -25,6 +25,7 @@ #include "../../../Framework/StoneException.h" #include "../../../Framework/StoneInitialization.h" +#include // For std::unique_ptr<> #include #include @@ -66,7 +67,7 @@ { } -static std::auto_ptr context_; +static std::unique_ptr context_; static boost::shared_ptr application_; extern "C" diff -r f88265c3f8a0 -r 169adf9090a6 Samples/WebAssembly/SingleFrameViewer/SingleFrameViewerApplication.h --- a/Samples/WebAssembly/SingleFrameViewer/SingleFrameViewerApplication.h Tue Jun 30 22:00:38 2020 +0200 +++ b/Samples/WebAssembly/SingleFrameViewer/SingleFrameViewerApplication.h Mon Jul 06 16:47:40 2020 +0200 @@ -27,6 +27,8 @@ #include "../../../Framework/Loaders/SeriesThumbnailsLoader.h" #include "../../../Framework/Viewport/IViewport.h" +#include // For std::unique_ptr<> + #include @@ -53,12 +55,12 @@ << message.GetImage().GetWidth() << "x" << message.GetImage().GetHeight() << " " << Orthanc::EnumerationToString(message.GetImage().GetFormat()); - std::auto_ptr layer( + std::unique_ptr layer( message.GetInstanceParameters().CreateTexture(message.GetImage())); layer->SetLinearInterpolation(true); { - std::auto_ptr lock(viewport_->Lock()); + std::unique_ptr lock(viewport_->Lock()); lock->GetController().GetScene().SetLayer(0, layer.release()); lock->GetCompositor().FitContent(lock->GetController().GetScene()); lock->Invalidate(); @@ -75,7 +77,7 @@ //message.GetResources()->GetResource(0).Print(stdout); { - std::auto_ptr lock(context_.Lock()); + std::unique_ptr lock(context_.Lock()); SeriesFramesLoader::Factory f(*message.GetResources()); framesLoader_ = boost::dynamic_pointer_cast(f.Create(*lock)); @@ -100,7 +102,7 @@ boost::shared_ptr application(new Application(context, viewport)); { - std::auto_ptr lock(context.Lock()); + std::unique_ptr lock(context.Lock()); application->dicomLoader_ = DicomResourcesLoader::Create(*lock); } @@ -113,7 +115,7 @@ const std::string& instanceId, unsigned int frame) { - std::auto_ptr lock(context_.Lock()); + std::unique_ptr lock(context_.Lock()); dicomLoader_->ScheduleLoadOrthancResource( boost::make_shared(Orthanc::DICOM_TAG_SOP_INSTANCE_UID), @@ -127,7 +129,7 @@ const std::string& sopInstanceUid, unsigned int frame) { - std::auto_ptr lock(context_.Lock()); + std::unique_ptr lock(context_.Lock()); // We first must load the "/metadata" to know the number of frames dicomLoader_->ScheduleGetDicomWeb( @@ -138,7 +140,7 @@ void FitContent() { - std::auto_ptr lock(viewport_->Lock()); + std::unique_ptr lock(viewport_->Lock()); lock->GetCompositor().FitContent(lock->GetController().GetScene()); lock->Invalidate(); } @@ -174,7 +176,7 @@ }; ILoadersContext& context_; - std::auto_ptr observer_; + std::unique_ptr observer_; bool loadThumbnails_; DicomSource source_; std::set scheduledSeries_; @@ -310,7 +312,7 @@ application->loadThumbnails_ = loadThumbnails; { - std::auto_ptr lock(context.Lock()); + std::unique_ptr lock(context.Lock()); application->resourcesLoader_ = DicomResourcesLoader::Create(*lock); @@ -337,7 +339,7 @@ void AddDicomAllSeries() { - std::auto_ptr lock(context_.Lock()); + std::unique_ptr lock(context_.Lock()); if (source_.IsDicomWeb()) { @@ -348,7 +350,7 @@ } else if (source_.IsOrthanc()) { - std::auto_ptr command(new OrthancRestApiCommand); + std::unique_ptr command(new OrthancRestApiCommand); command->SetMethod(Orthanc::HttpMethod_Get); command->SetUri("/series"); lock->Schedule(GetSharedObserver(), PRIORITY_ADD_RESOURCES, command.release()); @@ -374,7 +376,7 @@ std::set tags; { - std::auto_ptr lock(context_.Lock()); + std::unique_ptr lock(context_.Lock()); resourcesLoader_->ScheduleQido(loadedStudies_, PRIORITY_ADD_RESOURCES, source_, Orthanc::ResourceType_Study, filter, tags, CreatePayload(Type_DicomWeb)); @@ -385,7 +387,7 @@ } else if (source_.IsOrthanc()) { - std::auto_ptr command(new OrthancRestApiCommand); + std::unique_ptr command(new OrthancRestApiCommand); command->SetMethod(Orthanc::HttpMethod_Post); command->SetUri("/tools/find"); @@ -396,7 +398,7 @@ command->SetBody(body); { - std::auto_ptr lock(context_.Lock()); + std::unique_ptr lock(context_.Lock()); lock->Schedule(GetSharedObserver(), PRIORITY_ADD_RESOURCES, command.release()); } } @@ -412,7 +414,7 @@ { std::set tags; - std::auto_ptr lock(context_.Lock()); + std::unique_ptr lock(context_.Lock()); if (scheduledStudies_.find(studyInstanceUid) == scheduledStudies_.end()) { @@ -443,7 +445,7 @@ } else if (source_.IsOrthanc()) { - std::auto_ptr command(new OrthancRestApiCommand); + std::unique_ptr command(new OrthancRestApiCommand); command->SetMethod(Orthanc::HttpMethod_Post); command->SetUri("/tools/find"); @@ -467,7 +469,7 @@ { if (source_.IsOrthanc()) { - std::auto_ptr lock(context_.Lock()); + std::unique_ptr lock(context_.Lock()); resourcesLoader_->ScheduleLoadOrthancResources( loadedSeries_, PRIORITY_ADD_RESOURCES, source_, Orthanc::ResourceType_Study, orthancId, Orthanc::ResourceType_Series, @@ -484,7 +486,7 @@ { if (source_.IsOrthanc()) { - std::auto_ptr lock(context_.Lock()); + std::unique_ptr lock(context_.Lock()); resourcesLoader_->ScheduleLoadOrthancResource( loadedSeries_, PRIORITY_ADD_RESOURCES, source_, Orthanc::ResourceType_Series, orthancId,