comparison OrthancStone/Sources/Volumes/VolumeSceneLayerSource.h @ 1606:874e178f34e9

- ViewportController now has weak ptr to Viewport - Measuring tools + related commands and all trackers now store only a weak_ptr to the Viewport and lock() on demand for usage - LayerHolder and FixedPoint aligner store only a weak_ptr to the Viewport, too - Fixed float/double warning in GrayscaleWindowingSceneTracker
author Benjamin Golinvaux <bgo@osimis.io>
date Wed, 28 Oct 2020 20:14:34 +0100
parents 8563ea5d8ae4
children 52b8b96cb55f
comparison
equal deleted inserted replaced
1605:b3c439d96d3e 1606:874e178f34e9
21 21
22 22
23 #pragma once 23 #pragma once
24 24
25 #include "../Scene2D/Scene2D.h" 25 #include "../Scene2D/Scene2D.h"
26 #include "../Viewport/IViewport.h"
26 #include "IVolumeSlicer.h" 27 #include "IVolumeSlicer.h"
27 28
28 #include <boost/shared_ptr.hpp> 29 #include <boost/shared_ptr.hpp>
29 30
30 namespace OrthancStone 31 namespace OrthancStone
38 cutting plane has been modified since the last call to "Update()". 39 cutting plane has been modified since the last call to "Update()".
39 */ 40 */
40 class VolumeSceneLayerSource : public boost::noncopyable 41 class VolumeSceneLayerSource : public boost::noncopyable
41 { 42 {
42 private: 43 private:
43 boost::shared_ptr<OrthancStone::IViewport> viewport_; 44 boost::weak_ptr<OrthancStone::IViewport> viewport_;
44 int layerDepth_; 45 int layerDepth_;
45 boost::shared_ptr<IVolumeSlicer> slicer_; 46 boost::shared_ptr<IVolumeSlicer> slicer_;
46 std::unique_ptr<ILayerStyleConfigurator> configurator_; 47 std::unique_ptr<ILayerStyleConfigurator> configurator_;
47 std::unique_ptr<CoordinateSystem3D> lastPlane_; 48 std::unique_ptr<CoordinateSystem3D> lastPlane_;
48 uint64_t lastRevision_; 49 uint64_t lastRevision_;
49 uint64_t lastConfiguratorRevision_; 50 uint64_t lastConfiguratorRevision_;
50 51
51 void ClearLayer(); 52 void ClearLayer();
52 53
54 /**
55 This will return a scoped lock to the viewport.
56 If the viewport does not exist anymore, then nullptr is returned.
57 */
58 IViewport::ILock* GetViewportLock();
59 IViewport::ILock* GetViewportLock() const;
60
53 public: 61 public:
54 VolumeSceneLayerSource(boost::shared_ptr<OrthancStone::IViewport> viewport, 62 VolumeSceneLayerSource(boost::weak_ptr<OrthancStone::IViewport> viewport,
55 int layerDepth, 63 int layerDepth,
56 const boost::shared_ptr<IVolumeSlicer>& slicer); 64 const boost::shared_ptr<IVolumeSlicer>& slicer);
57 65
58 ~VolumeSceneLayerSource(); 66 ~VolumeSceneLayerSource();
59 67