Mercurial > hg > orthanc-stone
comparison Framework/Deprecated/Loaders/OrthancMultiframeVolumeLoader.cpp @ 1314:9b126de2cde2 broker
Since the observer system now uses shared_ptr and many registrations are
done in the constructors, and since we cannot called shared_from_this() in
the constructors, it is mandatory to split construction from registration.
This has been done by making many ctors protected and replacing them
by factory methods that directly return shared_ptrs + added PostConstructor
method when base classes perform shared_from_this() calls too.
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Mon, 16 Mar 2020 11:19:50 +0100 |
parents | 9bea7e15b519 |
children |
comparison
equal
deleted
inserted
replaced
1313:f30905f5d246 | 1314:9b126de2cde2 |
---|---|
524 { | 524 { |
525 throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer); | 525 throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer); |
526 } | 526 } |
527 } | 527 } |
528 | 528 |
529 | |
530 boost::shared_ptr<OrthancMultiframeVolumeLoader> | |
531 OrthancMultiframeVolumeLoader::Create( | |
532 OrthancStone::ILoadersContext& loadersContext, | |
533 boost::shared_ptr<OrthancStone::DicomVolumeImage> volume, | |
534 float outliersHalfRejectionRate /*= 0.0005*/) | |
535 { | |
536 boost::shared_ptr<OrthancMultiframeVolumeLoader> obj( | |
537 new OrthancMultiframeVolumeLoader( | |
538 loadersContext, | |
539 volume, | |
540 outliersHalfRejectionRate)); | |
541 obj->LoaderStateMachine::PostConstructor(); | |
542 return obj; | |
543 } | |
544 | |
529 OrthancMultiframeVolumeLoader::~OrthancMultiframeVolumeLoader() | 545 OrthancMultiframeVolumeLoader::~OrthancMultiframeVolumeLoader() |
530 { | 546 { |
531 LOG(TRACE) << "OrthancMultiframeVolumeLoader::~OrthancMultiframeVolumeLoader()"; | 547 LOG(TRACE) << "OrthancMultiframeVolumeLoader::~OrthancMultiframeVolumeLoader()"; |
532 } | 548 } |
533 | 549 |
534 | |
535 void OrthancMultiframeVolumeLoader::GetDistributionMinMax | 550 void OrthancMultiframeVolumeLoader::GetDistributionMinMax |
536 (float& minValue, float& maxValue) const | 551 (float& minValue, float& maxValue) const |
537 { | 552 { |
538 if (distributionRawMin_ == 0 && distributionRawMax_ == 0) | 553 if (distributionRawMin_ == 0 && distributionRawMax_ == 0) |
539 { | 554 { |