Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc,TensorVis,VectorVis: core logging changes #248

Merged
merged 1 commit into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,9 @@ void EventLogger<Inport, Outport>::invokeEvent(Event* event) {
const auto it = eventMap_.find(event->hash());
if ((it == eventMap_.end() && enableOtherEvents_.get()) ||
(it != eventMap_.end() && it->second.get())) {
LogProcessorInfo(std::setw(15) << getDisplayName() << " " << *event);
std::ostringstream oss;
event->print(oss);
log::info("Processor {:>15}: {}", getDisplayName(), oss.str());
}
}

Expand Down
12 changes: 4 additions & 8 deletions misc/openmesh/src/utils/openmeshconverters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@
m = inmesh.getCoordinateTransformer().getDataToWorldMatrix();
}

for (const auto& [pos, normal, texCoord, color] :

Check notice on line 53 in misc/openmesh/src/utils/openmeshconverters.cpp

View workflow job for this annotation

GitHub Actions / Build (macos, dynamic, Debug)

previous declaration is here

Check warning on line 53 in misc/openmesh/src/utils/openmeshconverters.cpp

View workflow job for this annotation

GitHub Actions / Build (macos, dynamic, Debug)

loop variable '[pos, normal, texCoord, color]' binds to a temporary value produced by a range of type 'detailzip::zipper<const vector<vec<3, float, glm::packed_highp>, allocator<vec<3, float, glm::packed_highp>>> &, const vector<vec<3, float, glm::packed_highp>, allocator<vec<3, float, glm::packed_highp>>> &, const vector<vec<3, float, glm::packed_highp>, allocator<vec<3, float, glm::packed_highp>>> &, const vector<vec<4, float, glm::packed_highp>, allocator<vec<4, float, glm::packed_highp>>> &>'

Check notice on line 53 in misc/openmesh/src/utils/openmeshconverters.cpp

View workflow job for this annotation

GitHub Actions / Build (macos, dynamic, Debug)

use non-reference type 'reference' (aka 'proxy<const glm::vec<3, float, glm::packed_highp> &, const glm::vec<3, float, glm::packed_highp> &, const glm::vec<3, float, glm::packed_highp> &, const glm::vec<4, float, glm::packed_highp> &>')

Check notice on line 53 in misc/openmesh/src/utils/openmeshconverters.cpp

View workflow job for this annotation

GitHub Actions / Build (macos, dynamic, Release)

previous declaration is here

Check warning on line 53 in misc/openmesh/src/utils/openmeshconverters.cpp

View workflow job for this annotation

GitHub Actions / Build (macos, dynamic, Release)

loop variable '[pos, normal, texCoord, color]' binds to a temporary value produced by a range of type 'detailzip::zipper<const vector<vec<3, float, glm::packed_highp>, allocator<vec<3, float, glm::packed_highp>>> &, const vector<vec<3, float, glm::packed_highp>, allocator<vec<3, float, glm::packed_highp>>> &, const vector<vec<3, float, glm::packed_highp>, allocator<vec<3, float, glm::packed_highp>>> &, const vector<vec<4, float, glm::packed_highp>, allocator<vec<4, float, glm::packed_highp>>> &>'

Check notice on line 53 in misc/openmesh/src/utils/openmeshconverters.cpp

View workflow job for this annotation

GitHub Actions / Build (macos, dynamic, Release)

use non-reference type 'reference' (aka 'proxy<const glm::vec<3, float, glm::packed_highp> &, const glm::vec<3, float, glm::packed_highp> &, const glm::vec<3, float, glm::packed_highp> &, const glm::vec<4, float, glm::packed_highp> &>')

Check notice on line 53 in misc/openmesh/src/utils/openmeshconverters.cpp

View workflow job for this annotation

GitHub Actions / Regression

previous declaration is here

Check warning on line 53 in misc/openmesh/src/utils/openmeshconverters.cpp

View workflow job for this annotation

GitHub Actions / Regression

loop variable '[pos, normal, texCoord, color]' binds to a temporary value produced by a range of type 'detailzip::zipper<const vector<vec<3, float, glm::packed_highp>, allocator<vec<3, float, glm::packed_highp>>> &, const vector<vec<3, float, glm::packed_highp>, allocator<vec<3, float, glm::packed_highp>>> &, const vector<vec<3, float, glm::packed_highp>, allocator<vec<3, float, glm::packed_highp>>> &, const vector<vec<4, float, glm::packed_highp>, allocator<vec<4, float, glm::packed_highp>>> &>'

Check notice on line 53 in misc/openmesh/src/utils/openmeshconverters.cpp

View workflow job for this annotation

GitHub Actions / Regression

use non-reference type 'reference' (aka 'proxy<const glm::vec<3, float, glm::packed_highp> &, const glm::vec<3, float, glm::packed_highp> &, const glm::vec<3, float, glm::packed_highp> &, const glm::vec<4, float, glm::packed_highp> &>')
util::zip(vertices, normals, texCoords, colors)) {
auto i = [&](const auto& pos) {

Check warning on line 55 in misc/openmesh/src/utils/openmeshconverters.cpp

View workflow job for this annotation

GitHub Actions / Build (macos, dynamic, Debug)

declaration shadows a structured binding

Check warning on line 55 in misc/openmesh/src/utils/openmeshconverters.cpp

View workflow job for this annotation

GitHub Actions / Build (macos, dynamic, Release)

declaration shadows a structured binding

Check warning on line 55 in misc/openmesh/src/utils/openmeshconverters.cpp

View workflow job for this annotation

GitHub Actions / Regression

declaration shadows a structured binding
if (transform == TransformCoordinates::NoTransform) {
return mesh.add_vertex({pos.x, pos.y, pos.z});
} else {
Expand Down Expand Up @@ -80,8 +80,8 @@
m = inmesh.getCoordinateTransformer().getDataToWorldMatrix();
}

for (const auto& [pos, texCoord, color] : util::zip(vertices, texCoords, colors)) {

Check notice on line 83 in misc/openmesh/src/utils/openmeshconverters.cpp

View workflow job for this annotation

GitHub Actions / Build (macos, dynamic, Debug)

previous declaration is here

Check warning on line 83 in misc/openmesh/src/utils/openmeshconverters.cpp

View workflow job for this annotation

GitHub Actions / Build (macos, dynamic, Debug)

loop variable '[pos, texCoord, color]' binds to a temporary value produced by a range of type 'detailzip::zipper<const vector<vec<3, float, glm::packed_highp>, allocator<vec<3, float, glm::packed_highp>>> &, const vector<vec<3, float, glm::packed_highp>, allocator<vec<3, float, glm::packed_highp>>> &, const vector<vec<4, float, glm::packed_highp>, allocator<vec<4, float, glm::packed_highp>>> &>'

Check notice on line 83 in misc/openmesh/src/utils/openmeshconverters.cpp

View workflow job for this annotation

GitHub Actions / Build (macos, dynamic, Debug)

use non-reference type 'reference' (aka 'proxy<const glm::vec<3, float, glm::packed_highp> &, const glm::vec<3, float, glm::packed_highp> &, const glm::vec<4, float, glm::packed_highp> &>')

Check notice on line 83 in misc/openmesh/src/utils/openmeshconverters.cpp

View workflow job for this annotation

GitHub Actions / Build (macos, dynamic, Release)

previous declaration is here

Check warning on line 83 in misc/openmesh/src/utils/openmeshconverters.cpp

View workflow job for this annotation

GitHub Actions / Build (macos, dynamic, Release)

loop variable '[pos, texCoord, color]' binds to a temporary value produced by a range of type 'detailzip::zipper<const vector<vec<3, float, glm::packed_highp>, allocator<vec<3, float, glm::packed_highp>>> &, const vector<vec<3, float, glm::packed_highp>, allocator<vec<3, float, glm::packed_highp>>> &, const vector<vec<4, float, glm::packed_highp>, allocator<vec<4, float, glm::packed_highp>>> &>'

Check notice on line 83 in misc/openmesh/src/utils/openmeshconverters.cpp

View workflow job for this annotation

GitHub Actions / Build (macos, dynamic, Release)

use non-reference type 'reference' (aka 'proxy<const glm::vec<3, float, glm::packed_highp> &, const glm::vec<3, float, glm::packed_highp> &, const glm::vec<4, float, glm::packed_highp> &>')

Check notice on line 83 in misc/openmesh/src/utils/openmeshconverters.cpp

View workflow job for this annotation

GitHub Actions / Regression

previous declaration is here

Check warning on line 83 in misc/openmesh/src/utils/openmeshconverters.cpp

View workflow job for this annotation

GitHub Actions / Regression

loop variable '[pos, texCoord, color]' binds to a temporary value produced by a range of type 'detailzip::zipper<const vector<vec<3, float, glm::packed_highp>, allocator<vec<3, float, glm::packed_highp>>> &, const vector<vec<3, float, glm::packed_highp>, allocator<vec<3, float, glm::packed_highp>>> &, const vector<vec<4, float, glm::packed_highp>, allocator<vec<4, float, glm::packed_highp>>> &>'

Check notice on line 83 in misc/openmesh/src/utils/openmeshconverters.cpp

View workflow job for this annotation

GitHub Actions / Regression

use non-reference type 'reference' (aka 'proxy<const glm::vec<3, float, glm::packed_highp> &, const glm::vec<3, float, glm::packed_highp> &, const glm::vec<4, float, glm::packed_highp> &>')
auto i = [&](const auto& pos) {

Check warning on line 84 in misc/openmesh/src/utils/openmeshconverters.cpp

View workflow job for this annotation

GitHub Actions / Build (macos, dynamic, Debug)

declaration shadows a structured binding

Check warning on line 84 in misc/openmesh/src/utils/openmeshconverters.cpp

View workflow job for this annotation

GitHub Actions / Build (macos, dynamic, Release)

declaration shadows a structured binding

Check warning on line 84 in misc/openmesh/src/utils/openmeshconverters.cpp

View workflow job for this annotation

GitHub Actions / Regression

declaration shadows a structured binding
if (transform == TransformCoordinates::NoTransform) {
return mesh.add_vertex({pos.x, pos.y, pos.z});
} else {
Expand Down Expand Up @@ -120,8 +120,7 @@
return vec3(tmp) / tmp.w;
});
} else {
throw inviwo::Exception("Unknown position buffer type",
IvwContextCustom("openmeshutil::meshHelper"));
throw inviwo::Exception("Unknown position buffer type");
}
}
}
Expand All @@ -135,8 +134,7 @@
mesh.set_normal(VH(i++), {n.x, n.y, n.z});
}
} else {
throw inviwo::Exception("Unknown normals buffer type",
IvwContextCustom("openmeshutil::meshHelper"));
throw inviwo::Exception("Unknown normals buffer type");
}
} else if (buf.first.type == BufferType::ColorAttrib) {
auto loop = [&](auto& buf, auto toVec4) {
Expand All @@ -156,8 +154,7 @@
} else if (auto u3 = std::dynamic_pointer_cast<const Buffer<glm::u8vec3>>(buf.second)) {
loop(u3, [](glm::u8vec3 v) { return vec4(v, 255.0f) / 255.0f; });
} else {
throw inviwo::Exception("Unknown normals buffer type",
IvwContextCustom("openmeshutil::meshHelper"));
throw inviwo::Exception("Unknown normals buffer type");
}
} else if (buf.first.type == BufferType::TexCoordAttrib) {
if (auto t1 = std::dynamic_pointer_cast<const Buffer<float>>(buf.second)) {
Expand All @@ -181,8 +178,7 @@
mesh.set_texcoord3D(VH(i++), {v.x, v.y, v.z});
}
} else {
throw inviwo::Exception("Unknown normals buffer type",
IvwContextCustom("openmeshutil::meshHelper"));
throw inviwo::Exception("Unknown normals buffer type");
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,9 @@ void InvariantSpaceFilter::process() {
}
}

LogProcessorInfo(
std::to_string((float(numberOfFilteredTensors) / float(numberOfElements)) * 100.f)
<< "% filtered (" << std::to_string(numberOfFilteredTensors) << " out of "
<< std::to_string(numberOfElements) << ").");
log::info("{}% filtered ({} out of {})",
(float(numberOfFilteredTensors) / float(numberOfElements)) * 100.f,

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
(float(numberOfFilteredTensors) / float(numberOfElements)) * 100.f,
(static_cast<float>(numberOfFilteredTensors) / static_cast<float>(numberOfElements)) *
100.f,

numberOfFilteredTensors, numberOfElements);

invariantSpaceOutport_.setData(filteredInvariantSpace);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
}

if (c == 1) { // scalars
ram->dispatch<void, dispatching::filter::Scalars>([=, &funcs, df = &dataFrame](auto ramT) {

Check warning on line 127 in vectorvis/integrallinefiltering/src/processors/integrallinestodataframe.cpp

View workflow job for this annotation

GitHub Actions / Build (linux, dynamic, Debug)

implicit capture of ‘this’ via ‘[=]’ is deprecated in C++20

Check notice on line 127 in vectorvis/integrallinefiltering/src/processors/integrallinestodataframe.cpp

View workflow job for this annotation

GitHub Actions / Build (linux, dynamic, Debug)

add explicit ‘this’ or ‘*this’ capture

Check warning on line 127 in vectorvis/integrallinefiltering/src/processors/integrallinestodataframe.cpp

View workflow job for this annotation

GitHub Actions / Build (linux, static, Release)

implicit capture of ‘this’ via ‘[=]’ is deprecated in C++20

Check notice on line 127 in vectorvis/integrallinefiltering/src/processors/integrallinestodataframe.cpp

View workflow job for this annotation

GitHub Actions / Build (linux, static, Release)

add explicit ‘this’ or ‘*this’ capture
using T = typename util::PrecisionValueType<decltype(ramT)>;
createFunction<T>(funcs, *df, percentiles, name,
[=](const T& v) -> float { return static_cast<float>(v); });
Expand Down Expand Up @@ -361,7 +361,7 @@
if (auto mdp = dynamic_cast<MetaDataSettings*>(p)) {
return mdp;
}
throw inviwo::Exception("Not a MetaDataSettings", IvwContext);
throw inviwo::Exception("Not a MetaDataSettings");
}
auto newProp = std::make_unique<MetaDataSettings>(id, key);
auto newPropPtr = newProp.get();
Expand Down
Loading