diff --git a/Applications/Scale/test/testScale.cpp b/Applications/Scale/test/testScale.cpp index b42af1e408..0046f7c432 100644 --- a/Applications/Scale/test/testScale.cpp +++ b/Applications/Scale/test/testScale.cpp @@ -575,7 +575,6 @@ void scalePhysicalOffsetFrames() PathActuator* act2 = new PathActuator(); act2->setName("pathActuator2"); - auto& path2 = act2->updPath(); act2->addNewPathPoint("point2a", model->updGround(), Vec3(0)); act2->addNewPathPoint("point2b", *pof2, offset2); act1->addComponent(act2); diff --git a/Bindings/Java/OpenSimJNI/OpenSimContext.cpp b/Bindings/Java/OpenSimJNI/OpenSimContext.cpp index 360478b686..c52213df80 100644 --- a/Bindings/Java/OpenSimJNI/OpenSimContext.cpp +++ b/Bindings/Java/OpenSimJNI/OpenSimContext.cpp @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include @@ -125,21 +124,13 @@ double OpenSimContext::getMuscleLength(Muscle& m) { } const Array& OpenSimContext::getCurrentPath(Muscle& m) { - if (auto* p = dynamic_cast(&m.getPath())) { - return p->getCurrentPath(*_configState); - } else { - OPENSIM_THROW(Exception, "Muscle path is not a GeometryPath.") - } + return m.getGeometryPath().getCurrentPath(*_configState); } void OpenSimContext::copyMuscle(Muscle& from, Muscle& to) { - if (auto* p = dynamic_cast(&from.getPath())) { - to = from; - recreateSystemKeepStage(); - to.updPath().updateGeometry(*_configState); - } else { - OPENSIM_THROW(Exception, "Muscle path is not a GeometryPath.") - } + to = from; + recreateSystemKeepStage(); + to.updPath().updateGeometry(*_configState); } // Muscle Points diff --git a/Bindings/Java/OpenSimJNI/OpenSimContext.h b/Bindings/Java/OpenSimJNI/OpenSimContext.h index 60694317dc..7eded75a6d 100644 --- a/Bindings/Java/OpenSimJNI/OpenSimContext.h +++ b/Bindings/Java/OpenSimJNI/OpenSimContext.h @@ -48,7 +48,6 @@ class GeometryPath; class AbstractPathPoint; class PathWrap; class ConditionalPathPoint; -class PathPoint; class WrapObject; class Analysis; class AnalyzeTool; diff --git a/CHANGELOG.md b/CHANGELOG.md index ba5726f138..3a8f903ae2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ This is not a comprehensive list of changes but rather a hand-curated collection v4.5 ==== -- Added `AbstractPath` which is a base class for `GeometryPath` and other path types (#3388). TODO: add API changes. +- Added `AbstractPath` which is a base class for `GeometryPath` and other path types (#3388). v4.4.1 ====== diff --git a/OpenSim/Actuators/Test/testDeGrooteFregly2016Muscle.cpp b/OpenSim/Actuators/Test/testDeGrooteFregly2016Muscle.cpp index 1342d6f5a3..36b724b248 100644 --- a/OpenSim/Actuators/Test/testDeGrooteFregly2016Muscle.cpp +++ b/OpenSim/Actuators/Test/testDeGrooteFregly2016Muscle.cpp @@ -142,9 +142,8 @@ TEST_CASE("DeGrooteFregly2016Muscle basics") { musclePtr->set_ignore_tendon_compliance(true); musclePtr->set_fiber_damping(0); musclePtr->setName("muscle"); - auto& path = musclePtr->updPath(); - path.appendNewPathPoint("origin", model.updGround(), SimTK::Vec3(0)); - path.appendNewPathPoint("insertion", *body, SimTK::Vec3(0)); + musclePtr->addNewPathPoint("origin", model.updGround(), SimTK::Vec3(0)); + musclePtr->addNewPathPoint("insertion", *body, SimTK::Vec3(0)); model.addComponent(musclePtr); auto& muscle = model.updComponent("muscle"); diff --git a/OpenSim/Actuators/Test/testMuscles.cpp b/OpenSim/Actuators/Test/testMuscles.cpp index 32b56799be..5a9b4b3864 100644 --- a/OpenSim/Actuators/Test/testMuscles.cpp +++ b/OpenSim/Actuators/Test/testMuscles.cpp @@ -873,9 +873,8 @@ void testMillard2012EquilibriumMuscle() const double tendonSlackLength = 100.0; //long tendon auto muscle = new Millard2012EquilibriumMuscle("muscle", 1., optimalFiberLength, tendonSlackLength, 0.); - auto& path = muscle->updPath(); - path.appendNewPathPoint("p1", model.updGround(), SimTK::Vec3(0)); - path.appendNewPathPoint("p2", model.updGround(), SimTK::Vec3(0,0,1)); + muscle->addNewPathPoint("p1", model.updGround(), SimTK::Vec3(0)); + muscle->addNewPathPoint("p2", model.updGround(), SimTK::Vec3(0,0,1)); model.addForce(muscle); SimTK::State& state = model.initSystem(); diff --git a/OpenSim/Examples/ExampleLuxoMuscle/LuxoMuscle_create_and_simulate.cpp b/OpenSim/Examples/ExampleLuxoMuscle/LuxoMuscle_create_and_simulate.cpp index bdb3567aea..279ec4bdb5 100644 --- a/OpenSim/Examples/ExampleLuxoMuscle/LuxoMuscle_create_and_simulate.cpp +++ b/OpenSim/Examples/ExampleLuxoMuscle/LuxoMuscle_create_and_simulate.cpp @@ -760,7 +760,6 @@ void createLuxoJr(OpenSim::Model& model){ new Millard2012EquilibriumMuscle("back_extensor_left", back_extensor_F0, back_extensor_lm0, back_extensor_lts, pennationAngle); - backExtensorLeft->addNewPathPoint("back_extensor_left_origin", *chest, back_extensor_origin); backExtensorLeft->addNewPathPoint("back_extensor_left_insertion", *back,