Skip to content

Added feature level-sets and dependencies#177

Open
PetiteViking wants to merge 16 commits into
masterfrom
feature/featurelevelsets
Open

Added feature level-sets and dependencies#177
PetiteViking wants to merge 16 commits into
masterfrom
feature/featurelevelsets

Conversation

@PetiteViking

Copy link
Copy Markdown
Contributor

Before I go, there is some code which I think would be nice to have available for the public. Unfortunately, I will not have time to put too much time into this so maybe we can make it a combined effort.

The code I added here includes some volume operations such as reduction, min/max, etc, implemented using compute shaders and the feature level-sets (FLS), also implemented using compute shaders.

Everything works well enough to use it for standard cases (floating-point input fields). There are some things though that might need some attention.

One things that comes to my mind is the injection of implicit functions into the shader code for FLS. Right now I have a number of placeholders and do a simple string replace. Maybe this is better done with Peter's new shader snippet thingy.

Another thing is that I have also not handled anything other than 32 bit floating point volumes as input since that is all I ever needed. Maybe dispatching should be added here.

In the shader code for volume reduction you can see that I tried using different samplers for different input data. The code compiles fine but the shader won't work for certain inputs (IIRC integer >16 bit).

I wrote a fair bit of documentation but I haven't checked for completeness.

@github-actions

github-actions Bot commented Jan 23, 2025

Copy link
Copy Markdown

Cpp-Linter Report ⚠️

Some files did not pass the configured checks!

clang-format (v19.1.7) reports: 3 file(s) not formatted
  • misc/computeutils/src/algorithm/volumechannelsplitgl.cpp
  • misc/computeutils/src/processors/volumeminmaxglprocessor.cpp
  • misc/computeutils/src/processors/volumeshrinktonormalrangeglprocessor.cpp
clang-tidy (v19.1.7) reports: 78 concern(s)
  • misc/computeutils/include/inviwo/computeutils/algorithm/volumechannelsplitgl.h:42:35: warning: [cppcoreguidelines-special-member-functions]

    class 'VolumeChannelSplitGL' defines a default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator

       42 | class IVW_MODULE_COMPUTEUTILS_API VolumeChannelSplitGL {
          |                                   ^
  • misc/computeutils/include/inviwo/computeutils/algorithm/volumechannelsplitgl.h:45:5: warning: [google-explicit-constructor]

    single-argument constructors must be marked explicit to avoid unintentional implicit conversions

       45 |     VolumeChannelSplitGL(Callback C) : VolumeChannelSplitGL() {
          |     ^
          |     explicit 
  • misc/computeutils/include/inviwo/computeutils/algorithm/volumeminmaxgl.h:43:35: warning: [cppcoreguidelines-special-member-functions]

    class 'VolumeMinMaxGL' defines a default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator

       43 | class IVW_MODULE_COMPUTEUTILS_API VolumeMinMaxGL {
          |                                   ^
  • misc/computeutils/include/inviwo/computeutils/algorithm/volumenormalizationgl.h:44:35: warning: [cppcoreguidelines-special-member-functions]

    class 'VolumeNormalizationGL' defines a default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator

       44 | class IVW_MODULE_COMPUTEUTILS_API VolumeNormalizationGL {
          |                                   ^
  • misc/computeutils/include/inviwo/computeutils/algorithm/volumenormalizationgl.h:47:5: warning: [google-explicit-constructor]

    single-argument constructors must be marked explicit to avoid unintentional implicit conversions

       47 |     VolumeNormalizationGL(Callback C) : VolumeNormalizationGL() {
          |     ^
          |     explicit 
  • misc/computeutils/include/inviwo/computeutils/algorithm/volumereductiongl.h:38:12: warning: [performance-enum-size]

    enum 'ReductionOperator' uses a larger base type ('int', size: 4 bytes) than necessary for its value set, consider using 'std::uint8_t' (1 byte) as the base type to reduce its size

       38 | enum class ReductionOperator { Min = 0, Max = 1, Sum = 2, None = 3 };
          |            ^
  • misc/computeutils/include/inviwo/computeutils/algorithm/volumereductiongl.h:39:12: warning: [performance-enum-size]

    enum 'DisregardingStatus' uses a larger base type ('int', size: 4 bytes) than necessary for its value set, consider using 'std::uint8_t' (1 byte) as the base type to reduce its size

       39 | enum class DisregardingStatus { Off = 0, On = 1, Unset = 2 };
          |            ^
  • misc/computeutils/include/inviwo/computeutils/algorithm/volumereductiongl.h:75:35: warning: [cppcoreguidelines-special-member-functions]

    class 'VolumeReductionGL' defines a default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator

       75 | class IVW_MODULE_COMPUTEUTILS_API VolumeReductionGL {
          |                                   ^
  • misc/computeutils/include/inviwo/computeutils/algorithm/volumeshrinktonormalrangegl.h:43:35: warning: [cppcoreguidelines-special-member-functions]

    class 'VolumeShrinkToNormalRangeGL' defines a default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator

       43 | class IVW_MODULE_COMPUTEUTILS_API VolumeShrinkToNormalRangeGL {
          |                                   ^
  • misc/computeutils/include/inviwo/computeutils/algorithm/volumeshrinktonormalrangegl.h:46:5: warning: [google-explicit-constructor]

    single-argument constructors must be marked explicit to avoid unintentional implicit conversions

       46 |     VolumeShrinkToNormalRangeGL(Callback C) : VolumeShrinkToNormalRangeGL() {
          |     ^
          |     explicit 
  • misc/computeutils/include/inviwo/computeutils/computeutilsmodule.h:36:35: warning: [cppcoreguidelines-special-member-functions]

    class 'ComputeUtilsModule' defines a default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator

       36 | class IVW_MODULE_COMPUTEUTILS_API ComputeUtilsModule : public InviwoModule {
          |                                   ^
  • misc/computeutils/include/inviwo/computeutils/computeutilsmodule.h:38:5: warning: [google-explicit-constructor]

    single-argument constructors must be marked explicit to avoid unintentional implicit conversions

       38 |     ComputeUtilsModule(InviwoApplication* app);
          |     ^
          |     explicit 
  • misc/computeutils/include/inviwo/computeutils/processors/volumechannelsplitglprocessor.h:51:35: warning: [cppcoreguidelines-special-member-functions]

    class 'VolumeChannelSplitGLProcessor' defines a default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator

       51 | class IVW_MODULE_COMPUTEUTILS_API VolumeChannelSplitGLProcessor : public Processor {
          |                                   ^
  • misc/computeutils/include/inviwo/computeutils/processors/volumeminmaxglprocessor.h:41:35: warning: [cppcoreguidelines-special-member-functions]

    class 'VolumeMinMaxGLProcessor' defines a default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator

       41 | class IVW_MODULE_COMPUTEUTILS_API VolumeMinMaxGLProcessor : public Processor {
          |                                   ^
  • misc/computeutils/include/inviwo/computeutils/processors/volumenormalizationglprocessor.h:49:35: warning: [cppcoreguidelines-special-member-functions]

    class 'VolumeNormalizationGLProcessor' defines a default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator

       49 | class IVW_MODULE_COMPUTEUTILS_API VolumeNormalizationGLProcessor : public Processor {
          |                                   ^
  • misc/computeutils/include/inviwo/computeutils/processors/volumereductionglprocessor.h:55:35: warning: [cppcoreguidelines-special-member-functions]

    class 'VolumeReductionGLProcessor' defines a default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator

       55 | class IVW_MODULE_COMPUTEUTILS_API VolumeReductionGLProcessor : public Processor {
          |                                   ^
  • misc/computeutils/include/inviwo/computeutils/processors/volumeshrinktonormalrangeglprocessor.h:43:35: warning: [cppcoreguidelines-special-member-functions]

    class 'VolumeShrinkToNormalRangeGLProcessor' defines a default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator

       43 | class IVW_MODULE_COMPUTEUTILS_API VolumeShrinkToNormalRangeGLProcessor : public Processor {
          |                                   ^
  • misc/computeutils/src/algorithm/volumechannelsplitgl.cpp:48:35: warning: [performance-unnecessary-value-param]

    the parameter 'volume' is copied for each invocation but only used as a const reference; consider making it a const reference

       48 |     std::shared_ptr<const Volume> volume) {
          |                                   ^
          |     const                        &
  • misc/computeutils/src/algorithm/volumechannelsplitgl.cpp:51:5: warning: [llvm-qualified-auto]

    'const auto oldDataFormat' can be declared as 'const auto *const oldDataFormat'

       51 |     const auto oldDataFormat = volume->getDataFormat();
          |     ^~~~~~~~~~
          |     const auto *const 
  • misc/computeutils/src/algorithm/volumechannelsplitgl.cpp:57:5: warning: [llvm-qualified-auto]

    'auto dataFormat' can be declared as 'const auto *dataFormat'

       57 |     auto dataFormat = DataFormatBase::get(numericType, numberOfComponents, precision);
          |     ^~~~
          |     const auto *
  • misc/computeutils/src/algorithm/volumechannelsplitgl.cpp:89:9: warning: [llvm-qualified-auto]

    'auto outVolumeGL' can be declared as 'auto *outVolumeGL'

       89 |         auto outVolumeGL = outVolume->getEditableRepresentation<VolumeGL>();
          |         ^~~~
          |         auto *
  • misc/computeutils/src/algorithm/volumechannelsplitgl.cpp:108:15: warning: [performance-for-range-copy]

    loop variable is copied but only used as const reference; consider making it a const reference

      108 |     for (auto outVolume : outVolumes) {
          |               ^
          |          const  &
  • misc/computeutils/src/algorithm/volumeminmaxgl.cpp:33:60: warning: [performance-unnecessary-value-param]

    the parameter 'volume' is copied for each invocation but only used as a const reference; consider making it a const reference

       33 | dvec2 VolumeMinMaxGL::minmax(std::shared_ptr<const Volume> volume,
          |                                                            ^
          |                              const                        &
  • misc/computeutils/src/algorithm/volumenormalizationgl.cpp:109:5: warning: [llvm-qualified-auto]

    'auto outVolumeGL' can be declared as 'auto *outVolumeGL'

      109 |     auto outVolumeGL = outVolume->getEditableRepresentation<VolumeGL>();
          |     ^~~~
          |     auto *
  • misc/computeutils/src/algorithm/volumereductiongl.cpp:54:81: warning: [performance-unnecessary-value-param]

    the parameter 'volume' is copied for each invocation but only used as a const reference; consider making it a const reference

       54 | std::shared_ptr<Volume> VolumeReductionGL::reduce(std::shared_ptr<const Volume> volume,
          |                                                                                 ^
          |                                                   const                        &
  • misc/computeutils/src/algorithm/volumereductiongl.cpp:69:5: warning: [llvm-qualified-auto]

    'auto dataFormat' can be declared as 'const auto *dataFormat'

       69 |     auto dataFormat = volume->getDataFormat();
          |     ^~~~
          |     const auto *
  • misc/computeutils/src/algorithm/volumereductiongl.cpp:93:9: warning: [llvm-qualified-auto]

    'auto outputGL' can be declared as 'auto *outputGL'

       93 |         auto outputGL = output->getEditableRepresentation<VolumeGL>();
          |         ^~~~
          |         auto *
  • misc/computeutils/src/algorithm/volumereductiongl.cpp:137:23: warning: [performance-unnecessary-value-param]

    parameter 'volume' is passed by value and only copied once; consider moving it to avoid unnecessary copies

       45 |     auto res = reduce(volume, op, disregardingStatus, range);
          |                       ^     
          |                       std::move( )
  • misc/computeutils/src/algorithm/volumereductiongl.cpp:145:5: warning: [llvm-qualified-auto]

    'auto computeShader' can be declared as 'auto *computeShader'

      145 |     auto computeShader = shader_.getComputeShaderObject();
          |     ^~~~
          |     auto *
  • misc/computeutils/src/algorithm/volumereductiongl.cpp:156:5: warning: [llvm-qualified-auto]

    'auto computeShader' can be declared as 'auto *computeShader'

      156 |     auto computeShader = shader_.getComputeShaderObject();
          |     ^~~~
          |     auto *
  • misc/computeutils/src/algorithm/volumereductiongl.cpp:164:70: warning: [performance-unnecessary-value-param]

    the parameter 'volume' is copied for each invocation but only used as a const reference; consider making it a const reference

      164 | void VolumeReductionGL::setSamplerType(std::shared_ptr<const Volume> volume) {
          |                                                                      ^
          |                                        const                        &
  • misc/computeutils/src/algorithm/volumereductiongl.cpp:165:5: warning: [llvm-qualified-auto]

    'auto computeShader' can be declared as 'auto *computeShader'

      165 |     auto computeShader = shader_.getComputeShaderObject();
          |     ^~~~
          |     auto *
  • misc/computeutils/src/algorithm/volumeshrinktonormalrangegl.cpp:118:5: warning: [llvm-qualified-auto]

    'auto outVolumeGL' can be declared as 'auto *outVolumeGL'

      118 |     auto outVolumeGL = outVolume->getEditableRepresentation<VolumeGL>();
          |     ^~~~
          |     auto *
  • misc/computeutils/src/processors/volumenormalizationglprocessor.cpp:78:66: error: [clang-diagnostic-error]

    no member named 'enumerate' in namespace 'std::ranges::views'

       78 |         for (auto&& [index, p] : normalizeChannel_ | std::views::enumerate) {
          |                                                      ~~~~~~~~~~~~^
  • misc/computeutils/src/processors/volumenormalizationglprocessor.cpp:84:42: error: [clang-diagnostic-error]

    no member named 'enumerate' in namespace 'std::ranges::views'

       84 |          normalizeChannel_ | std::views::enumerate |
          |                              ~~~~~~~~~~~~^
  • misc/computeutils/src/processors/volumeshrinktonormalrangeglprocessor.cpp:76:63: error: [clang-diagnostic-error]

    no member named 'enumerate' in namespace 'std::ranges::views'

       76 |         for (auto&& [index, p] : shrinkChannel_ | std::views::enumerate) {
          |                                                   ~~~~~~~~~~~~^
  • misc/computeutils/src/processors/volumeshrinktonormalrangeglprocessor.cpp:82:39: error: [clang-diagnostic-error]

    no member named 'enumerate' in namespace 'std::ranges::views'

       82 |          shrinkChannel_ | std::views::enumerate |
          |                           ~~~~~~~~~~~~^
  • misc/computeutils/tests/unittests/computeutils-unittest-main.cpp:44:5: warning: [google-build-using-namespace]

    do not use namespace using-directives; use using-declarations instead

       44 |     using namespace inviwo;
          |     ^
  • multivis/featurelevelsetsgl/include/inviwo/featurelevelsetsgl/featurelevelsetsglmodule.h:31:10: error: [clang-diagnostic-error]

    'inviwo/featurelevelsetsgl/featurelevelsetsglmoduledefine.h' file not found

       31 | #include <inviwo/featurelevelsetsgl/featurelevelsetsglmoduledefine.h>
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • multivis/featurelevelsetsgl/include/inviwo/featurelevelsetsgl/featurelevelsetsglmodule.h:36:41: warning: [cppcoreguidelines-avoid-non-const-global-variables]

    variable 'FeatureLevelSetsGLModule' is non-const and globally accessible, consider making it const

       36 | class IVW_MODULE_FEATURELEVELSETSGL_API FeatureLevelSetsGLModule : public InviwoModule {
          |                                         ^
  • multivis/featurelevelsetsgl/include/inviwo/featurelevelsetsgl/processors/featurelevelsetprocessorgl.h:32:10: error: [clang-diagnostic-error]

    'inviwo/featurelevelsetsgl/featurelevelsetsglmoduledefine.h' file not found

       32 | #include <inviwo/featurelevelsetsgl/featurelevelsetsglmoduledefine.h>
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • multivis/featurelevelsetsgl/include/inviwo/featurelevelsetsgl/processors/featurelevelsetprocessorgl.h:48:41: warning: [cppcoreguidelines-avoid-non-const-global-variables]

    variable 'FeatureLevelSetProcessorGL' is non-const and globally accessible, consider making it const

       48 | class IVW_MODULE_FEATURELEVELSETSGL_API FeatureLevelSetProcessorGL : public Processor,
          |                                         ^
  • multivis/featurelevelsetsgl/include/inviwo/featurelevelsetsgl/properties/implicitfunctiontraitproperty.h:31:10: error: [clang-diagnostic-error]

    'inviwo/featurelevelsetsgl/featurelevelsetsglmoduledefine.h' file not found

       31 | #include <inviwo/featurelevelsetsgl/featurelevelsetsglmoduledefine.h>
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • multivis/featurelevelsetsgl/include/inviwo/featurelevelsetsgl/properties/implicitfunctiontraitproperty.h:40:41: warning: [cppcoreguidelines-avoid-non-const-global-variables]

    variable 'ImplicitFunctionTraitProperty' is non-const and globally accessible, consider making it const

       40 | class IVW_MODULE_FEATURELEVELSETSGL_API ImplicitFunctionTraitProperty : public TraitProperty {
          |                                         ^
  • multivis/featurelevelsetsgl/include/inviwo/featurelevelsetsgl/properties/pointtraitproperty.h:31:10: error: [clang-diagnostic-error]

    'inviwo/featurelevelsetsgl/featurelevelsetsglmoduledefine.h' file not found

       31 | #include <inviwo/featurelevelsetsgl/featurelevelsetsglmoduledefine.h>
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • multivis/featurelevelsetsgl/include/inviwo/featurelevelsetsgl/properties/pointtraitproperty.h:36:41: warning: [cppcoreguidelines-avoid-non-const-global-variables]

    variable 'PointTraitProperty' is non-const and globally accessible, consider making it const

       36 | class IVW_MODULE_FEATURELEVELSETSGL_API PointTraitProperty : public TraitProperty {
          |                                         ^
  • multivis/featurelevelsetsgl/include/inviwo/featurelevelsetsgl/properties/rangetraitproperty.h:31:10: error: [clang-diagnostic-error]

    'inviwo/featurelevelsetsgl/featurelevelsetsglmoduledefine.h' file not found

       31 | #include <inviwo/featurelevelsetsgl/featurelevelsetsglmoduledefine.h>
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • multivis/featurelevelsetsgl/include/inviwo/featurelevelsetsgl/properties/rangetraitproperty.h:36:41: warning: [cppcoreguidelines-avoid-non-const-global-variables]

    variable 'RangeTraitProperty' is non-const and globally accessible, consider making it const

       36 | class IVW_MODULE_FEATURELEVELSETSGL_API RangeTraitProperty : public TraitProperty {
          |                                         ^
  • multivis/featurelevelsetsgl/include/inviwo/featurelevelsetsgl/properties/traitproperty.h:31:10: error: [clang-diagnostic-error]

    'inviwo/featurelevelsetsgl/featurelevelsetsglmoduledefine.h' file not found

       31 | #include <inviwo/featurelevelsetsgl/featurelevelsetsglmoduledefine.h>
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • multivis/featurelevelsetsgl/include/inviwo/featurelevelsetsgl/properties/traitproperty.h:36:41: warning: [cppcoreguidelines-avoid-non-const-global-variables]

    variable 'TraitProperty' is non-const and globally accessible, consider making it const

       36 | class IVW_MODULE_FEATURELEVELSETSGL_API TraitProperty : public CompositeProperty {
          |                                         ^
  • multivis/featurelevelsetsgl/include/inviwo/featurelevelsetsgl/util/util.h:1:1: warning: [modernize-concat-nested-namespaces]

    nested namespaces can be concatenated

        1 | namespace inviwo {
          | ^~~~~~~~~~~~~~~~~~
        2 | namespace util {
          | ~~~~~~~~~~~~~~
          | namespace inviwo::util
  • multivis/featurelevelsetsgl/include/inviwo/featurelevelsetsgl/util/util.h:3:12: warning: [performance-enum-size]

    enum 'DistanceMetric' uses a larger base type ('int', size: 4 bytes) than necessary for its value set, consider using 'std::uint8_t' (1 byte) as the base type to reduce its size

        3 | enum class DistanceMetric { Euclidean, Manhattan, Minkowski, SquaredSum };
          |            ^
  • multivis/featurelevelsetsgl/include/inviwo/featurelevelsetsgl/util/util.h:17:27: error: [clang-diagnostic-error]

    use of undeclared identifier 'std'

       17 | T minkowskiDistance(const std::vector<T>& a, const std::vector<T>& b, const T order) {
          |                           ^
  • multivis/featurelevelsetsgl/include/inviwo/featurelevelsetsgl/util/util.h:17:52: error: [clang-diagnostic-error]

    use of undeclared identifier 'std'

       17 | T minkowskiDistance(const std::vector<T>& a, const std::vector<T>& b, const T order) {
          |                                                    ^
  • multivis/featurelevelsetsgl/include/inviwo/featurelevelsetsgl/util/util.h:19:12: error: [clang-diagnostic-error]

    use of undeclared identifier 'std'

       19 |     return std::pow(std::inner_product(a.begin(), a.end(), b.begin(), T(0), std::plus<>(),
          |            ^
  • multivis/featurelevelsetsgl/include/inviwo/featurelevelsetsgl/util/util.h:19:21: error: [clang-diagnostic-error]

    use of undeclared identifier 'std'

       19 |     return std::pow(std::inner_product(a.begin(), a.end(), b.begin(), T(0), std::plus<>(),
          |                     ^
  • multivis/featurelevelsetsgl/include/inviwo/featurelevelsetsgl/util/util.h:19:77: error: [clang-diagnostic-error]

    use of undeclared identifier 'std'

       19 |     return std::pow(std::inner_product(a.begin(), a.end(), b.begin(), T(0), std::plus<>(),
          |                                                                             ^
  • multivis/featurelevelsetsgl/include/inviwo/featurelevelsetsgl/util/util.h:19:87: error: [clang-diagnostic-error]

    expected expression

       19 |     return std::pow(std::inner_product(a.begin(), a.end(), b.begin(), T(0), std::plus<>(),
          |                                                                                       ^
  • multivis/featurelevelsetsgl/include/inviwo/featurelevelsetsgl/util/util.h:19:89: error: [clang-diagnostic-error]

    expected expression

       19 |     return std::pow(std::inner_product(a.begin(), a.end(), b.begin(), T(0), std::plus<>(),
          |                                                                                         ^
  • multivis/featurelevelsetsgl/include/inviwo/featurelevelsetsgl/util/util.h:20:67: error: [clang-diagnostic-error]

    use of undeclared identifier 'std'

       20 |                                        [order](T x, T y) { return std::pow(y - x, order); }),
          |                                                                   ^
  • multivis/featurelevelsetsgl/include/inviwo/featurelevelsetsgl/util/util.h:34:27: error: [clang-diagnostic-error]

    use of undeclared identifier 'std'

       34 | T manhattanDistance(const std::vector<T>& a, const std::vector<T>& b) {
          |                           ^
  • multivis/featurelevelsetsgl/include/inviwo/featurelevelsetsgl/util/util.h:34:52: error: [clang-diagnostic-error]

    use of undeclared identifier 'std'

       34 | T manhattanDistance(const std::vector<T>& a, const std::vector<T>& b) {
          |                                                    ^
  • multivis/featurelevelsetsgl/include/inviwo/featurelevelsetsgl/util/util.h:48:27: error: [clang-diagnostic-error]

    use of undeclared identifier 'std'

       48 | T euclideanDistance(const std::vector<T>& a, const std::vector<T>& b) {
          |                           ^
  • multivis/featurelevelsetsgl/include/inviwo/featurelevelsetsgl/util/util.h:48:52: error: [clang-diagnostic-error]

    use of undeclared identifier 'std'

       48 | T euclideanDistance(const std::vector<T>& a, const std::vector<T>& b) {
          |                                                    ^
  • multivis/featurelevelsetsgl/include/inviwo/featurelevelsetsgl/util/util.h:62:28: error: [clang-diagnostic-error]

    use of undeclared identifier 'std'

       62 | T squaredSumDistance(const std::vector<T>& a, const std::vector<T>& b) {
          |                            ^
  • multivis/featurelevelsetsgl/include/inviwo/featurelevelsetsgl/util/util.h:62:53: error: [clang-diagnostic-error]

    use of undeclared identifier 'std'

       62 | T squaredSumDistance(const std::vector<T>& a, const std::vector<T>& b) {
          |                                                     ^
  • multivis/featurelevelsetsgl/include/inviwo/featurelevelsetsgl/util/util.h:64:12: error: [clang-diagnostic-error]

    use of undeclared identifier 'std'

       64 |     return std::inner_product(a.begin(), a.end(), b.begin(), T(0), std::plus<>(),
          |            ^
  • multivis/featurelevelsetsgl/include/inviwo/featurelevelsetsgl/util/util.h:64:68: error: [clang-diagnostic-error]

    use of undeclared identifier 'std'

       64 |     return std::inner_product(a.begin(), a.end(), b.begin(), T(0), std::plus<>(),
          |                                                                    ^
  • multivis/featurelevelsetsgl/include/inviwo/featurelevelsetsgl/util/util.h:64:78: error: [clang-diagnostic-error]

    expected expression

       64 |     return std::inner_product(a.begin(), a.end(), b.begin(), T(0), std::plus<>(),
          |                                                                              ^
  • multivis/featurelevelsetsgl/include/inviwo/featurelevelsetsgl/util/util.h:64:80: error: [clang-diagnostic-error]

    expected expression

       64 |     return std::inner_product(a.begin(), a.end(), b.begin(), T(0), std::plus<>(),
          |                                                                                ^
  • multivis/featurelevelsetsgl/include/inviwo/featurelevelsetsgl/util/util.h:65:53: error: [clang-diagnostic-error]

    use of undeclared identifier 'std'

       65 |                               [](T x, T y) { return std::pow(y - x, T(2)); });
          |                                                     ^
  • multivis/featurelevelsetsgl/src/featurelevelsetsglmodule.cpp:30:10: error: [clang-diagnostic-error]

    'inviwo/featurelevelsetsgl/featurelevelsetsglmodule.h' file not found

       30 | #include <inviwo/featurelevelsetsgl/featurelevelsetsglmodule.h>
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • multivis/featurelevelsetsgl/src/processors/featurelevelsetprocessorgl.cpp:30:10: error: [clang-diagnostic-error]

    'inviwo/featurelevelsetsgl/processors/featurelevelsetprocessorgl.h' file not found

       30 | #include <inviwo/featurelevelsetsgl/processors/featurelevelsetprocessorgl.h>
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • multivis/featurelevelsetsgl/src/properties/implicitfunctiontraitproperty.cpp:30:10: error: [clang-diagnostic-error]

    'inviwo/featurelevelsetsgl/properties/implicitfunctiontraitproperty.h' file not found

       30 | #include <inviwo/featurelevelsetsgl/properties/implicitfunctiontraitproperty.h>
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • multivis/featurelevelsetsgl/src/properties/pointtraitproperty.cpp:30:10: error: [clang-diagnostic-error]

    'inviwo/featurelevelsetsgl/properties/pointtraitproperty.h' file not found

       30 | #include <inviwo/featurelevelsetsgl/properties/pointtraitproperty.h>
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • multivis/featurelevelsetsgl/src/properties/rangetraitproperty.cpp:30:10: error: [clang-diagnostic-error]

    'inviwo/featurelevelsetsgl/properties/rangetraitproperty.h' file not found

       30 | #include <inviwo/featurelevelsetsgl/properties/rangetraitproperty.h>
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • multivis/featurelevelsetsgl/src/properties/traitproperty.cpp:30:10: error: [clang-diagnostic-error]

    'inviwo/featurelevelsetsgl/properties/traitproperty.h' file not found

       30 | #include <inviwo/featurelevelsetsgl/properties/traitproperty.h>
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • multivis/featurelevelsetsgl/tests/unittests/featurelevelsetsgl-unittest-main.cpp:47:5: warning: [google-build-using-namespace]

    do not use namespace using-directives; use using-declarations instead

       47 |     using namespace inviwo;
          |     ^

Have any feedback or feature suggestions? Share it here.

github-actions[bot]

This comment was marked as outdated.

@martinfalk martinfalk force-pushed the feature/featurelevelsets branch from dc11648 to b1b47b3 Compare June 29, 2026 15:46
@github-actions github-actions Bot dismissed their stale review June 29, 2026 17:14

outdated suggestion

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cpp-linter Review

Used clang-tidy v19.1.7

Only 71 out of 82 clang-tidy concerns fit within this pull request's diff.

Click here for the full clang-tidy patch
diff --git a/misc/computeutils/include/inviwo/computeutils/algorithm/volumechannelsplitgl.h b/misc/computeutils/include/inviwo/computeutils/algorithm/volumechannelsplitgl.h
index 1032485..b2f3b8d 100644
--- a/misc/computeutils/include/inviwo/computeutils/algorithm/volumechannelsplitgl.h
+++ b/misc/computeutils/include/inviwo/computeutils/algorithm/volumechannelsplitgl.h
@@ -45 +45 @@ public:
-    VolumeChannelSplitGL(Callback C) : VolumeChannelSplitGL() {
+    explicit VolumeChannelSplitGL(Callback C) : VolumeChannelSplitGL() {
diff --git a/misc/computeutils/include/inviwo/computeutils/algorithm/volumenormalizationgl.h b/misc/computeutils/include/inviwo/computeutils/algorithm/volumenormalizationgl.h
index 163b9a1..7772be1 100644
--- a/misc/computeutils/include/inviwo/computeutils/algorithm/volumenormalizationgl.h
+++ b/misc/computeutils/include/inviwo/computeutils/algorithm/volumenormalizationgl.h
@@ -47 +47 @@ public:
-    VolumeNormalizationGL(Callback C) : VolumeNormalizationGL() {
+    explicit VolumeNormalizationGL(Callback C) : VolumeNormalizationGL() {
diff --git a/misc/computeutils/include/inviwo/computeutils/algorithm/volumeshrinktonormalrangegl.h b/misc/computeutils/include/inviwo/computeutils/algorithm/volumeshrinktonormalrangegl.h
index 1d8d1f2..cd6c1a9 100644
--- a/misc/computeutils/include/inviwo/computeutils/algorithm/volumeshrinktonormalrangegl.h
+++ b/misc/computeutils/include/inviwo/computeutils/algorithm/volumeshrinktonormalrangegl.h
@@ -46 +46 @@ public:
-    VolumeShrinkToNormalRangeGL(Callback C) : VolumeShrinkToNormalRangeGL() {
+    explicit VolumeShrinkToNormalRangeGL(Callback C) : VolumeShrinkToNormalRangeGL() {
diff --git a/misc/computeutils/include/inviwo/computeutils/computeutilsmodule.h b/misc/computeutils/include/inviwo/computeutils/computeutilsmodule.h
index e7d8a39..98df37e 100644
--- a/misc/computeutils/include/inviwo/computeutils/computeutilsmodule.h
+++ b/misc/computeutils/include/inviwo/computeutils/computeutilsmodule.h
@@ -38 +38 @@ public:
-    ComputeUtilsModule(InviwoApplication* app);
+    explicit ComputeUtilsModule(InviwoApplication* app);
diff --git a/misc/computeutils/src/algorithm/volumechannelsplitgl.cpp b/misc/computeutils/src/algorithm/volumechannelsplitgl.cpp
index 68a9405..927100a 100644
--- a/misc/computeutils/src/algorithm/volumechannelsplitgl.cpp
+++ b/misc/computeutils/src/algorithm/volumechannelsplitgl.cpp
@@ -47,2 +47 @@ VolumeChannelSplitGL::VolumeChannelSplitGL()
-VolumeSequence VolumeChannelSplitGL::split(
-    std::shared_ptr<const Volume> volume) {
+VolumeSequence VolumeChannelSplitGL::split(const std::shared_ptr<const Volume>& volume) {
@@ -51 +50 @@ VolumeSequence VolumeChannelSplitGL::split(
-    const auto oldDataFormat = volume->getDataFormat();
+    const auto* const oldDataFormat = volume->getDataFormat();
@@ -57 +56 @@ VolumeSequence VolumeChannelSplitGL::split(
-    auto dataFormat = DataFormatBase::get(numericType, numberOfComponents, precision);
+    const auto* dataFormat = DataFormatBase::get(numericType, numberOfComponents, precision);
@@ -89 +88 @@ VolumeSequence VolumeChannelSplitGL::split(
-        auto outVolumeGL = outVolume->getEditableRepresentation<VolumeGL>();
+        auto* outVolumeGL = outVolume->getEditableRepresentation<VolumeGL>();
@@ -108 +107 @@ VolumeSequence VolumeChannelSplitGL::split(
-    for (auto outVolume : outVolumes) {
+    for (const auto& outVolume : outVolumes) {
diff --git a/misc/computeutils/src/algorithm/volumeminmaxgl.cpp b/misc/computeutils/src/algorithm/volumeminmaxgl.cpp
index c9073ea..e24bcfc 100644
--- a/misc/computeutils/src/algorithm/volumeminmaxgl.cpp
+++ b/misc/computeutils/src/algorithm/volumeminmaxgl.cpp
@@ -33 +33 @@ namespace inviwo {
-dvec2 VolumeMinMaxGL::minmax(std::shared_ptr<const Volume> volume,
+dvec2 VolumeMinMaxGL::minmax(const std::shared_ptr<const Volume>& volume,
diff --git a/misc/computeutils/src/algorithm/volumenormalizationgl.cpp b/misc/computeutils/src/algorithm/volumenormalizationgl.cpp
index 1bef563..b6a9b7a 100644
--- a/misc/computeutils/src/algorithm/volumenormalizationgl.cpp
+++ b/misc/computeutils/src/algorithm/volumenormalizationgl.cpp
@@ -112 +112 @@ std::shared_ptr<Volume> VolumeNormalizationGL::normalize(const Volume& volume) {
-    auto outVolumeGL = outVolume->getEditableRepresentation<VolumeGL>();
+    auto* outVolumeGL = outVolume->getEditableRepresentation<VolumeGL>();
diff --git a/misc/computeutils/src/algorithm/volumereductiongl.cpp b/misc/computeutils/src/algorithm/volumereductiongl.cpp
index dea8429..f8238da 100644
--- a/misc/computeutils/src/algorithm/volumereductiongl.cpp
+++ b/misc/computeutils/src/algorithm/volumereductiongl.cpp
@@ -45,0 +46,2 @@
+#include <utility>
+
@@ -54 +56 @@ VolumeReductionGL::VolumeReductionGL()
-std::shared_ptr<Volume> VolumeReductionGL::reduce(std::shared_ptr<const Volume> volume,
+std::shared_ptr<Volume> VolumeReductionGL::reduce(const std::shared_ptr<const Volume>& volume,
@@ -69 +71 @@ std::shared_ptr<Volume> VolumeReductionGL::reduce(std::shared_ptr<const Volume> 
-    auto dataFormat = volume->getDataFormat();
+    const auto* dataFormat = volume->getDataFormat();
@@ -93 +95 @@ std::shared_ptr<Volume> VolumeReductionGL::reduce(std::shared_ptr<const Volume> 
-        auto outputGL = output->getEditableRepresentation<VolumeGL>();
+        auto* outputGL = output->getEditableRepresentation<VolumeGL>();
@@ -137 +139 @@ double VolumeReductionGL::reduce_v(std::shared_ptr<const Volume> volume, const R
-    auto res = reduce(volume, op, disregardingStatus, range);
+    auto res = reduce(std::move(volume), op, disregardingStatus, range);
@@ -145 +147 @@ void VolumeReductionGL::setReductionOperator(ReductionOperator op) {
-    auto computeShader = shader_.getComputeShaderObject();
+    auto* computeShader = shader_.getComputeShaderObject();
@@ -156 +158 @@ void VolumeReductionGL::setDisregarding(DisregardingStatus disregardingStatus) {
-    auto computeShader = shader_.getComputeShaderObject();
+    auto* computeShader = shader_.getComputeShaderObject();
@@ -164,2 +166,2 @@ void VolumeReductionGL::setDisregarding(DisregardingStatus disregardingStatus) {
-void VolumeReductionGL::setSamplerType(std::shared_ptr<const Volume> volume) {
-    auto computeShader = shader_.getComputeShaderObject();
+void VolumeReductionGL::setSamplerType(const std::shared_ptr<const Volume>& volume) {
+    auto* computeShader = shader_.getComputeShaderObject();
diff --git a/misc/computeutils/src/algorithm/volumeshrinktonormalrangegl.cpp b/misc/computeutils/src/algorithm/volumeshrinktonormalrangegl.cpp
index ee5808e..2a248af 100644
--- a/misc/computeutils/src/algorithm/volumeshrinktonormalrangegl.cpp
+++ b/misc/computeutils/src/algorithm/volumeshrinktonormalrangegl.cpp
@@ -118 +118 @@ std::shared_ptr<Volume> VolumeShrinkToNormalRangeGL::shrink(const Volume& volume
-    auto outVolumeGL = outVolume->getEditableRepresentation<VolumeGL>();
+    auto* outVolumeGL = outVolume->getEditableRepresentation<VolumeGL>();
diff --git a/misc/computeutils/src/processors/volumeminmaxglprocessor.cpp b/misc/computeutils/src/processors/volumeminmaxglprocessor.cpp
index a7de9cd..cf1fc88 100644
--- a/misc/computeutils/src/processors/volumeminmaxglprocessor.cpp
+++ b/misc/computeutils/src/processors/volumeminmaxglprocessor.cpp
@@ -93 +93 @@ VolumeMinMaxGLProcessor::VolumeMinMaxGLProcessor()
-        NetworkLock l;
+        const NetworkLock l;
diff --git a/misc/computeutils/src/processors/volumenormalizationglprocessor.cpp b/misc/computeutils/src/processors/volumenormalizationglprocessor.cpp
index 03a81a3..97b8a85 100644
--- a/misc/computeutils/src/processors/volumenormalizationglprocessor.cpp
+++ b/misc/computeutils/src/processors/volumenormalizationglprocessor.cpp
@@ -84 +84 @@ VolumeNormalizationGLProcessor::VolumeNormalizationGLProcessor()
-                auto boolProp = dynamic_cast<BoolProperty*>(properties[i]);
+                auto* boolProp = dynamic_cast<BoolProperty*>(properties[i]);
diff --git a/misc/computeutils/src/processors/volumeshrinktonormalrangeglprocessor.cpp b/misc/computeutils/src/processors/volumeshrinktonormalrangeglprocessor.cpp
index 6897c0a..457804d 100644
--- a/misc/computeutils/src/processors/volumeshrinktonormalrangeglprocessor.cpp
+++ b/misc/computeutils/src/processors/volumeshrinktonormalrangeglprocessor.cpp
@@ -83 +83 @@ VolumeShrinkToNormalRangeGLProcessor::VolumeShrinkToNormalRangeGLProcessor()
-                auto boolProp = dynamic_cast<BoolProperty*>(properties[i]);
+                auto* boolProp = dynamic_cast<BoolProperty*>(properties[i]);
diff --git a/multivis/featurelevelsetsgl/include/inviwo/featurelevelsetsgl/util/util.h b/multivis/featurelevelsetsgl/include/inviwo/featurelevelsetsgl/util/util.h
index 35c716e..b8366ac 100644
--- a/multivis/featurelevelsetsgl/include/inviwo/featurelevelsetsgl/util/util.h
+++ b/multivis/featurelevelsetsgl/include/inviwo/featurelevelsetsgl/util/util.h
@@ -1,2 +1,2 @@
-namespace inviwo {
-namespace util {
+
+namespace inviwo::util {
@@ -81,2 +81 @@ T denormalizeValue(const T& val, const T& minVal, const T& maxVal) {
-}  // namespace util
-}  // namespace inviwo
\ No newline at end of file
+}  // namespace inviwo::util

Have any feedback or feature suggestions? Share it here.

class IVW_MODULE_COMPUTEUTILS_API VolumeChannelSplitGL {
public:
template <typename Callback>
VolumeChannelSplitGL(Callback C) : VolumeChannelSplitGL() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy diagnostics

Suggested change
VolumeChannelSplitGL(Callback C) : VolumeChannelSplitGL() {
explicit VolumeChannelSplitGL(Callback C) : VolumeChannelSplitGL() {

*
* Splits multi-channel volumes into several single-channel volumes.
*/
class IVW_MODULE_COMPUTEUTILS_API VolumeChannelSplitGL {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy diagnostic

misc/computeutils/include/inviwo/computeutils/algorithm/volumechannelsplitgl.h:42:35: warning: [cppcoreguidelines-special-member-functions]

class 'VolumeChannelSplitGL' defines a default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator

   42 | class IVW_MODULE_COMPUTEUTILS_API VolumeChannelSplitGL {
      |                                   ^

*
* GL implementation of min-max computation for inviwo volumes.
*/
class IVW_MODULE_COMPUTEUTILS_API VolumeMinMaxGL {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy diagnostic

misc/computeutils/include/inviwo/computeutils/algorithm/volumeminmaxgl.h:43:35: warning: [cppcoreguidelines-special-member-functions]

class 'VolumeMinMaxGL' defines a default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator

   43 | class IVW_MODULE_COMPUTEUTILS_API VolumeMinMaxGL {
      |                                   ^

class IVW_MODULE_COMPUTEUTILS_API VolumeNormalizationGL {
public:
template <typename Callback>
VolumeNormalizationGL(Callback C) : VolumeNormalizationGL() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy diagnostics

Suggested change
VolumeNormalizationGL(Callback C) : VolumeNormalizationGL() {
explicit VolumeNormalizationGL(Callback C) : VolumeNormalizationGL() {

* Note that this algorithm normalizes channels independently, it does not normalize a multi-channel
* volume in terms of vector norms!
*/
class IVW_MODULE_COMPUTEUTILS_API VolumeNormalizationGL {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy diagnostic

misc/computeutils/include/inviwo/computeutils/algorithm/volumenormalizationgl.h:44:35: warning: [cppcoreguidelines-special-member-functions]

class 'VolumeNormalizationGL' defines a default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator

   44 | class IVW_MODULE_COMPUTEUTILS_API VolumeNormalizationGL {
      |                                   ^

*
*********************************************************************************/

#include <inviwo/featurelevelsetsgl/properties/implicitfunctiontraitproperty.h>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy diagnostic

multivis/featurelevelsetsgl/src/properties/implicitfunctiontraitproperty.cpp:30:10: error: [clang-diagnostic-error]

'inviwo/featurelevelsetsgl/properties/implicitfunctiontraitproperty.h' file not found

   30 | #include <inviwo/featurelevelsetsgl/properties/implicitfunctiontraitproperty.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

*
*********************************************************************************/

#include <inviwo/featurelevelsetsgl/properties/pointtraitproperty.h>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy diagnostic

multivis/featurelevelsetsgl/src/properties/pointtraitproperty.cpp:30:10: error: [clang-diagnostic-error]

'inviwo/featurelevelsetsgl/properties/pointtraitproperty.h' file not found

   30 | #include <inviwo/featurelevelsetsgl/properties/pointtraitproperty.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

*
*********************************************************************************/

#include <inviwo/featurelevelsetsgl/properties/rangetraitproperty.h>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy diagnostic

multivis/featurelevelsetsgl/src/properties/rangetraitproperty.cpp:30:10: error: [clang-diagnostic-error]

'inviwo/featurelevelsetsgl/properties/rangetraitproperty.h' file not found

   30 | #include <inviwo/featurelevelsetsgl/properties/rangetraitproperty.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

*
*********************************************************************************/

#include <inviwo/featurelevelsetsgl/properties/traitproperty.h>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy diagnostic

multivis/featurelevelsetsgl/src/properties/traitproperty.cpp:30:10: error: [clang-diagnostic-error]

'inviwo/featurelevelsetsgl/properties/traitproperty.h' file not found

   30 | #include <inviwo/featurelevelsetsgl/properties/traitproperty.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

#include <warn/pop>

int main(int argc, char** argv) {
using namespace inviwo;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy diagnostic

multivis/featurelevelsetsgl/tests/unittests/featurelevelsetsgl-unittest-main.cpp:47:5: warning: [google-build-using-namespace]

do not use namespace using-directives; use using-declarations instead

   47 |     using namespace inviwo;
      |     ^

@github-actions github-actions Bot dismissed their stale review June 30, 2026 11:26

outdated suggestion

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cpp-linter Review

Used clang-tidy v19.1.7

Only 69 out of 80 clang-tidy concerns fit within this pull request's diff.

Click here for the full clang-tidy patch
diff --git a/misc/computeutils/include/inviwo/computeutils/algorithm/volumechannelsplitgl.h b/misc/computeutils/include/inviwo/computeutils/algorithm/volumechannelsplitgl.h
index 1032485..b2f3b8d 100644
--- a/misc/computeutils/include/inviwo/computeutils/algorithm/volumechannelsplitgl.h
+++ b/misc/computeutils/include/inviwo/computeutils/algorithm/volumechannelsplitgl.h
@@ -45 +45 @@ public:
-    VolumeChannelSplitGL(Callback C) : VolumeChannelSplitGL() {
+    explicit VolumeChannelSplitGL(Callback C) : VolumeChannelSplitGL() {
diff --git a/misc/computeutils/include/inviwo/computeutils/algorithm/volumenormalizationgl.h b/misc/computeutils/include/inviwo/computeutils/algorithm/volumenormalizationgl.h
index 163b9a1..7772be1 100644
--- a/misc/computeutils/include/inviwo/computeutils/algorithm/volumenormalizationgl.h
+++ b/misc/computeutils/include/inviwo/computeutils/algorithm/volumenormalizationgl.h
@@ -47 +47 @@ public:
-    VolumeNormalizationGL(Callback C) : VolumeNormalizationGL() {
+    explicit VolumeNormalizationGL(Callback C) : VolumeNormalizationGL() {
diff --git a/misc/computeutils/include/inviwo/computeutils/algorithm/volumeshrinktonormalrangegl.h b/misc/computeutils/include/inviwo/computeutils/algorithm/volumeshrinktonormalrangegl.h
index 1d8d1f2..cd6c1a9 100644
--- a/misc/computeutils/include/inviwo/computeutils/algorithm/volumeshrinktonormalrangegl.h
+++ b/misc/computeutils/include/inviwo/computeutils/algorithm/volumeshrinktonormalrangegl.h
@@ -46 +46 @@ public:
-    VolumeShrinkToNormalRangeGL(Callback C) : VolumeShrinkToNormalRangeGL() {
+    explicit VolumeShrinkToNormalRangeGL(Callback C) : VolumeShrinkToNormalRangeGL() {
diff --git a/misc/computeutils/include/inviwo/computeutils/computeutilsmodule.h b/misc/computeutils/include/inviwo/computeutils/computeutilsmodule.h
index e7d8a39..98df37e 100644
--- a/misc/computeutils/include/inviwo/computeutils/computeutilsmodule.h
+++ b/misc/computeutils/include/inviwo/computeutils/computeutilsmodule.h
@@ -38 +38 @@ public:
-    ComputeUtilsModule(InviwoApplication* app);
+    explicit ComputeUtilsModule(InviwoApplication* app);
diff --git a/misc/computeutils/src/algorithm/volumechannelsplitgl.cpp b/misc/computeutils/src/algorithm/volumechannelsplitgl.cpp
index 68a9405..927100a 100644
--- a/misc/computeutils/src/algorithm/volumechannelsplitgl.cpp
+++ b/misc/computeutils/src/algorithm/volumechannelsplitgl.cpp
@@ -47,2 +47 @@ VolumeChannelSplitGL::VolumeChannelSplitGL()
-VolumeSequence VolumeChannelSplitGL::split(
-    std::shared_ptr<const Volume> volume) {
+VolumeSequence VolumeChannelSplitGL::split(const std::shared_ptr<const Volume>& volume) {
@@ -51 +50 @@ VolumeSequence VolumeChannelSplitGL::split(
-    const auto oldDataFormat = volume->getDataFormat();
+    const auto* const oldDataFormat = volume->getDataFormat();
@@ -57 +56 @@ VolumeSequence VolumeChannelSplitGL::split(
-    auto dataFormat = DataFormatBase::get(numericType, numberOfComponents, precision);
+    const auto* dataFormat = DataFormatBase::get(numericType, numberOfComponents, precision);
@@ -89 +88 @@ VolumeSequence VolumeChannelSplitGL::split(
-        auto outVolumeGL = outVolume->getEditableRepresentation<VolumeGL>();
+        auto* outVolumeGL = outVolume->getEditableRepresentation<VolumeGL>();
@@ -108 +107 @@ VolumeSequence VolumeChannelSplitGL::split(
-    for (auto outVolume : outVolumes) {
+    for (const auto& outVolume : outVolumes) {
diff --git a/misc/computeutils/src/algorithm/volumeminmaxgl.cpp b/misc/computeutils/src/algorithm/volumeminmaxgl.cpp
index c9073ea..e24bcfc 100644
--- a/misc/computeutils/src/algorithm/volumeminmaxgl.cpp
+++ b/misc/computeutils/src/algorithm/volumeminmaxgl.cpp
@@ -33 +33 @@ namespace inviwo {
-dvec2 VolumeMinMaxGL::minmax(std::shared_ptr<const Volume> volume,
+dvec2 VolumeMinMaxGL::minmax(const std::shared_ptr<const Volume>& volume,
diff --git a/misc/computeutils/src/algorithm/volumenormalizationgl.cpp b/misc/computeutils/src/algorithm/volumenormalizationgl.cpp
index 7f6010a..5d9878a 100644
--- a/misc/computeutils/src/algorithm/volumenormalizationgl.cpp
+++ b/misc/computeutils/src/algorithm/volumenormalizationgl.cpp
@@ -109 +109 @@ std::shared_ptr<Volume> VolumeNormalizationGL::normalize(const Volume& volume) {
-    auto outVolumeGL = outVolume->getEditableRepresentation<VolumeGL>();
+    auto* outVolumeGL = outVolume->getEditableRepresentation<VolumeGL>();
diff --git a/misc/computeutils/src/algorithm/volumereductiongl.cpp b/misc/computeutils/src/algorithm/volumereductiongl.cpp
index dea8429..f8238da 100644
--- a/misc/computeutils/src/algorithm/volumereductiongl.cpp
+++ b/misc/computeutils/src/algorithm/volumereductiongl.cpp
@@ -45,0 +46,2 @@
+#include <utility>
+
@@ -54 +56 @@ VolumeReductionGL::VolumeReductionGL()
-std::shared_ptr<Volume> VolumeReductionGL::reduce(std::shared_ptr<const Volume> volume,
+std::shared_ptr<Volume> VolumeReductionGL::reduce(const std::shared_ptr<const Volume>& volume,
@@ -69 +71 @@ std::shared_ptr<Volume> VolumeReductionGL::reduce(std::shared_ptr<const Volume> 
-    auto dataFormat = volume->getDataFormat();
+    const auto* dataFormat = volume->getDataFormat();
@@ -93 +95 @@ std::shared_ptr<Volume> VolumeReductionGL::reduce(std::shared_ptr<const Volume> 
-        auto outputGL = output->getEditableRepresentation<VolumeGL>();
+        auto* outputGL = output->getEditableRepresentation<VolumeGL>();
@@ -137 +139 @@ double VolumeReductionGL::reduce_v(std::shared_ptr<const Volume> volume, const R
-    auto res = reduce(volume, op, disregardingStatus, range);
+    auto res = reduce(std::move(volume), op, disregardingStatus, range);
@@ -145 +147 @@ void VolumeReductionGL::setReductionOperator(ReductionOperator op) {
-    auto computeShader = shader_.getComputeShaderObject();
+    auto* computeShader = shader_.getComputeShaderObject();
@@ -156 +158 @@ void VolumeReductionGL::setDisregarding(DisregardingStatus disregardingStatus) {
-    auto computeShader = shader_.getComputeShaderObject();
+    auto* computeShader = shader_.getComputeShaderObject();
@@ -164,2 +166,2 @@ void VolumeReductionGL::setDisregarding(DisregardingStatus disregardingStatus) {
-void VolumeReductionGL::setSamplerType(std::shared_ptr<const Volume> volume) {
-    auto computeShader = shader_.getComputeShaderObject();
+void VolumeReductionGL::setSamplerType(const std::shared_ptr<const Volume>& volume) {
+    auto* computeShader = shader_.getComputeShaderObject();
diff --git a/misc/computeutils/src/algorithm/volumeshrinktonormalrangegl.cpp b/misc/computeutils/src/algorithm/volumeshrinktonormalrangegl.cpp
index ee5808e..2a248af 100644
--- a/misc/computeutils/src/algorithm/volumeshrinktonormalrangegl.cpp
+++ b/misc/computeutils/src/algorithm/volumeshrinktonormalrangegl.cpp
@@ -118 +118 @@ std::shared_ptr<Volume> VolumeShrinkToNormalRangeGL::shrink(const Volume& volume
-    auto outVolumeGL = outVolume->getEditableRepresentation<VolumeGL>();
+    auto* outVolumeGL = outVolume->getEditableRepresentation<VolumeGL>();
diff --git a/multivis/featurelevelsetsgl/include/inviwo/featurelevelsetsgl/util/util.h b/multivis/featurelevelsetsgl/include/inviwo/featurelevelsetsgl/util/util.h
index 35c716e..b8366ac 100644
--- a/multivis/featurelevelsetsgl/include/inviwo/featurelevelsetsgl/util/util.h
+++ b/multivis/featurelevelsetsgl/include/inviwo/featurelevelsetsgl/util/util.h
@@ -1,2 +1,2 @@
-namespace inviwo {
-namespace util {
+
+namespace inviwo::util {
@@ -81,2 +81 @@ T denormalizeValue(const T& val, const T& minVal, const T& maxVal) {
-}  // namespace util
-}  // namespace inviwo
\ No newline at end of file
+}  // namespace inviwo::util

Have any feedback or feature suggestions? Share it here.

class IVW_MODULE_COMPUTEUTILS_API VolumeChannelSplitGL {
public:
template <typename Callback>
VolumeChannelSplitGL(Callback C) : VolumeChannelSplitGL() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy diagnostics

Suggested change
VolumeChannelSplitGL(Callback C) : VolumeChannelSplitGL() {
explicit VolumeChannelSplitGL(Callback C) : VolumeChannelSplitGL() {

*
* Splits multi-channel volumes into several single-channel volumes.
*/
class IVW_MODULE_COMPUTEUTILS_API VolumeChannelSplitGL {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy diagnostic

misc/computeutils/include/inviwo/computeutils/algorithm/volumechannelsplitgl.h:42:35: warning: [cppcoreguidelines-special-member-functions]

class 'VolumeChannelSplitGL' defines a default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator

   42 | class IVW_MODULE_COMPUTEUTILS_API VolumeChannelSplitGL {
      |                                   ^

*
* GL implementation of min-max computation for inviwo volumes.
*/
class IVW_MODULE_COMPUTEUTILS_API VolumeMinMaxGL {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy diagnostic

misc/computeutils/include/inviwo/computeutils/algorithm/volumeminmaxgl.h:43:35: warning: [cppcoreguidelines-special-member-functions]

class 'VolumeMinMaxGL' defines a default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator

   43 | class IVW_MODULE_COMPUTEUTILS_API VolumeMinMaxGL {
      |                                   ^

class IVW_MODULE_COMPUTEUTILS_API VolumeNormalizationGL {
public:
template <typename Callback>
VolumeNormalizationGL(Callback C) : VolumeNormalizationGL() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy diagnostics

Suggested change
VolumeNormalizationGL(Callback C) : VolumeNormalizationGL() {
explicit VolumeNormalizationGL(Callback C) : VolumeNormalizationGL() {

* Note that this algorithm normalizes channels independently, it does not normalize a multi-channel
* volume in terms of vector norms!
*/
class IVW_MODULE_COMPUTEUTILS_API VolumeNormalizationGL {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy diagnostic

misc/computeutils/include/inviwo/computeutils/algorithm/volumenormalizationgl.h:44:35: warning: [cppcoreguidelines-special-member-functions]

class 'VolumeNormalizationGL' defines a default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator

   44 | class IVW_MODULE_COMPUTEUTILS_API VolumeNormalizationGL {
      |                                   ^

*
*********************************************************************************/

#include <inviwo/featurelevelsetsgl/properties/implicitfunctiontraitproperty.h>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy diagnostic

multivis/featurelevelsetsgl/src/properties/implicitfunctiontraitproperty.cpp:30:10: error: [clang-diagnostic-error]

'inviwo/featurelevelsetsgl/properties/implicitfunctiontraitproperty.h' file not found

   30 | #include <inviwo/featurelevelsetsgl/properties/implicitfunctiontraitproperty.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

*
*********************************************************************************/

#include <inviwo/featurelevelsetsgl/properties/pointtraitproperty.h>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy diagnostic

multivis/featurelevelsetsgl/src/properties/pointtraitproperty.cpp:30:10: error: [clang-diagnostic-error]

'inviwo/featurelevelsetsgl/properties/pointtraitproperty.h' file not found

   30 | #include <inviwo/featurelevelsetsgl/properties/pointtraitproperty.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

*
*********************************************************************************/

#include <inviwo/featurelevelsetsgl/properties/rangetraitproperty.h>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy diagnostic

multivis/featurelevelsetsgl/src/properties/rangetraitproperty.cpp:30:10: error: [clang-diagnostic-error]

'inviwo/featurelevelsetsgl/properties/rangetraitproperty.h' file not found

   30 | #include <inviwo/featurelevelsetsgl/properties/rangetraitproperty.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

*
*********************************************************************************/

#include <inviwo/featurelevelsetsgl/properties/traitproperty.h>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy diagnostic

multivis/featurelevelsetsgl/src/properties/traitproperty.cpp:30:10: error: [clang-diagnostic-error]

'inviwo/featurelevelsetsgl/properties/traitproperty.h' file not found

   30 | #include <inviwo/featurelevelsetsgl/properties/traitproperty.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

#include <warn/pop>

int main(int argc, char** argv) {
using namespace inviwo;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy diagnostic

multivis/featurelevelsetsgl/tests/unittests/featurelevelsetsgl-unittest-main.cpp:47:5: warning: [google-build-using-namespace]

do not use namespace using-directives; use using-declarations instead

   47 |     using namespace inviwo;
      |     ^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

help wanted Extra attention is needed J: Auto Format

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants