# HG changeset patch # User Sebastien Jodogne # Date 1712332206 -7200 # Node ID 8a1daa321afee119bbf1098b031a0e1db26de550 # Parent b6910092bccae449de5e55315177d8bb2d3b47fe cppcheck diff -r b6910092bcca -r 8a1daa321afe Sources/Plugin.cpp --- a/Sources/Plugin.cpp Fri Apr 05 08:25:17 2024 +0200 +++ b/Sources/Plugin.cpp Fri Apr 05 17:50:06 2024 +0200 @@ -23,24 +23,16 @@ #include "StructureSetGeometry.h" -#include "StructureSet.h" #include "STLToolbox.h" -#include "StructurePolygon.h" #include "VTKToolbox.h" -#include "Vector3D.h" -#include "Toolbox.h" -#include "Extent2D.h" + +#include #include "../Resources/Orthanc/Plugins/OrthancPluginCppWrapper.h" -#include - -#include #include -#include #include #include -#include #include #include @@ -182,38 +174,41 @@ #include -class XorFiller : public Orthanc::ImageProcessing::IPolygonFiller +namespace { -private: - Orthanc::ImageAccessor& target_; + class XorFiller : public Orthanc::ImageProcessing::IPolygonFiller + { + private: + Orthanc::ImageAccessor& target_; -public: - XorFiller(Orthanc::ImageAccessor& target) : - target_(target) - { - } + public: + explicit XorFiller(Orthanc::ImageAccessor& target) : + target_(target) + { + } - virtual void Fill(int y, - int x1, - int x2) ORTHANC_OVERRIDE - { - assert(x1 <= x2); - - if (y >= 0 && - y < static_cast(target_.GetHeight())) + virtual void Fill(int y, + int x1, + int x2) ORTHANC_OVERRIDE { - x1 = std::max(x1, 0); - x2 = std::min(x2, static_cast(target_.GetWidth()) - 1); + assert(x1 <= x2); - uint8_t* p = reinterpret_cast(target_.GetRow(y)) + x1; + if (y >= 0 && + y < static_cast(target_.GetHeight())) + { + x1 = std::max(x1, 0); + x2 = std::min(x2, static_cast(target_.GetWidth()) - 1); - for (int i = x1; i <= x2; i++, p++) - { - *p = (*p ^ 0xff); + uint8_t* p = reinterpret_cast(target_.GetRow(y)) + x1; + + for (int i = x1; i <= x2; i++, p++) + { + *p = (*p ^ 0xff); + } } } - } -}; + }; +} static Orthanc::ParsedDicomFile* LoadInstance(const std::string& instanceId) @@ -765,7 +760,7 @@ std::map dictionary; dictionary["HAS_CREATE_DICOM_STL"] = (hasCreateDicomStl_ ? "true" : "false"); - dictionary["SHOW_NIFTI_BUTTON"] = (configuration.GetBooleanValue("NIfTI", false) ? "true" : "false"); + dictionary["SHOW_NIFTI_BUTTON"] = (configuration.GetBooleanValue("EnableNIfTI", false) ? "true" : "false"); explorer = Orthanc::Toolbox::SubstituteVariables(explorer, dictionary); OrthancPlugins::ExtendOrthancExplorer(ORTHANC_PLUGIN_NAME, explorer); diff -r b6910092bcca -r 8a1daa321afe Sources/StructureSetGeometry.cpp --- a/Sources/StructureSetGeometry.cpp Fri Apr 05 08:25:17 2024 +0200 +++ b/Sources/StructureSetGeometry.cpp Fri Apr 05 17:50:06 2024 +0200 @@ -176,7 +176,7 @@ std::list::const_iterator it = candidates.begin(); size_t reference = *it; - it++; + ++it; while (it != candidates.end()) { @@ -190,7 +190,7 @@ next.push_back(*it); } - it++; + ++it; } if (first || diff -r b6910092bcca -r 8a1daa321afe Sources/VTKToolbox.cpp --- a/Sources/VTKToolbox.cpp Fri Apr 05 08:25:17 2024 +0200 +++ b/Sources/VTKToolbox.cpp Fri Apr 05 17:50:06 2024 +0200 @@ -216,7 +216,7 @@ nifti_image* image_; public: - NiftiHeader(const std::string& nifti) + explicit NiftiHeader(const std::string& nifti) { nifti_1_header header; if (nifti.size() < sizeof(header))