Mercurial > hg > orthanc-stone
comparison Framework/Radiography/RadiographyScene.cpp @ 428:751fb354149e am-vsol-upgrade
ability to change the scene of the RadiographyWidget
author | am@osimis.io |
---|---|
date | Wed, 28 Nov 2018 10:44:28 +0100 |
parents | 660fe6f6bf4a |
children | b85f635f1eb5 |
comparison
equal
deleted
inserted
replaced
426:660fe6f6bf4a | 428:751fb354149e |
---|---|
410 throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer); | 410 throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer); |
411 } | 411 } |
412 | 412 |
413 std::auto_ptr<RadiographyLayer> raii(layer); | 413 std::auto_ptr<RadiographyLayer> raii(layer); |
414 | 414 |
415 LOG(INFO) << "Registering layer: " << countLayers_; | |
416 | |
415 size_t index = countLayers_++; | 417 size_t index = countLayers_++; |
416 raii->SetIndex(index); | 418 raii->SetIndex(index); |
417 layers_[index] = raii.release(); | 419 layers_[index] = raii.release(); |
418 | 420 |
419 EmitMessage(GeometryChangedMessage(*this)); | 421 EmitMessage(GeometryChangedMessage(*this)); |
443 } | 445 } |
444 } | 446 } |
445 | 447 |
446 void RadiographyScene::RemoveLayer(size_t layerIndex) | 448 void RadiographyScene::RemoveLayer(size_t layerIndex) |
447 { | 449 { |
450 LOG(INFO) << "Removing layer: " << layerIndex; | |
451 | |
448 if (layerIndex > countLayers_) | 452 if (layerIndex > countLayers_) |
449 { | 453 { |
450 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); | 454 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); |
451 } | 455 } |
452 delete layers_[layerIndex]; | 456 delete layers_[layerIndex]; |
453 layers_.erase(layerIndex); | 457 layers_.erase(layerIndex); |
454 countLayers_--; | 458 countLayers_--; |
459 LOG(INFO) << "Removing layer, there are now : " << countLayers_ << " layers"; | |
455 } | 460 } |
456 | 461 |
457 RadiographyLayer& RadiographyScene::GetLayer(size_t layerIndex) | 462 RadiographyLayer& RadiographyScene::GetLayer(size_t layerIndex) |
458 { | 463 { |
459 if (layerIndex > countLayers_) | 464 if (layerIndex > countLayers_) |