comparison Framework/Volumes/VolumeSceneLayerSource.cpp @ 1324:4d8d642f7036 broker

Added a NullLayer scene layer type that allows "booking" a scene depth entry.
author Benjamin Golinvaux <bgo@osimis.io>
date Tue, 24 Mar 2020 16:24:26 +0100
parents 0da659f8579c
children 00c8322bbe69
comparison
equal deleted inserted replaced
1323:c0af7657d398 1324:4d8d642f7036
18 * along with this program. If not, see <http://www.gnu.org/licenses/>. 18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 **/ 19 **/
20 20
21 21
22 #include "VolumeSceneLayerSource.h" 22 #include "VolumeSceneLayerSource.h"
23
24 #include "../Scene2D/NullLayer.h"
25 #include "../StoneException.h"
23 26
24 #include <Core/OrthancException.h> 27 #include <Core/OrthancException.h>
25 28
26 namespace OrthancStone 29 namespace OrthancStone
27 { 30 {
52 { 55 {
53 if (slicer == NULL) 56 if (slicer == NULL)
54 { 57 {
55 throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer); 58 throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer);
56 } 59 }
60 ORTHANC_ASSERT(!scene_.HasLayer(layerDepth_));
61
62 // we need to book the scene layer depth by adding a dummy layer
63 std::unique_ptr<NullLayer> nullLayer(new NullLayer);
64 scene_.SetLayer(layerDepth_,nullLayer.release());
57 } 65 }
58 66
59 VolumeSceneLayerSource::~VolumeSceneLayerSource() 67 VolumeSceneLayerSource::~VolumeSceneLayerSource()
60 { 68 {
61 ClearLayer(); 69 ClearLayer();