From 3a2fb81276f97a2fb2e9fd41e36f440c7118db37 Mon Sep 17 00:00:00 2001 From: Hugo Talbot Date: Mon, 26 Feb 2024 08:09:55 +0100 Subject: [PATCH 1/6] Follow SOFA Lifecycle v24.06 --- src/SoftRobots/component/constraint/model/CableModel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SoftRobots/component/constraint/model/CableModel.cpp b/src/SoftRobots/component/constraint/model/CableModel.cpp index bdf36dc9..ebb1e349 100644 --- a/src/SoftRobots/component/constraint/model/CableModel.cpp +++ b/src/SoftRobots/component/constraint/model/CableModel.cpp @@ -34,7 +34,7 @@ namespace softrobots::constraint using sofa::defaulttype::Vec2Types; using sofa::defaulttype::Vec3Types; -using sofa::type::Vector2; +using sofa::type::Vec2; using namespace sofa::defaulttype; template class SOFA_SOFTROBOTS_API CableModel; From 268d6bc1148f12191ec422ba19a4d19541144f38 Mon Sep 17 00:00:00 2001 From: Hugo Date: Mon, 26 Feb 2024 15:00:52 +0100 Subject: [PATCH 2/6] Apply suggestions from code review Co-authored-by: Alex Bilger --- src/SoftRobots/component/constraint/model/CableModel.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/SoftRobots/component/constraint/model/CableModel.cpp b/src/SoftRobots/component/constraint/model/CableModel.cpp index ebb1e349..1473ed60 100644 --- a/src/SoftRobots/component/constraint/model/CableModel.cpp +++ b/src/SoftRobots/component/constraint/model/CableModel.cpp @@ -34,7 +34,6 @@ namespace softrobots::constraint using sofa::defaulttype::Vec2Types; using sofa::defaulttype::Vec3Types; -using sofa::type::Vec2; using namespace sofa::defaulttype; template class SOFA_SOFTROBOTS_API CableModel; From 89f2a5f764bf5d33469f59689d9e31035dde5a00 Mon Sep 17 00:00:00 2001 From: Hugo Talbot Date: Mon, 26 Feb 2024 08:09:55 +0100 Subject: [PATCH 3/6] Follow SOFA Lifecycle v24.06 --- .../component/constraint/model/CableModel.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/SoftRobots/component/constraint/model/CableModel.cpp b/src/SoftRobots/component/constraint/model/CableModel.cpp index 1473ed60..a52bbcca 100644 --- a/src/SoftRobots/component/constraint/model/CableModel.cpp +++ b/src/SoftRobots/component/constraint/model/CableModel.cpp @@ -31,13 +31,12 @@ namespace softrobots::constraint { + using sofa::defaulttype::Vec2Types; + using sofa::defaulttype::Vec3Types; -using sofa::defaulttype::Vec2Types; -using sofa::defaulttype::Vec3Types; - -using namespace sofa::defaulttype; -template class SOFA_SOFTROBOTS_API CableModel; -template class SOFA_SOFTROBOTS_API CableModel; + using namespace sofa::defaulttype; + template class SOFA_SOFTROBOTS_API CableModel; + template class SOFA_SOFTROBOTS_API CableModel; } // namespace From a43c2a870868d114605363c68f6e0a0c4afce586 Mon Sep 17 00:00:00 2001 From: Hugo Talbot Date: Mon, 26 Feb 2024 15:03:16 +0100 Subject: [PATCH 4/6] remove remaining Vector3 --- src/SoftRobots/component/constraint/model/CableModel.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/SoftRobots/component/constraint/model/CableModel.h b/src/SoftRobots/component/constraint/model/CableModel.h index fe083b37..0e37ec99 100644 --- a/src/SoftRobots/component/constraint/model/CableModel.h +++ b/src/SoftRobots/component/constraint/model/CableModel.h @@ -45,11 +45,9 @@ using sofa::linearalgebra::BaseVector ; using sofa::core::ConstraintParams ; using sofa::helper::ReadAccessor ; using sofa::core::VecCoordId ; -using sofa::type::Vector3; - +using sofa::type::Vec3; using sofa::core::topology::BaseMeshTopology; - using sofa::linearalgebra::BaseVector; /** From 02d8d27acdf3e0d6829c1311d9a40a95b211555f Mon Sep 17 00:00:00 2001 From: Hugo Talbot Date: Wed, 28 Feb 2024 12:05:22 +0100 Subject: [PATCH 5/6] unused var --- src/SoftRobots/component/constraint/model/CableModel.inl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/SoftRobots/component/constraint/model/CableModel.inl b/src/SoftRobots/component/constraint/model/CableModel.inl index f113e1f5..bb276290 100644 --- a/src/SoftRobots/component/constraint/model/CableModel.inl +++ b/src/SoftRobots/component/constraint/model/CableModel.inl @@ -561,6 +561,7 @@ SReal CableModel::getDistanceToTriangle(const Coord& position, const Vec3 projection { sofa::type::NOINIT }; const bool r = sofa::geometry::proximity::computeClosestPointOnTriangleToPoint(Vec3(p0), Vec3(p1), Vec3(p2), Vec3(position), projection); assert(r); + SOFA_UNUSED(r); projectionOnTriangle = projection; const Real distanceToTriangle = (projectionOnTriangle - position).norm(); return distanceToTriangle; From a30fa6bc959a9c7cc7060532b7e5a9c561c23424 Mon Sep 17 00:00:00 2001 From: Hugo Talbot Date: Wed, 28 Feb 2024 12:22:58 +0100 Subject: [PATCH 6/6] remove unused result warning --- .../component/forcefield/PREquivalentStiffnessForceField.inl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/SoftRobots/component/forcefield/PREquivalentStiffnessForceField.inl b/src/SoftRobots/component/forcefield/PREquivalentStiffnessForceField.inl index 1a213964..a0ee6031 100644 --- a/src/SoftRobots/component/forcefield/PREquivalentStiffnessForceField.inl +++ b/src/SoftRobots/component/forcefield/PREquivalentStiffnessForceField.inl @@ -116,7 +116,9 @@ void PREquivalentStiffnessForceField::init() } else { - m_CInv[n].invert(m_complianceMat[n]); + bool invert = m_CInv[n].invert(m_complianceMat[n]); + if(!invert) + msg_error() << "Unable to invert compliance matrix at init"; } } filebuffer.close();