Mercurial > hg > orthanc-stone
comparison OrthancStone/Sources/Volumes/VolumeSceneLayerSource.h @ 1512:244ad1e4e76a
reorganization of folders
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 07 Jul 2020 16:21:02 +0200 |
parents | Framework/Volumes/VolumeSceneLayerSource.h@8635b333fa5b |
children | 85e117739eca |
comparison
equal
deleted
inserted
replaced
1511:9dfeee74c1e6 | 1512:244ad1e4e76a |
---|---|
1 /** | |
2 * Stone of Orthanc | |
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | |
4 * Department, University Hospital of Liege, Belgium | |
5 * Copyright (C) 2017-2020 Osimis S.A., Belgium | |
6 * | |
7 * This program is free software: you can redistribute it and/or | |
8 * modify it under the terms of the GNU Affero General Public License | |
9 * as published by the Free Software Foundation, either version 3 of | |
10 * the License, or (at your option) any later version. | |
11 * | |
12 * This program is distributed in the hope that it will be useful, but | |
13 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 * Affero General Public License for more details. | |
16 * | |
17 * You should have received a copy of the GNU Affero General Public License | |
18 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
19 **/ | |
20 | |
21 | |
22 #pragma once | |
23 | |
24 #include "../Scene2D/Scene2D.h" | |
25 #include "IVolumeSlicer.h" | |
26 | |
27 #include <boost/shared_ptr.hpp> | |
28 | |
29 namespace OrthancStone | |
30 { | |
31 class IViewport; | |
32 /** | |
33 This class applies one "volume slicer" to a "3D volume", in order | |
34 to create one "2D scene layer" that will be set onto the "2D | |
35 scene". The style of the layer can be fine-tuned using a "layer | |
36 style configurator". The class only changes the layer if the | |
37 cutting plane has been modified since the last call to "Update()". | |
38 */ | |
39 class VolumeSceneLayerSource : public boost::noncopyable | |
40 { | |
41 private: | |
42 boost::shared_ptr<OrthancStone::IViewport> viewport_; | |
43 int layerDepth_; | |
44 boost::shared_ptr<IVolumeSlicer> slicer_; | |
45 std::unique_ptr<ILayerStyleConfigurator> configurator_; | |
46 std::unique_ptr<CoordinateSystem3D> lastPlane_; | |
47 uint64_t lastRevision_; | |
48 uint64_t lastConfiguratorRevision_; | |
49 bool layerInScene_; | |
50 | |
51 void ClearLayer(); | |
52 | |
53 public: | |
54 VolumeSceneLayerSource(boost::shared_ptr<OrthancStone::IViewport> viewport, | |
55 int layerDepth, | |
56 const boost::shared_ptr<IVolumeSlicer>& slicer); | |
57 | |
58 ~VolumeSceneLayerSource(); | |
59 | |
60 const IVolumeSlicer& GetSlicer() const | |
61 { | |
62 return *slicer_; | |
63 } | |
64 | |
65 void RemoveConfigurator(); | |
66 | |
67 void SetConfigurator(ILayerStyleConfigurator* configurator); | |
68 | |
69 bool HasConfigurator() const | |
70 { | |
71 return configurator_.get() != NULL; | |
72 } | |
73 | |
74 ILayerStyleConfigurator& GetConfigurator() const; | |
75 | |
76 /** | |
77 Make sure the Scene2D is protected from concurrent accesses before | |
78 calling this method. | |
79 | |
80 If the scene that has been supplied to the ctor is part of an IViewport, | |
81 you can lock the whole viewport data (including scene) by means of the | |
82 IViewport::Lock method. | |
83 */ | |
84 void Update(const CoordinateSystem3D& plane); | |
85 }; | |
86 } |