public final class OpenSimPlotter
extends java.lang.Object
Constructor and Description |
---|
OpenSimPlotter() |
Modifier and Type | Method and Description |
---|---|
static org.opensim.plotter.PlotCurve |
addAnalysisCurve(org.opensim.plotter.JPlotterPanel panel,
java.lang.String qName,
java.lang.String muscleName,
java.lang.String genCoordName)
Create a new curve by running the MuscleAnalysis to plot built in quantities.
|
static org.opensim.plotter.PlotCurve |
addCurve(org.opensim.plotter.JPlotterPanel panel,
org.opensim.plotter.PlotterSourceFile src,
java.lang.String domain,
java.lang.String range)
Create a new curve on the passed in Plotter panel, using domain and range specified
as column labels in the passed in data source.
|
static org.opensim.plotter.PlotterSourceFile |
addDataSource(org.opensim.plotter.JPlotterPanel plotter,
java.lang.String dataFilename)
Add data source (File) to the lis of sources available to the passed in Plotter Panel
This allows for reusing the same data source to recreate multiple curves rather than loading it anew
for every curve.
|
static org.opensim.plotter.PlotCurve |
addFunctionCurve(org.opensim.plotter.JPlotterPanel panel,
org.opensim.modeling.Function function)
Create a new curve representing an arbitrary OpenSim::Function and add it to the passed in plotter panel
If panel contains plots then first one is used to obtain domain bounds, otherwise getMinX()-getMaxX is assumed.
|
static org.opensim.plotter.PlotCurve |
addMomentArmCurve(org.opensim.plotter.JPlotterPanel panel,
java.lang.String pathActuatorName,
java.lang.String genCoordName)
Create a curve representing momentArm of passed in PathActuator relative
to a specific Coordinate
|
static org.opensim.plotter.PlotCurve |
addMotionCurve(org.opensim.plotter.JPlotterPanel panel,
java.lang.String qName,
java.lang.String muscleName,
org.opensim.plotter.PlotterSourceMotion dataSource)
Create a new curve by running the MuscleAnalysis to plot built quantity against passed in motion file
|
static org.opensim.plotter.PlotterSourceMotion |
addMotionSource(org.opensim.plotter.JPlotterPanel plotter,
java.lang.String motionFilename)
Add notion source (.mot) to the list of sources available to the passed in Plotter Panel
This allows for reusing the same data source to create multiple curves rather than loading files anew
for every curve.
|
static org.opensim.plotter.JPlotterPanel |
createPlotterPanel(java.lang.String title)
Create a blank PlotterPanel with specified title
|
static void |
exportData(org.opensim.plotter.JPlotterPanel panel,
java.lang.String fileName)
Export all the data on the plotter window to an sto file
|
static org.opensim.plotter.JPlotterPanel |
getLastPlotterPanel()
Get a handle to the last opened plotter window to modify it.
|
static void |
setCurveColor(org.opensim.plotter.JPlotterPanel panel,
int series,
float r,
float g,
float b)
Set the color to use for the passed in curve as RGB
|
static void |
setCurveLegend(org.opensim.plotter.PlotCurve cv,
java.lang.String legend)
Set the Legend for the passed in curve
|
public static org.opensim.plotter.JPlotterPanel createPlotterPanel(java.lang.String title)
title
- public static org.opensim.plotter.PlotterSourceFile addDataSource(org.opensim.plotter.JPlotterPanel plotter, java.lang.String dataFilename)
plotter
- PlotterPanel to usedataFilename
- Full path of the file name to be used as a data source (.sto or .mot are expected)public static org.opensim.plotter.PlotterSourceMotion addMotionSource(org.opensim.plotter.JPlotterPanel plotter, java.lang.String motionFilename)
plotter
- PlotterPanel to usemotionFilename
- Full path of the file name to be used as a data source (.mot is expected)public static org.opensim.plotter.PlotCurve addCurve(org.opensim.plotter.JPlotterPanel panel, org.opensim.plotter.PlotterSourceFile src, java.lang.String domain, java.lang.String range)
panel
- PlotterPanel to render the curve onsrc
- data source used to obtain datadomain
- column label corresponding to domainrange
- column label corresponding to rangepublic static org.opensim.plotter.PlotCurve addAnalysisCurve(org.opensim.plotter.JPlotterPanel panel, java.lang.String qName, java.lang.String muscleName, java.lang.String genCoordName)
panel
- PlotterPanel to render the curve onqName
- quantity to plot, vaid options are:
moment.${genCoordName},
momentarm.${genCoordName},
"Length",
"FiberLength",
"TendonLength",
"NormalizedFiberLength",
"TendonForce",
"ActiveFiberForce",
"PassiveFiberForce",
"FiberForce"muscleName
- name of a muscle of interest as it appears in the modelgenCoordName
- name of generalized coordinate as it appears in modelpublic static org.opensim.plotter.PlotCurve addMomentArmCurve(org.opensim.plotter.JPlotterPanel panel, java.lang.String pathActuatorName, java.lang.String genCoordName)
panel
- to draw onpathActuatorName
- PathActuator namegenCoordName
- Gencoord namepublic static org.opensim.plotter.PlotCurve addMotionCurve(org.opensim.plotter.JPlotterPanel panel, java.lang.String qName, java.lang.String muscleName, org.opensim.plotter.PlotterSourceMotion dataSource)
panel
- qName
- quantity name vaid options are:
moment.${genCoordName},
momentarm.${genCoordName},
"Length",
"FiberLength",
"TendonLength",
"NormalizedFiberLength",
"TendonForce",
"ActiveFiberForce",
"PassiveFiberForce",
"FiberForce"muscleName
- name of a muscle of interest as it appears in the modelpublic static org.opensim.plotter.PlotCurve addFunctionCurve(org.opensim.plotter.JPlotterPanel panel, org.opensim.modeling.Function function)
panel
- panel to add the curve tofunction
- Any OpenSim functionpublic static void setCurveLegend(org.opensim.plotter.PlotCurve cv, java.lang.String legend)
cv
- : handle to PlotCurvelegend
- : new String for legendpublic static void setCurveColor(org.opensim.plotter.JPlotterPanel panel, int series, float r, float g, float b)
panel
- : Plotter panelseries
- : Curve numberr
- :red color component 0,1g
- : green color component 0,1b
- : blue color component 0, 1public static void exportData(org.opensim.plotter.JPlotterPanel panel, java.lang.String fileName)
panel
- reference to the PlotterPanel whose curves are being exported.fileName
- : Name of output file name to export data to.public static org.opensim.plotter.JPlotterPanel getLastPlotterPanel()