Skip to content

Commit 33d6e58

Browse files
authored
Update core bindings 092624 (#1521)
* Add title to file browser cascade dialog in Id output directory selection, and safeguard against null description elsewhere * Bring java source (swig generated) in sync with opensim-core * Remove unused files
1 parent 4fe7a0f commit 33d6e58

File tree

105 files changed

+3085
-994
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+3085
-994
lines changed

Gui/opensim/modeling/src/org/opensim/modeling/AbstractGeometryPath.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,25 @@ public double getLengtheningSpeed(State s) {
162162
return opensimSimulationJNI.AbstractGeometryPath_getLengtheningSpeed(swigCPtr, this, State.getCPtr(s), s);
163163
}
164164

165+
/**
166+
* Requests that the concrete implementation produces forces resulting from<br>
167+
* applying a tension along its path, emitting them into the supplied<br>
168+
* `ForceConsumer`.<br>
169+
* <br>
170+
* @param state the state used to evaluate forces<br>
171+
* @param tension scalar of the applied (+ve) tensile force<br>
172+
* @param forceConsumer a `ForceConsumer` shall receive each produced force
173+
*/
174+
public void produceForces(State state, double tension, SWIGTYPE_p_OpenSim__ForceConsumer forceConsumer) {
175+
opensimSimulationJNI.AbstractGeometryPath_produceForces(swigCPtr, this, State.getCPtr(state), state, tension, SWIGTYPE_p_OpenSim__ForceConsumer.getCPtr(forceConsumer));
176+
}
177+
165178
/**
166179
* Add in the equivalent body and generalized forces to be applied to the<br>
167180
* multibody system resulting from a tension along the AbstractGeometryPath.<br>
168181
* <br>
182+
* Note: this internally uses `produceForces`<br>
183+
* <br>
169184
* @param state state used to evaluate forces<br>
170185
* @param tension scalar of the applied (+ve) tensile force<br>
171186
* @param bodyForces Vector of forces (SpatialVec's) on bodies<br>

Gui/opensim/modeling/src/org/opensim/modeling/Actuator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* <br>
1616
* @author Ajay Seth
1717
*/
18-
public class Actuator extends Force {
18+
public class Actuator extends ForceProducer {
1919
private transient long swigCPtr;
2020

2121
public Actuator(long cPtr, boolean cMemoryOwn) {

Gui/opensim/modeling/src/org/opensim/modeling/ActuatorIterator.java

Lines changed: 51 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,33 @@ public void computeEquilibrium(State s) {
166166
opensimSimulationJNI.ActuatorIterator_computeEquilibrium(swigCPtr, this, State.getCPtr(s), s);
167167
}
168168

169+
/**
170+
* Uses `implProduceForces` to produce (emit) forces evaluated from `state` into the<br>
171+
* provided `ForceConsumer`.<br>
172+
* <br>
173+
* Note: this function only produces the forces and does not apply them to anything. It's<br>
174+
* up to the `ForceConsumer` implementation to handle the forces. Therefore,<br>
175+
* `Force::appliesForces` is ignored by this method.<br>
176+
* <br>
177+
* @param state the state used to evaluate forces<br>
178+
*
179+
*/
180+
public void produceForces(State state, SWIGTYPE_p_OpenSim__ForceConsumer forceConsumer) {
181+
opensimSimulationJNI.ActuatorIterator_produceForces(swigCPtr, this, State.getCPtr(state), state, SWIGTYPE_p_OpenSim__ForceConsumer.getCPtr(forceConsumer));
182+
}
183+
184+
/**
185+
* Inhereted from `OpenSim::Force`.<br>
186+
* <br>
187+
* `ForceProducer` overrides `OpenSim::Force::computeForce` with a default<br>
188+
* implementation that, provided `OpenSim::Force::appliesForces` is `true`,<br>
189+
* internally uses `produceForces` to mutate the provided `bodyForces` in a<br>
190+
* manner that's compatible with the `OpenSim::Force` API.
191+
*/
192+
public void computeForce(State state, VectorOfSpatialVec bodyForces, Vector generalizedForces) {
193+
opensimSimulationJNI.ActuatorIterator_computeForce(swigCPtr, this, State.getCPtr(state), state, VectorOfSpatialVec.getCPtr(bodyForces), bodyForces, Vector.getCPtr(generalizedForces), generalizedForces);
194+
}
195+
169196
public boolean get_appliesForce(int i) {
170197
return opensimSimulationJNI.ActuatorIterator_get_appliesForce__SWIG_0(swigCPtr, this, i);
171198
}
@@ -707,7 +734,11 @@ public AbstractOutput getOutput(String name) {
707734
* @see Component#resolveVariableNameAndOwner()
708735
*/
709736
public int getModelingOption(State state, String path) {
710-
return opensimSimulationJNI.ActuatorIterator_getModelingOption(swigCPtr, this, State.getCPtr(state), state, path);
737+
return opensimSimulationJNI.ActuatorIterator_getModelingOption__SWIG_0(swigCPtr, this, State.getCPtr(state), state, path);
738+
}
739+
740+
public int getModelingOption(State state, ComponentPath path) {
741+
return opensimSimulationJNI.ActuatorIterator_getModelingOption__SWIG_1(swigCPtr, this, State.getCPtr(state), state, ComponentPath.getCPtr(path), path);
711742
}
712743

713744
/**
@@ -736,7 +767,11 @@ public int getModelingOption(State state, String path) {
736767
* @see Component#resolveVariableNameAndOwner()
737768
*/
738769
public void setModelingOption(State state, String path, int flag) {
739-
opensimSimulationJNI.ActuatorIterator_setModelingOption(swigCPtr, this, State.getCPtr(state), state, path, flag);
770+
opensimSimulationJNI.ActuatorIterator_setModelingOption__SWIG_0(swigCPtr, this, State.getCPtr(state), state, path, flag);
771+
}
772+
773+
public void setModelingOption(State state, ComponentPath path, int flag) {
774+
opensimSimulationJNI.ActuatorIterator_setModelingOption__SWIG_1(swigCPtr, this, State.getCPtr(state), state, ComponentPath.getCPtr(path), path, flag);
740775
}
741776

742777
/**
@@ -770,7 +805,7 @@ public double getStateVariableValue(State state, String name) {
770805
}<br>
771806
* <br>
772807
* @param state the State for which to get the value<br>
773-
* <br>
808+
* @param path path to the state variable of interest<br>
774809
* @throws ComponentHasNoSystem if this Component has not been added to a<br>
775810
* System (i.e., if initSystem has not been called)
776811
*/
@@ -835,7 +870,19 @@ public void setStateVariableValues(State state, Vector values) {
835870
* System (i.e., if initSystem has not been called)
836871
*/
837872
public double getStateVariableDerivativeValue(State state, String name) {
838-
return opensimSimulationJNI.ActuatorIterator_getStateVariableDerivativeValue(swigCPtr, this, State.getCPtr(state), state, name);
873+
return opensimSimulationJNI.ActuatorIterator_getStateVariableDerivativeValue__SWIG_0(swigCPtr, this, State.getCPtr(state), state, name);
874+
}
875+
876+
/**
877+
* Get the value of a state variable derivative computed by this Component.<br>
878+
* <br>
879+
* @param state the State for which to get the derivative value<br>
880+
* @param path path to the state variable of interest<br>
881+
* @throws ComponentHasNoSystem if this Component has not been added to a<br>
882+
* System (i.e., if initSystem has not been called)
883+
*/
884+
public double getStateVariableDerivativeValue(State state, ComponentPath path) {
885+
return opensimSimulationJNI.ActuatorIterator_getStateVariableDerivativeValue__SWIG_1(swigCPtr, this, State.getCPtr(state), state, ComponentPath.getCPtr(path), path);
839886
}
840887

841888
/**

Gui/opensim/modeling/src/org/opensim/modeling/ActuatorList.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ public ActuatorList(Component root, ComponentFilter f) {
6060

6161
/**
6262
* Constructor that takes only a Component to iterate over (itself and its<br>
63-
* descendants). ComponentFilterMatchAll is used internally. You can<br>
64-
* change the filter using setFilter() method.
63+
* descendants). You can change the filter using setFilter() method.
6564
*/
6665
public ActuatorList(Component root) {
6766
this(opensimSimulationJNI.new_ActuatorList__SWIG_1(Component.getCPtr(root), root), true);

Gui/opensim/modeling/src/org/opensim/modeling/Blankevoort1991Ligament.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ When scaling a model (using the ScaleTool) that contains a
147147
148148
149149
*/
150-
public class Blankevoort1991Ligament extends Force {
150+
public class Blankevoort1991Ligament extends ForceProducer {
151151
private transient long swigCPtr;
152152

153153
public Blankevoort1991Ligament(long cPtr, boolean cMemoryOwn) {
@@ -579,10 +579,6 @@ public double computeMomentArm(State s, Coordinate aCoord) {
579579
return opensimSimulationJNI.Blankevoort1991Ligament_computeMomentArm(swigCPtr, this, State.getCPtr(s), s, Coordinate.getCPtr(aCoord), aCoord);
580580
}
581581

582-
public void computeForce(State s, VectorOfSpatialVec bodyForces, Vector generalizedForces) {
583-
opensimSimulationJNI.Blankevoort1991Ligament_computeForce(swigCPtr, this, State.getCPtr(s), s, VectorOfSpatialVec.getCPtr(bodyForces), bodyForces, Vector.getCPtr(generalizedForces), generalizedForces);
584-
}
585-
586582
public double computePotentialEnergy(State state) {
587583
return opensimSimulationJNI.Blankevoort1991Ligament_computePotentialEnergy(swigCPtr, this, State.getCPtr(state), state);
588584
}

Gui/opensim/modeling/src/org/opensim/modeling/BodyIterator.java

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -984,7 +984,11 @@ public AbstractOutput getOutput(String name) {
984984
* @see Component#resolveVariableNameAndOwner()
985985
*/
986986
public int getModelingOption(State state, String path) {
987-
return opensimSimulationJNI.BodyIterator_getModelingOption(swigCPtr, this, State.getCPtr(state), state, path);
987+
return opensimSimulationJNI.BodyIterator_getModelingOption__SWIG_0(swigCPtr, this, State.getCPtr(state), state, path);
988+
}
989+
990+
public int getModelingOption(State state, ComponentPath path) {
991+
return opensimSimulationJNI.BodyIterator_getModelingOption__SWIG_1(swigCPtr, this, State.getCPtr(state), state, ComponentPath.getCPtr(path), path);
988992
}
989993

990994
/**
@@ -1013,7 +1017,11 @@ public int getModelingOption(State state, String path) {
10131017
* @see Component#resolveVariableNameAndOwner()
10141018
*/
10151019
public void setModelingOption(State state, String path, int flag) {
1016-
opensimSimulationJNI.BodyIterator_setModelingOption(swigCPtr, this, State.getCPtr(state), state, path, flag);
1020+
opensimSimulationJNI.BodyIterator_setModelingOption__SWIG_0(swigCPtr, this, State.getCPtr(state), state, path, flag);
1021+
}
1022+
1023+
public void setModelingOption(State state, ComponentPath path, int flag) {
1024+
opensimSimulationJNI.BodyIterator_setModelingOption__SWIG_1(swigCPtr, this, State.getCPtr(state), state, ComponentPath.getCPtr(path), path, flag);
10171025
}
10181026

10191027
/**
@@ -1047,7 +1055,7 @@ public double getStateVariableValue(State state, String name) {
10471055
}<br>
10481056
* <br>
10491057
* @param state the State for which to get the value<br>
1050-
* <br>
1058+
* @param path path to the state variable of interest<br>
10511059
* @throws ComponentHasNoSystem if this Component has not been added to a<br>
10521060
* System (i.e., if initSystem has not been called)
10531061
*/
@@ -1112,7 +1120,19 @@ public void setStateVariableValues(State state, Vector values) {
11121120
* System (i.e., if initSystem has not been called)
11131121
*/
11141122
public double getStateVariableDerivativeValue(State state, String name) {
1115-
return opensimSimulationJNI.BodyIterator_getStateVariableDerivativeValue(swigCPtr, this, State.getCPtr(state), state, name);
1123+
return opensimSimulationJNI.BodyIterator_getStateVariableDerivativeValue__SWIG_0(swigCPtr, this, State.getCPtr(state), state, name);
1124+
}
1125+
1126+
/**
1127+
* Get the value of a state variable derivative computed by this Component.<br>
1128+
* <br>
1129+
* @param state the State for which to get the derivative value<br>
1130+
* @param path path to the state variable of interest<br>
1131+
* @throws ComponentHasNoSystem if this Component has not been added to a<br>
1132+
* System (i.e., if initSystem has not been called)
1133+
*/
1134+
public double getStateVariableDerivativeValue(State state, ComponentPath path) {
1135+
return opensimSimulationJNI.BodyIterator_getStateVariableDerivativeValue__SWIG_1(swigCPtr, this, State.getCPtr(state), state, ComponentPath.getCPtr(path), path);
11161136
}
11171137

11181138
/**

Gui/opensim/modeling/src/org/opensim/modeling/BodyList.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ public BodyList(Component root, ComponentFilter f) {
6060

6161
/**
6262
* Constructor that takes only a Component to iterate over (itself and its<br>
63-
* descendants). ComponentFilterMatchAll is used internally. You can<br>
64-
* change the filter using setFilter() method.
63+
* descendants). You can change the filter using setFilter() method.
6564
*/
6665
public BodyList(Component root) {
6766
this(opensimSimulationJNI.new_BodyList__SWIG_1(Component.getCPtr(root), root), true);

Gui/opensim/modeling/src/org/opensim/modeling/Component.java

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,11 @@ public AbstractOutput updOutput(String name) {
863863
* @see Component#resolveVariableNameAndOwner()
864864
*/
865865
public int getModelingOption(State state, String path) {
866-
return opensimCommonJNI.Component_getModelingOption(swigCPtr, this, State.getCPtr(state), state, path);
866+
return opensimCommonJNI.Component_getModelingOption__SWIG_0(swigCPtr, this, State.getCPtr(state), state, path);
867+
}
868+
869+
public int getModelingOption(State state, ComponentPath path) {
870+
return opensimCommonJNI.Component_getModelingOption__SWIG_1(swigCPtr, this, State.getCPtr(state), state, ComponentPath.getCPtr(path), path);
867871
}
868872

869873
/**
@@ -892,7 +896,11 @@ public int getModelingOption(State state, String path) {
892896
* @see Component#resolveVariableNameAndOwner()
893897
*/
894898
public void setModelingOption(State state, String path, int flag) {
895-
opensimCommonJNI.Component_setModelingOption(swigCPtr, this, State.getCPtr(state), state, path, flag);
899+
opensimCommonJNI.Component_setModelingOption__SWIG_0(swigCPtr, this, State.getCPtr(state), state, path, flag);
900+
}
901+
902+
public void setModelingOption(State state, ComponentPath path, int flag) {
903+
opensimCommonJNI.Component_setModelingOption__SWIG_1(swigCPtr, this, State.getCPtr(state), state, ComponentPath.getCPtr(path), path, flag);
896904
}
897905

898906
/**
@@ -926,7 +934,7 @@ public double getStateVariableValue(State state, String name) {
926934
}<br>
927935
* <br>
928936
* @param state the State for which to get the value<br>
929-
* <br>
937+
* @param path path to the state variable of interest<br>
930938
* @throws ComponentHasNoSystem if this Component has not been added to a<br>
931939
* System (i.e., if initSystem has not been called)
932940
*/
@@ -991,7 +999,19 @@ public void setStateVariableValues(State state, Vector values) {
991999
* System (i.e., if initSystem has not been called)
9921000
*/
9931001
public double getStateVariableDerivativeValue(State state, String name) {
994-
return opensimCommonJNI.Component_getStateVariableDerivativeValue(swigCPtr, this, State.getCPtr(state), state, name);
1002+
return opensimCommonJNI.Component_getStateVariableDerivativeValue__SWIG_0(swigCPtr, this, State.getCPtr(state), state, name);
1003+
}
1004+
1005+
/**
1006+
* Get the value of a state variable derivative computed by this Component.<br>
1007+
* <br>
1008+
* @param state the State for which to get the derivative value<br>
1009+
* @param path path to the state variable of interest<br>
1010+
* @throws ComponentHasNoSystem if this Component has not been added to a<br>
1011+
* System (i.e., if initSystem has not been called)
1012+
*/
1013+
public double getStateVariableDerivativeValue(State state, ComponentPath path) {
1014+
return opensimCommonJNI.Component_getStateVariableDerivativeValue__SWIG_1(swigCPtr, this, State.getCPtr(state), state, ComponentPath.getCPtr(path), path);
9951015
}
9961016

9971017
/**

Gui/opensim/modeling/src/org/opensim/modeling/ComponentIterator.java

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,11 @@ public AbstractOutput getOutput(String name) {
587587
* @see Component#resolveVariableNameAndOwner()
588588
*/
589589
public int getModelingOption(State state, String path) {
590-
return opensimCommonJNI.ComponentIterator_getModelingOption(swigCPtr, this, State.getCPtr(state), state, path);
590+
return opensimCommonJNI.ComponentIterator_getModelingOption__SWIG_0(swigCPtr, this, State.getCPtr(state), state, path);
591+
}
592+
593+
public int getModelingOption(State state, ComponentPath path) {
594+
return opensimCommonJNI.ComponentIterator_getModelingOption__SWIG_1(swigCPtr, this, State.getCPtr(state), state, ComponentPath.getCPtr(path), path);
591595
}
592596

593597
/**
@@ -616,7 +620,11 @@ public int getModelingOption(State state, String path) {
616620
* @see Component#resolveVariableNameAndOwner()
617621
*/
618622
public void setModelingOption(State state, String path, int flag) {
619-
opensimCommonJNI.ComponentIterator_setModelingOption(swigCPtr, this, State.getCPtr(state), state, path, flag);
623+
opensimCommonJNI.ComponentIterator_setModelingOption__SWIG_0(swigCPtr, this, State.getCPtr(state), state, path, flag);
624+
}
625+
626+
public void setModelingOption(State state, ComponentPath path, int flag) {
627+
opensimCommonJNI.ComponentIterator_setModelingOption__SWIG_1(swigCPtr, this, State.getCPtr(state), state, ComponentPath.getCPtr(path), path, flag);
620628
}
621629

622630
/**
@@ -650,7 +658,7 @@ public double getStateVariableValue(State state, String name) {
650658
}<br>
651659
* <br>
652660
* @param state the State for which to get the value<br>
653-
* <br>
661+
* @param path path to the state variable of interest<br>
654662
* @throws ComponentHasNoSystem if this Component has not been added to a<br>
655663
* System (i.e., if initSystem has not been called)
656664
*/
@@ -715,7 +723,19 @@ public void setStateVariableValues(State state, Vector values) {
715723
* System (i.e., if initSystem has not been called)
716724
*/
717725
public double getStateVariableDerivativeValue(State state, String name) {
718-
return opensimCommonJNI.ComponentIterator_getStateVariableDerivativeValue(swigCPtr, this, State.getCPtr(state), state, name);
726+
return opensimCommonJNI.ComponentIterator_getStateVariableDerivativeValue__SWIG_0(swigCPtr, this, State.getCPtr(state), state, name);
727+
}
728+
729+
/**
730+
* Get the value of a state variable derivative computed by this Component.<br>
731+
* <br>
732+
* @param state the State for which to get the derivative value<br>
733+
* @param path path to the state variable of interest<br>
734+
* @throws ComponentHasNoSystem if this Component has not been added to a<br>
735+
* System (i.e., if initSystem has not been called)
736+
*/
737+
public double getStateVariableDerivativeValue(State state, ComponentPath path) {
738+
return opensimCommonJNI.ComponentIterator_getStateVariableDerivativeValue__SWIG_1(swigCPtr, this, State.getCPtr(state), state, ComponentPath.getCPtr(path), path);
719739
}
720740

721741
/**

Gui/opensim/modeling/src/org/opensim/modeling/ComponentPath.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,13 @@ public synchronized void delete() {
6565
}
6666
}
6767

68+
/**
69+
* Returns the separator used to delimit path elements in the path
70+
*/
71+
public static char separator() {
72+
return opensimCommonJNI.ComponentPath_separator();
73+
}
74+
6875
/**
6976
* Returns the root component path (i.e. "/")
7077
*/

0 commit comments

Comments
 (0)