# HG changeset patch # User Benjamin Golinvaux # Date 1583762122 -3600 # Node ID 3d26447ddd2885a775495895a77cace8044325e9 # Parent 9bea7e15b519091eac6bc6b9e40e40eb79e94023 warning fixes + doc + indentation + header files in cmake for VC++ sln browsing diff -r 9bea7e15b519 -r 3d26447ddd28 Framework/Deprecated/Toolbox/MessagingToolbox.cpp --- a/Framework/Deprecated/Toolbox/MessagingToolbox.cpp Mon Mar 09 14:53:22 2020 +0100 +++ b/Framework/Deprecated/Toolbox/MessagingToolbox.cpp Mon Mar 09 14:55:22 2020 +0100 @@ -18,7 +18,6 @@ * along with this program. If not, see . **/ - #include "MessagingToolbox.h" #include @@ -30,9 +29,14 @@ #include #include + +// 'Json::Reader': Use CharReader and CharReaderBuilder instead +#pragma warning(disable:4996) + #include #include + namespace Deprecated { namespace MessagingToolbox diff -r 9bea7e15b519 -r 3d26447ddd28 Framework/Loaders/DicomResourcesLoader.cpp --- a/Framework/Loaders/DicomResourcesLoader.cpp Mon Mar 09 14:53:22 2020 +0100 +++ b/Framework/Loaders/DicomResourcesLoader.cpp Mon Mar 09 14:55:22 2020 +0100 @@ -810,6 +810,10 @@ { std::unique_ptr lock(context_.Lock()); + + // GetSharedObserver() means "this" (for use as an IObserver), as a + // shared_ptr + // The oracle will thus call "this" lock->Schedule(GetSharedObserver(), priority, command.release()); } } diff -r 9bea7e15b519 -r 3d26447ddd28 Framework/Loaders/GenericLoadersContext.h --- a/Framework/Loaders/GenericLoadersContext.h Mon Mar 09 14:53:22 2020 +0100 +++ b/Framework/Loaders/GenericLoadersContext.h Mon Mar 09 14:55:22 2020 +0100 @@ -44,7 +44,7 @@ boost::recursive_mutex mutex_; IObservable oracleObservable_; - std::unique_ptr oracle_; + std::unique_ptr oracle_; boost::shared_ptr scheduler_; // Necessary to keep the loaders persistent (including global diff -r 9bea7e15b519 -r 3d26447ddd28 Framework/Loaders/SeriesFramesLoader.cpp --- a/Framework/Loaders/SeriesFramesLoader.cpp Mon Mar 09 14:53:22 2020 +0100 +++ b/Framework/Loaders/SeriesFramesLoader.cpp Mon Mar 09 14:55:22 2020 +0100 @@ -170,7 +170,9 @@ size_t frameIndex = frames_.GetFrameIndex(payload.GetSeriesIndex()); std::unique_ptr decoded; - decoded.reset(Orthanc::DicomImageDecoder::Decode(dicom, frameIndex)); + decoded.reset(Orthanc::DicomImageDecoder::Decode( + dicom, + static_cast(frameIndex))); if (decoded.get() == NULL) { diff -r 9bea7e15b519 -r 3d26447ddd28 Framework/Messages/IObservable.h --- a/Framework/Messages/IObservable.h Mon Mar 09 14:53:22 2020 +0100 +++ b/Framework/Messages/IObservable.h Mon Mar 09 14:55:22 2020 +0100 @@ -43,7 +43,7 @@ public: virtual ~IObservable(); - // Takes ownsership of the callable + // Takes ownership of the callable void RegisterCallable(ICallable* callable); void BroadcastMessage(const IMessage& message); diff -r 9bea7e15b519 -r 3d26447ddd28 Framework/Scene2DViewport/LineMeasureTool.cpp --- a/Framework/Scene2DViewport/LineMeasureTool.cpp Mon Mar 09 14:53:22 2020 +0100 +++ b/Framework/Scene2DViewport/LineMeasureTool.cpp Mon Mar 09 14:55:22 2020 +0100 @@ -154,13 +154,6 @@ if (!HitTest(scenePos)) return boost::shared_ptr(); - /** - new EditLineMeasureTracker( - boost::shared_ptr measureTool; - MessageBroker & broker, - IViewport& viewport, - const PointerEvent & e); - */ boost::shared_ptr editLineMeasureTracker( new EditLineMeasureTracker(shared_from_this(), viewport_, e)); return editLineMeasureTracker; diff -r 9bea7e15b519 -r 3d26447ddd28 Framework/Viewport/SdlViewport.cpp --- a/Framework/Viewport/SdlViewport.cpp Mon Mar 09 14:53:22 2020 +0100 +++ b/Framework/Viewport/SdlViewport.cpp Mon Mar 09 14:55:22 2020 +0100 @@ -105,24 +105,21 @@ // "OpenGLContext" it references (*) ClearCompositor(); } - - + void SdlOpenGLViewport::Paint() { SdlLock lock(*this); lock.GetCompositor().Refresh(lock.GetController().GetScene()); } - - - void SdlOpenGLViewport::UpdateSize(unsigned int width, + + void SdlOpenGLViewport::UpdateSize(unsigned int width, unsigned int height) { // nothing to do in OpenGL, the OpenGLCompositor::UpdateSize will be called automatically SdlLock lock(*this); lock.Invalidate(); } - - + void SdlOpenGLViewport::ToggleMaximize() { // No need to call "Invalidate()" here, as "UpdateSize()" will @@ -130,9 +127,7 @@ SdlLock lock(*this); context_.ToggleMaximize(); } - - - + SdlCairoViewport::SdlCairoViewport(const char* title, unsigned int width, unsigned int height, diff -r 9bea7e15b519 -r 3d26447ddd28 Framework/Volumes/VolumeSceneLayerSource.h --- a/Framework/Volumes/VolumeSceneLayerSource.h Mon Mar 09 14:53:22 2020 +0100 +++ b/Framework/Volumes/VolumeSceneLayerSource.h Mon Mar 09 14:55:22 2020 +0100 @@ -38,13 +38,14 @@ class VolumeSceneLayerSource : public boost::noncopyable { private: - Scene2D& scene_; - int layerDepth_; - boost::shared_ptr slicer_; + Scene2D& scene_; + int layerDepth_; + boost::shared_ptr slicer_; std::unique_ptr configurator_; std::unique_ptr lastPlane_; - uint64_t lastRevision_; - uint64_t lastConfiguratorRevision_; + uint64_t lastRevision_; + uint64_t lastConfiguratorRevision_; + bool layerInScene_; void ClearLayer(); @@ -71,6 +72,14 @@ ILayerStyleConfigurator& GetConfigurator() const; + /** + Make sure the Scene2D is protected from concurrent accesses before + calling this method. + + If the scene that has been supplied to the ctor is part of an IViewport, + you can lock the whole viewport data (including scene) by means of the + IViewport::Lock method. + */ void Update(const CoordinateSystem3D& plane); }; } diff -r 9bea7e15b519 -r 3d26447ddd28 Resources/CMake/OrthancStoneConfiguration.cmake --- a/Resources/CMake/OrthancStoneConfiguration.cmake Mon Mar 09 14:53:22 2020 +0100 +++ b/Resources/CMake/OrthancStoneConfiguration.cmake Mon Mar 09 14:55:22 2020 +0100 @@ -532,11 +532,15 @@ ${ORTHANC_STONE_ROOT}/Framework/Loaders/SeriesMetadataLoader.cpp ${ORTHANC_STONE_ROOT}/Framework/Loaders/SeriesOrderedFrames.cpp ${ORTHANC_STONE_ROOT}/Framework/Loaders/SeriesThumbnailsLoader.cpp - + ${ORTHANC_STONE_ROOT}/Framework/Messages/ICallable.h ${ORTHANC_STONE_ROOT}/Framework/Messages/IMessage.h + ${ORTHANC_STONE_ROOT}/Framework/Messages/IMessageEmitter.h ${ORTHANC_STONE_ROOT}/Framework/Messages/IObservable.cpp + ${ORTHANC_STONE_ROOT}/Framework/Messages/IObservable.h ${ORTHANC_STONE_ROOT}/Framework/Messages/IObserver.h + ${ORTHANC_STONE_ROOT}/Framework/Messages/ObserverBase.h + ${ORTHANC_STONE_ROOT}/Framework/Oracle/GetOrthancImageCommand.cpp ${ORTHANC_STONE_ROOT}/Framework/Oracle/GetOrthancWebViewerJpegCommand.cpp ${ORTHANC_STONE_ROOT}/Framework/Oracle/HttpCommand.cpp diff -r 9bea7e15b519 -r 3d26447ddd28 Resources/Conventions.txt --- a/Resources/Conventions.txt Mon Mar 09 14:53:22 2020 +0100 +++ b/Resources/Conventions.txt Mon Mar 09 14:55:22 2020 +0100 @@ -63,7 +63,8 @@ * As we are targeting C++03 (for VS2008 and LSB compatibility), use "std::unique_ptr<>" and "boost::shared_ptr<>" (*not* - "std::shared_ptr<>"). + "std::shared_ptr<>"). We provide an implementation of std::unique_ptr for + pre-C++11 compilers. * The fact of transfering the ownership of one object to another must be tagged by naming the method "Acquire...()", and by providing a