Skip to content

Commit

Permalink
More diff clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
nickbianco committed Aug 29, 2023
1 parent bb4b8be commit 5a74515
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 23 deletions.
1 change: 0 additions & 1 deletion Applications/Scale/test/testScale.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,6 @@ void scalePhysicalOffsetFrames()

PathActuator* act2 = new PathActuator();
act2->setName("pathActuator2");
auto& path2 = act2->updPath<GeometryPath>();
act2->addNewPathPoint("point2a", model->updGround(), Vec3(0));
act2->addNewPathPoint("point2b", *pof2, offset2);
act1->addComponent(act2);
Expand Down
17 changes: 4 additions & 13 deletions Bindings/Java/OpenSimJNI/OpenSimContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include <OpenSim/Simulation/Model/MovingPathPoint.h>
#include <OpenSim/Simulation/Model/Muscle.h>
#include <OpenSim/Simulation/Model/PathPoint.h>
#include <OpenSim/Simulation/Model/GeometryPath.h>
#include <OpenSim/Simulation/Wrap/PathWrap.h>
#include <OpenSim/Simulation/Model/ConditionalPathPoint.h>
#include <OpenSim/Simulation/SimbodyEngine/SimbodyEngine.h>
Expand Down Expand Up @@ -125,21 +124,13 @@ double OpenSimContext::getMuscleLength(Muscle& m) {
}

const Array<AbstractPathPoint*>& OpenSimContext::getCurrentPath(Muscle& m) {
if (auto* p = dynamic_cast<const GeometryPath*>(&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<const GeometryPath*>(&from.getPath())) {
to = from;
recreateSystemKeepStage();
to.updPath<GeometryPath>().updateGeometry(*_configState);
} else {
OPENSIM_THROW(Exception, "Muscle path is not a GeometryPath.")
}
to = from;
recreateSystemKeepStage();
to.updPath<GeometryPath>().updateGeometry(*_configState);
}

// Muscle Points
Expand Down
1 change: 0 additions & 1 deletion Bindings/Java/OpenSimJNI/OpenSimContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ class GeometryPath;
class AbstractPathPoint;
class PathWrap;
class ConditionalPathPoint;
class PathPoint;
class WrapObject;
class Analysis;
class AnalyzeTool;
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
======
Expand Down
5 changes: 2 additions & 3 deletions OpenSim/Actuators/Test/testDeGrooteFregly2016Muscle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<GeometryPath>();
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<DeGrooteFregly2016Muscle>("muscle");

Expand Down
5 changes: 2 additions & 3 deletions OpenSim/Actuators/Test/testMuscles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<GeometryPath>();
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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 5a74515

Please sign in to comment.