Skip to content

Commit

Permalink
TensorVis,VectorVis,MolVis: linter
Browse files Browse the repository at this point in the history
  • Loading branch information
martinfalk committed Feb 6, 2025
1 parent 5e58ab6 commit 042bbb7
Show file tree
Hide file tree
Showing 13 changed files with 33 additions and 21 deletions.
8 changes: 6 additions & 2 deletions molvis/vasp/src/processors/chgcarsource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,12 @@ std::shared_ptr<molvis::MolecularStructure> createMolecularStructure(

auto bonds = molvis::computeCovalentBonds(atoms);

auto ms = std::make_shared<molvis::MolecularStructure>(molvis::MolecularData{
.source = source, .atoms = std::move(atoms), .bonds = std::move(bonds)});
auto ms = std::make_shared<molvis::MolecularStructure>(
molvis::MolecularData{.source = source,
.atoms = std::move(atoms),
.residues = {},
.chains = {},
.bonds = std::move(bonds)});

ms->setModelMatrix(chg.model);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,5 @@ std::pair<glm::uint8, dmat3> sample(std::shared_ptr<const TensorField3D> tensorF
}
return std::pair<glm::uint8, dmat3>(glm::uint8{1}, dmat3());
}
} // namespace inviwo

} // namespace inviwo
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <inviwo/tensorvisbase/datastructures/deformablecube.h>

namespace inviwo {

DeformableCube::DeformableCube(const vec4& color) {
createCube(color);

Expand Down Expand Up @@ -183,4 +184,5 @@ void DeformableCube::calculateNormals() {
i++;
}
}
} // namespace inviwo

} // namespace inviwo
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <inviwo/tensorvisbase/datastructures/deformablecylinder.h>

namespace inviwo {

DeformableCylinder::DeformableCylinder(const size_t& numTheta, const vec4& color) {
createCylinder(numTheta, color);

Expand Down Expand Up @@ -204,4 +205,5 @@ void DeformableCylinder::calculateNormals() {

for (auto& normal : normals) normal = -glm::normalize(normal);
}
} // namespace inviwo

} // namespace inviwo
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <inviwo/tensorvisbase/datastructures/deformablesphere.h>

namespace inviwo {

DeformableSphere::DeformableSphere(const size_t& numTheta, const size_t& numPhi,
const vec4& color) {
createSphere(numTheta, numPhi, color);
Expand Down Expand Up @@ -312,4 +313,5 @@ void DeformableSphere::calculateNormals() {
i++;
}
}
} // namespace inviwo

} // namespace inviwo
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,5 @@ IntegralLine::TerminationReason HyperStreamLineTracer::integrate(size_t steps, c

return IntegralLine::TerminationReason::Steps;
}
} // namespace inviwo

} // namespace inviwo
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ void EigenValueProperty::set(const double lambda, const glm::uint8 index) {
lambdas[index]->set(lambda);
}

} // namespace inviwo
} // namespace inviwo
7 changes: 3 additions & 4 deletions tensorvis/tensorvisbase/src/util/tensorutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@

#include <inviwo/core/util/exception.h>

namespace inviwo {
namespace tensorutil {
namespace inviwo::tensorutil {

vec4 tensor2DToDvec4(const dmat2& tensor) {
return vec4(tensor[0][0], tensor[1][0], tensor[1][1], 1.0);
}
Expand Down Expand Up @@ -315,5 +315,4 @@ dmat3 reconstruct(const std::array<double, 3>& eigenvalues,
return S * lambda * S_inv;
}

} // namespace tensorutil
} // namespace inviwo
} // namespace inviwo::tensorutil
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
#define IVW_MODULE_TENSORVISIO_API
#endif

#endif /* _IVW_MODULE_TENSORFIELDIO_DEFINE_H_ */
#endif /* _IVW_MODULE_TENSORFIELDIO_DEFINE_H_ */
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class IVW_MODULE_INTEGRALLINEFILTERING_API IntegralLinesToDataFrame : public Pro
->getEditableRAMRepresentation()
->getDataContainer());
}
funcs.push_back([=](const IntegralLine& line) {
funcs.push_back([=, this](const IntegralLine& line) {
auto& vec = line.getMetaData<T>(Property::getDisplayName());
std::vector<float> values;
std::transform(vec.begin() + 1, vec.end() - 1, std::back_inserter(values),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,12 @@ void IntegralLinesToDataFrame::MetaDataSettings::initFunctions(
}

if (c == 1) { // scalars
ram->dispatch<void, dispatching::filter::Scalars>([=, &funcs, df = &dataFrame](auto ramT) {
using T = typename util::PrecisionValueType<decltype(ramT)>;
createFunction<T>(funcs, *df, percentiles, name,
[=](const T& v) -> float { return static_cast<float>(v); });
});
ram->dispatch<void, dispatching::filter::Scalars>(
[=, this, &funcs, df = &dataFrame](auto ramT) {
using T = typename util::PrecisionValueType<decltype(ramT)>;
createFunction<T>(funcs, *df, percentiles, name,
[=](const T& v) -> float { return static_cast<float>(v); });
});

} else { // vectors
return ram->dispatch<void, dispatching::filter::Vecs>([this, &funcs, name, percentiles, c,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,4 @@ TEST(ShannonEntroyTest, Vectors3D2) {
}
}

} // namespace inviwo
} // namespace inviwo
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,4 @@ TEST(SpraseHistgoramTest, SizeAndCleanup) {
EXPECT_EQ(histogram.numberOfBins(), 1);
}

} // namespace inviwo
} // namespace inviwo

0 comments on commit 042bbb7

Please sign in to comment.