Mercurial > hg > orthanc-stone
comparison Applications/StoneWebViewer/WebAssembly/StoneWebViewer.cpp @ 1573:32e0c007789d
cppcheck
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 21 Sep 2020 18:28:34 +0200 |
parents | b8b4cb58a874 |
children | e4a52cbbdd70 |
comparison
equal
deleted
inserted
replaced
1572:1b3039384972 | 1573:32e0c007789d |
---|---|
149 boost::shared_ptr<OrthancStone::LoadedDicomResources> series_; | 149 boost::shared_ptr<OrthancStone::LoadedDicomResources> series_; |
150 boost::shared_ptr<OrthancStone::DicomResourcesLoader> resourcesLoader_; | 150 boost::shared_ptr<OrthancStone::DicomResourcesLoader> resourcesLoader_; |
151 boost::shared_ptr<OrthancStone::SeriesThumbnailsLoader> thumbnailsLoader_; | 151 boost::shared_ptr<OrthancStone::SeriesThumbnailsLoader> thumbnailsLoader_; |
152 boost::shared_ptr<OrthancStone::SeriesMetadataLoader> metadataLoader_; | 152 boost::shared_ptr<OrthancStone::SeriesMetadataLoader> metadataLoader_; |
153 | 153 |
154 ResourcesLoader(const OrthancStone::DicomSource& source) : | 154 explicit ResourcesLoader(const OrthancStone::DicomSource& source) : |
155 source_(source), | 155 source_(source), |
156 pending_(0), | 156 pending_(0), |
157 studies_(new OrthancStone::LoadedDicomResources(Orthanc::DICOM_TAG_STUDY_INSTANCE_UID)), | 157 studies_(new OrthancStone::LoadedDicomResources(Orthanc::DICOM_TAG_STUDY_INSTANCE_UID)), |
158 series_(new OrthancStone::LoadedDicomResources(Orthanc::DICOM_TAG_SERIES_INSTANCE_UID)) | 158 series_(new OrthancStone::LoadedDicomResources(Orthanc::DICOM_TAG_SERIES_INSTANCE_UID)) |
159 { | 159 { |
383 quality_(quality) | 383 quality_(quality) |
384 { | 384 { |
385 assert(image != NULL); | 385 assert(image != NULL); |
386 } | 386 } |
387 | 387 |
388 virtual size_t GetMemoryUsage() const | 388 virtual size_t GetMemoryUsage() const ORTHANC_OVERRIDE |
389 { | 389 { |
390 assert(image_.get() != NULL); | 390 assert(image_.get() != NULL); |
391 return (image_->GetBytesPerPixel() * image_->GetPitch() * image_->GetHeight()); | 391 return (image_->GetBytesPerPixel() * image_->GetPitch() * image_->GetHeight()); |
392 } | 392 } |
393 | 393 |
703 return ((framesCount_ == 0 && frame == 0) || | 703 return ((framesCount_ == 0 && frame == 0) || |
704 (framesCount_ > 0 && frame >= 0 && frame < framesCount_)); | 704 (framesCount_ > 0 && frame >= 0 && frame < framesCount_)); |
705 } | 705 } |
706 | 706 |
707 public: | 707 public: |
708 SeriesCursor(size_t framesCount) : | 708 explicit SeriesCursor(size_t framesCount) : |
709 framesCount_(framesCount), | 709 framesCount_(framesCount), |
710 currentFrame_(framesCount / 2), // Start at the middle frame | 710 currentFrame_(framesCount / 2), // Start at the middle frame |
711 isCircular_(false), | 711 isCircular_(false), |
712 lastAction_(Action_None) | 712 lastAction_(Action_None) |
713 { | 713 { |
790 double pixelSpacingX_; | 790 double pixelSpacingX_; |
791 double pixelSpacingY_; | 791 double pixelSpacingY_; |
792 OrthancStone::Extent2D extent_; | 792 OrthancStone::Extent2D extent_; |
793 | 793 |
794 public: | 794 public: |
795 FrameGeometry() : | 795 explicit FrameGeometry() : |
796 isValid_(false) | 796 isValid_(false), |
797 { | 797 pixelSpacingX_(1), |
798 } | 798 pixelSpacingY_(1) |
799 | 799 { |
800 FrameGeometry(const Orthanc::DicomMap& tags) : | 800 } |
801 | |
802 explicit FrameGeometry(const Orthanc::DicomMap& tags) : | |
801 isValid_(false), | 803 isValid_(false), |
802 coordinates_(tags) | 804 coordinates_(tags) |
803 { | 805 { |
804 if (!tags.LookupStringValue( | 806 if (!tags.LookupStringValue( |
805 frameOfReferenceUid_, Orthanc::DICOM_TAG_FRAME_OF_REFERENCE_UID, false)) | 807 frameOfReferenceUid_, Orthanc::DICOM_TAG_FRAME_OF_REFERENCE_UID, false)) |
943 { | 945 { |
944 private: | 946 private: |
945 boost::shared_ptr<ViewerViewport> viewport_; | 947 boost::shared_ptr<ViewerViewport> viewport_; |
946 | 948 |
947 public: | 949 public: |
948 ICommand(boost::shared_ptr<ViewerViewport> viewport) : | 950 explicit ICommand(boost::shared_ptr<ViewerViewport> viewport) : |
949 viewport_(viewport) | 951 viewport_(viewport) |
950 { | 952 { |
951 if (viewport == NULL) | 953 if (viewport == NULL) |
952 { | 954 { |
953 throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer); | 955 throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer); |
981 }; | 983 }; |
982 | 984 |
983 class SetDefaultWindowingCommand : public ICommand | 985 class SetDefaultWindowingCommand : public ICommand |
984 { | 986 { |
985 public: | 987 public: |
986 SetDefaultWindowingCommand(boost::shared_ptr<ViewerViewport> viewport) : | 988 explicit SetDefaultWindowingCommand(boost::shared_ptr<ViewerViewport> viewport) : |
987 ICommand(viewport) | 989 ICommand(viewport) |
988 { | 990 { |
989 } | 991 } |
990 | 992 |
991 virtual void Handle(const OrthancStone::DicomResourcesLoader::SuccessMessage& message) const ORTHANC_OVERRIDE | 993 virtual void Handle(const OrthancStone::DicomResourcesLoader::SuccessMessage& message) const ORTHANC_OVERRIDE |