From 4e374a506bc879db4c2aee4abea31d39980cc422 Mon Sep 17 00:00:00 2001 From: Nicholas Bianco Date: Tue, 22 Oct 2024 14:38:28 -0700 Subject: [PATCH 1/2] Add SubjectOnDiskTrial::getName() --- dart/biomechanics/SubjectOnDisk.cpp | 5 +++++ dart/biomechanics/SubjectOnDisk.hpp | 1 + 2 files changed, 6 insertions(+) diff --git a/dart/biomechanics/SubjectOnDisk.cpp b/dart/biomechanics/SubjectOnDisk.cpp index 077ceab40..a6f474e70 100644 --- a/dart/biomechanics/SubjectOnDisk.cpp +++ b/dart/biomechanics/SubjectOnDisk.cpp @@ -3215,6 +3215,11 @@ void SubjectOnDiskTrial::setName(const std::string& name) mName = name; } +const std::string& SubjectOnDiskTrial::getName() const +{ + return mName; +} + void SubjectOnDiskTrial::setTimestep(s_t timestep) { mTimestep = timestep; diff --git a/dart/biomechanics/SubjectOnDisk.hpp b/dart/biomechanics/SubjectOnDisk.hpp index 3bcb4619b..aec06124a 100644 --- a/dart/biomechanics/SubjectOnDisk.hpp +++ b/dart/biomechanics/SubjectOnDisk.hpp @@ -328,6 +328,7 @@ class SubjectOnDiskTrial public: SubjectOnDiskTrial(); void setName(const std::string& name); + const std::string& getName() const; void setTimestep(s_t timestep); s_t getTimestep(); void setTrialLength(int length); From 636b26141a1f725e13cea4aec05fd111bcf3148b Mon Sep 17 00:00:00 2001 From: Nicholas Bianco Date: Tue, 22 Oct 2024 14:43:22 -0700 Subject: [PATCH 2/2] Add Python binding to getName() --- python/_nimblephysics/biomechanics/SubjectOnDisk.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/python/_nimblephysics/biomechanics/SubjectOnDisk.cpp b/python/_nimblephysics/biomechanics/SubjectOnDisk.cpp index 6e13db8e8..942e1efc5 100644 --- a/python/_nimblephysics/biomechanics/SubjectOnDisk.cpp +++ b/python/_nimblephysics/biomechanics/SubjectOnDisk.cpp @@ -876,6 +876,9 @@ Note that these are specified in the local body frame, acting on the body at its "setName", &dart::biomechanics::SubjectOnDiskTrial::setName, ::py::arg("name")) + .def( + "getName", + &dart::biomechanics::SubjectOnDiskTrial::getName) .def( "setTimestep", &dart::biomechanics::SubjectOnDiskTrial::setTimestep,