Mercurial > hg > orthanc-stone
comparison Framework/Volumes/VolumeSceneLayerSource.h @ 1433:8635b333fa5b
[BREAKING] VolumeSceneLayerSource now locks the viewport properly before using the scene. The ctor now accepts the viewport instead of a ref. to the scene. RtViewer sample has been adapted accordingly.
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Tue, 19 May 2020 13:22:48 +0200 |
parents | 0d6a01ffa1dd |
children |
comparison
equal
deleted
inserted
replaced
1431:1eaf19af15bf | 1433:8635b333fa5b |
---|---|
26 | 26 |
27 #include <boost/shared_ptr.hpp> | 27 #include <boost/shared_ptr.hpp> |
28 | 28 |
29 namespace OrthancStone | 29 namespace OrthancStone |
30 { | 30 { |
31 class IViewport; | |
31 /** | 32 /** |
32 This class applies one "volume slicer" to a "3D volume", in order | 33 This class applies one "volume slicer" to a "3D volume", in order |
33 to create one "2D scene layer" that will be set onto the "2D | 34 to create one "2D scene layer" that will be set onto the "2D |
34 scene". The style of the layer can be fine-tuned using a "layer | 35 scene". The style of the layer can be fine-tuned using a "layer |
35 style configurator". The class only changes the layer if the | 36 style configurator". The class only changes the layer if the |
36 cutting plane has been modified since the last call to "Update()". | 37 cutting plane has been modified since the last call to "Update()". |
37 */ | 38 */ |
38 class VolumeSceneLayerSource : public boost::noncopyable | 39 class VolumeSceneLayerSource : public boost::noncopyable |
39 { | 40 { |
40 private: | 41 private: |
41 Scene2D& scene_; | 42 boost::shared_ptr<OrthancStone::IViewport> viewport_; |
42 int layerDepth_; | 43 int layerDepth_; |
43 boost::shared_ptr<IVolumeSlicer> slicer_; | 44 boost::shared_ptr<IVolumeSlicer> slicer_; |
44 std::unique_ptr<ILayerStyleConfigurator> configurator_; | 45 std::unique_ptr<ILayerStyleConfigurator> configurator_; |
45 std::unique_ptr<CoordinateSystem3D> lastPlane_; | 46 std::unique_ptr<CoordinateSystem3D> lastPlane_; |
46 uint64_t lastRevision_; | 47 uint64_t lastRevision_; |
48 bool layerInScene_; | 49 bool layerInScene_; |
49 | 50 |
50 void ClearLayer(); | 51 void ClearLayer(); |
51 | 52 |
52 public: | 53 public: |
53 VolumeSceneLayerSource(Scene2D& scene, | 54 VolumeSceneLayerSource(boost::shared_ptr<OrthancStone::IViewport> viewport, |
54 int layerDepth, | 55 int layerDepth, |
55 const boost::shared_ptr<IVolumeSlicer>& slicer); | 56 const boost::shared_ptr<IVolumeSlicer>& slicer); |
56 | 57 |
57 ~VolumeSceneLayerSource(); | 58 ~VolumeSceneLayerSource(); |
58 | 59 |