Added feature level-sets and dependencies#177
Conversation
0941b92 to
98cc817
Compare
Cpp-Linter Report
|
98cc817 to
b2b24f6
Compare
ea11da7 to
195b934
Compare
195b934 to
5166979
Compare
1eb47ec to
dc11648
Compare
* compiling Compute Shaders in the constructor fails integration tests if there is no hardware support
…_view not a const string&
dc11648 to
b1b47b3
Compare
There was a problem hiding this comment.
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() { |
There was a problem hiding this comment.
clang-tidy diagnostics
- single-argument constructors must be marked explicit to avoid unintentional implicit conversions [google-explicit-constructor]
| VolumeChannelSplitGL(Callback C) : VolumeChannelSplitGL() { | |
| explicit VolumeChannelSplitGL(Callback C) : VolumeChannelSplitGL() { |
| * | ||
| * Splits multi-channel volumes into several single-channel volumes. | ||
| */ | ||
| class IVW_MODULE_COMPUTEUTILS_API VolumeChannelSplitGL { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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() { |
There was a problem hiding this comment.
clang-tidy diagnostics
- single-argument constructors must be marked explicit to avoid unintentional implicit conversions [google-explicit-constructor]
| 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 { |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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;
| ^There was a problem hiding this comment.
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() { |
There was a problem hiding this comment.
clang-tidy diagnostics
- single-argument constructors must be marked explicit to avoid unintentional implicit conversions [google-explicit-constructor]
| VolumeChannelSplitGL(Callback C) : VolumeChannelSplitGL() { | |
| explicit VolumeChannelSplitGL(Callback C) : VolumeChannelSplitGL() { |
| * | ||
| * Splits multi-channel volumes into several single-channel volumes. | ||
| */ | ||
| class IVW_MODULE_COMPUTEUTILS_API VolumeChannelSplitGL { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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() { |
There was a problem hiding this comment.
clang-tidy diagnostics
- single-argument constructors must be marked explicit to avoid unintentional implicit conversions [google-explicit-constructor]
| 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 { |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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;
| ^
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.