Mercurial > hg > orthanc-stone
annotate OrthancStone/Sources/Volumes/VolumeSceneLayerSource.h @ 1596:4fb8fdf03314
removed annoying whitespace
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 26 Oct 2020 17:51:42 +0100 |
parents | 85e117739eca |
children | 8563ea5d8ae4 |
rev | line source |
---|---|
815 | 1 /** |
2 * Stone of Orthanc | |
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | |
4 * Department, University Hospital of Liege, Belgium | |
1270
2d8ab34c8c91
upgrade to year 2020
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
934
diff
changeset
|
5 * Copyright (C) 2017-2020 Osimis S.A., Belgium |
815 | 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. | |
1596
4fb8fdf03314
removed annoying whitespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1571
diff
changeset
|
16 * |
815 | 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 { | |
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.
Benjamin Golinvaux <bgo@osimis.io>
parents:
1345
diff
changeset
|
31 class IViewport; |
815 | 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()". | |
921
81d30cd93b65
Ability to ask the loader for the geometry in PULL mode (when subscribing to the messages is not possible) + small changes (removed const/ref qualifiers for boost::shared_ptr param, added traces, doc change)
Benjamin Golinvaux <bgo@osimis.io>
parents:
815
diff
changeset
|
38 */ |
815 | 39 class VolumeSceneLayerSource : public boost::noncopyable |
40 { | |
41 private: | |
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.
Benjamin Golinvaux <bgo@osimis.io>
parents:
1345
diff
changeset
|
42 boost::shared_ptr<OrthancStone::IViewport> viewport_; |
1311
3d26447ddd28
warning fixes + doc + indentation + header files in cmake for VC++ sln browsing
Benjamin Golinvaux <bgo@osimis.io>
parents:
1298
diff
changeset
|
43 int layerDepth_; |
3d26447ddd28
warning fixes + doc + indentation + header files in cmake for VC++ sln browsing
Benjamin Golinvaux <bgo@osimis.io>
parents:
1298
diff
changeset
|
44 boost::shared_ptr<IVolumeSlicer> slicer_; |
1298
8a0a62189f46
replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1270
diff
changeset
|
45 std::unique_ptr<ILayerStyleConfigurator> configurator_; |
8a0a62189f46
replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1270
diff
changeset
|
46 std::unique_ptr<CoordinateSystem3D> lastPlane_; |
1311
3d26447ddd28
warning fixes + doc + indentation + header files in cmake for VC++ sln browsing
Benjamin Golinvaux <bgo@osimis.io>
parents:
1298
diff
changeset
|
47 uint64_t lastRevision_; |
3d26447ddd28
warning fixes + doc + indentation + header files in cmake for VC++ sln browsing
Benjamin Golinvaux <bgo@osimis.io>
parents:
1298
diff
changeset
|
48 uint64_t lastConfiguratorRevision_; |
815 | 49 |
50 void ClearLayer(); | |
51 | |
52 public: | |
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.
Benjamin Golinvaux <bgo@osimis.io>
parents:
1345
diff
changeset
|
53 VolumeSceneLayerSource(boost::shared_ptr<OrthancStone::IViewport> viewport, |
815 | 54 int layerDepth, |
55 const boost::shared_ptr<IVolumeSlicer>& slicer); | |
56 | |
934
094d10ed7ec2
VolumeSceneLayerSource dtor now clears the layer
Benjamin Golinvaux <bgo@osimis.io>
parents:
921
diff
changeset
|
57 ~VolumeSceneLayerSource(); |
094d10ed7ec2
VolumeSceneLayerSource dtor now clears the layer
Benjamin Golinvaux <bgo@osimis.io>
parents:
921
diff
changeset
|
58 |
815 | 59 const IVolumeSlicer& GetSlicer() const |
60 { | |
61 return *slicer_; | |
62 } | |
63 | |
64 void RemoveConfigurator(); | |
65 | |
66 void SetConfigurator(ILayerStyleConfigurator* configurator); | |
67 | |
68 bool HasConfigurator() const | |
69 { | |
70 return configurator_.get() != NULL; | |
71 } | |
72 | |
73 ILayerStyleConfigurator& GetConfigurator() const; | |
74 | |
1311
3d26447ddd28
warning fixes + doc + indentation + header files in cmake for VC++ sln browsing
Benjamin Golinvaux <bgo@osimis.io>
parents:
1298
diff
changeset
|
75 /** |
3d26447ddd28
warning fixes + doc + indentation + header files in cmake for VC++ sln browsing
Benjamin Golinvaux <bgo@osimis.io>
parents:
1298
diff
changeset
|
76 Make sure the Scene2D is protected from concurrent accesses before |
3d26447ddd28
warning fixes + doc + indentation + header files in cmake for VC++ sln browsing
Benjamin Golinvaux <bgo@osimis.io>
parents:
1298
diff
changeset
|
77 calling this method. |
3d26447ddd28
warning fixes + doc + indentation + header files in cmake for VC++ sln browsing
Benjamin Golinvaux <bgo@osimis.io>
parents:
1298
diff
changeset
|
78 |
3d26447ddd28
warning fixes + doc + indentation + header files in cmake for VC++ sln browsing
Benjamin Golinvaux <bgo@osimis.io>
parents:
1298
diff
changeset
|
79 If the scene that has been supplied to the ctor is part of an IViewport, |
3d26447ddd28
warning fixes + doc + indentation + header files in cmake for VC++ sln browsing
Benjamin Golinvaux <bgo@osimis.io>
parents:
1298
diff
changeset
|
80 you can lock the whole viewport data (including scene) by means of the |
3d26447ddd28
warning fixes + doc + indentation + header files in cmake for VC++ sln browsing
Benjamin Golinvaux <bgo@osimis.io>
parents:
1298
diff
changeset
|
81 IViewport::Lock method. |
3d26447ddd28
warning fixes + doc + indentation + header files in cmake for VC++ sln browsing
Benjamin Golinvaux <bgo@osimis.io>
parents:
1298
diff
changeset
|
82 */ |
1345
0d6a01ffa1dd
Clean version of the hack commited in
Benjamin Golinvaux <bgo@osimis.io>
parents:
1344
diff
changeset
|
83 void Update(const CoordinateSystem3D& plane); |
815 | 84 }; |
85 } |