artisynth.core.probes
Class NumericProbeBase

java.lang.Object
  extended by artisynth.core.modelbase.ModelComponentBase
      extended by artisynth.core.modelbase.ModelAgentBase
          extended by artisynth.core.probes.Probe
              extended by artisynth.core.probes.NumericProbeBase
All Implemented Interfaces:
Displayable, HasState, ModelAgent, ModelComponent, java.lang.Cloneable, HasProperties, HierarchyNode, Scannable
Direct Known Subclasses:
NumericInputProbe, NumericOutputProbe

public abstract class NumericProbeBase
extends Probe
implements Displayable


Nested Class Summary
 
Nested classes/interfaces inherited from interface artisynth.core.modelbase.ModelComponent
ModelComponent.NavpanelVisibility
 
Field Summary
static PropertyList myProps
           
 
Fields inherited from class artisynth.core.probes.Probe
useOldSaveMethod, writeStartStopTimeInSeconds
 
Fields inherited from class artisynth.core.modelbase.ModelComponentBase
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames
 
Constructor Summary
NumericProbeBase()
           
 
Method Summary
abstract  void apply(double t)
          Called when the probe is being applied to a model
 void applyDefaultDisplayRanges()
           
 java.lang.Object clone()
           
 void createNumericList(int vsize)
           
 void decreaseDisplayRanges()
          Decrease the display range of each numeric probe panel.
 void dispose()
          Remove resources used by this agent.
 PropertyList getAllPropertyInfo()
          Returns a list giving static information about all properties exported by this object.
 Property[] getAttachedProperties()
           
 VectorNd getData(double sec)
           
 double getDefaultDisplayMax()
           
 double getDefaultDisplayMin()
           
 double[] getDefaultDisplayRange()
           
 javax.swing.JPanel getDisplay(int w, int h, boolean isLargeDisplay)
           
 NumericProbeDriver[] getDrivers()
           
 java.lang.String getFormat()
           
 Interpolation getInterpolation()
          Returns the interpolation method for this numeric input probe.
 Interpolation.Order getInterpolationOrder()
          Returns the interpolation order for this numeric probe.
 LegendDisplay getLegend()
           
 double[] getMinMaxValues()
           
 NumericList getNumericList()
           
 int getOrderedTraceIndex(int order)
           
 PlotTraceInfo getPlotTraceInfo(int idx)
           
 double[] getRange()
           
 void getRangeHints(double[] ranges)
          Gets the range hints associated with this displayable object.
 java.awt.Color getTraceColor(int idx)
           
 java.lang.String getTraceLabel(int idx)
           
 double[][] getValues()
          Returns the values of this probe as a two dimensional array of doubles.
 java.util.LinkedHashMap<java.lang.String,NumericProbeVariable> getVariables()
           
 int getVsize()
           
 void increaseDisplayRanges()
          Increase the display range of each numeric probe panel.
 boolean isCloneable()
           
 boolean isEmpty()
           
 boolean isPrintable()
           
 boolean isSmallDisplayVisible()
           
 boolean isTraceVisible(int idx)
           
static boolean isValidVariableName(java.lang.String name)
           
 void print(double sec)
           
 boolean removeDisplay(javax.swing.JPanel display)
           
 void removeLegend()
           
 void resetTraceColors()
           
 void resetTraceOrder()
           
 void scaleNumericList(double scale)
          Scales the values of a numberic probe.
 void setDefaultDisplayRange(double[] minmax)
           
 void setDefaultDisplayRange(double min, double max)
           
 void setFormat(java.lang.String fmtStr)
           
 void setInterpolation(Interpolation method)
          Sets the interpolation method for this numeric input probe.
 void setInterpolationOrder(Interpolation.Order order)
          Sets the interpolation order for this numeric probe.
 void setLegendLabels(java.util.ArrayList<java.lang.String> labels)
           
 void setRangeHints(double[] ranges)
          Sets the range hints associated with this displayable object.
 void setScale(double s)
           
 void setSmallDisplayVisible(boolean visible)
           
 void setTraceColor(int idx, java.awt.Color color)
           
 void setTraceLabel(int idx, java.lang.String label)
           
 void setTraceOrder(int[] indices)
          Sets a new ordering for the plot traces.
 void setTraceVisible(int idx, boolean visible)
           
 void setValues(double[][] vals)
          Sets the values of this numeric probe from a two dimensional array of doubles.
 void swapPlotTraceOrder(PlotTraceInfo pti0, PlotTraceInfo pti1)
           
 void updateDisplays()
           
 void updateDisplays(NumericProbePanel notToUpdate)
           
 void updateDisplaysForPropertyChanges()
          Update displays if associated properties (like interpolation) have changed.
 void updateDisplaysWithoutAutoRanging()
          Update displays with auto-ranging suppressed.
 
Methods inherited from class artisynth.core.probes.Probe
createState, getAttachedFile, getAttachedFileName, getChildren, getDefaultScale, getDefaultStartTime, getDefaultStopTime, getDefaultUpdateInterval, getInitialState, getProperty, getScale, getStartTime, getState, getStopTime, getTimelineTime, getTrack, getUpdateInterval, getVirtualTime, hasAttachedFile, hasChildren, hasState, isActive, isAttachedFileRelative, isEventTime, isInput, isScalable, isSettable, load, nextEventTime, save, scan, setActive, setAttachedFileName, setData, setName, setScalable, setStartStopTimes, setStartTime, setState, setStopTime, setTrack, setUpdateInterval
 
Methods inherited from class artisynth.core.modelbase.ModelAgentBase
finalize, getModel, initialize, setModel, setModelFromComponent, write
 
Methods inherited from class artisynth.core.modelbase.ModelComponentBase
checkFlag, checkName, checkNameUniqueness, clearFlag, connectToHierarchy, copy, createTempFlag, disconnectFromHierarchy, getGrandParent, getHardReferences, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getSoftReferences, isFixed, isMarked, isSelected, isWritable, makeValidName, makeValidName, notifyParentOfChange, postscan, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, setFixed, setFlag, setMarked, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setSelected, updateReferences
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface artisynth.core.modelbase.ModelComponent
connectToHierarchy, disconnectFromHierarchy, getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, isFixed, isMarked, isSelected, notifyParentOfChange, postscan, setFixed, setMarked, setNumber, setParent, setSelected, updateReferences
 
Methods inherited from interface maspack.util.Scannable
isWritable
 

Field Detail

myProps

public static PropertyList myProps
Constructor Detail

NumericProbeBase

public NumericProbeBase()
Method Detail

getAllPropertyInfo

public PropertyList getAllPropertyInfo()
Description copied from interface: HasProperties
Returns a list giving static information about all properties exported by this object.

Specified by:
getAllPropertyInfo in interface HasProperties
Overrides:
getAllPropertyInfo in class Probe
Returns:
static information for all exported properties

getValues

public double[][] getValues()
Returns the values of this probe as a two dimensional array of doubles. This facilitates reading the values into a matlab array. The array is arranged so that each knot point corresponds to a row, the first column gives the time values, and the remaining columns give the knot point values.

Returns:
Values of this numeric probe

setValues

public void setValues(double[][] vals)
Sets the values of this numeric probe from a two dimensional array of doubles. This facilitates settings the values from a matlab array. The arrangement of the array is described in getValues().

Parameters:
vals - Values used to set this numeric probe

apply

public abstract void apply(double t)
Description copied from class: Probe
Called when the probe is being applied to a model

Specified by:
apply in class Probe

getDisplay

public javax.swing.JPanel getDisplay(int w,
                                     int h,
                                     boolean isLargeDisplay)
Specified by:
getDisplay in interface Displayable

removeDisplay

public boolean removeDisplay(javax.swing.JPanel display)
Specified by:
removeDisplay in interface Displayable

getVsize

public int getVsize()

createNumericList

public void createNumericList(int vsize)

updateDisplays

public void updateDisplays()
Specified by:
updateDisplays in interface Displayable

setSmallDisplayVisible

public void setSmallDisplayVisible(boolean visible)

isSmallDisplayVisible

public boolean isSmallDisplayVisible()

updateDisplays

public void updateDisplays(NumericProbePanel notToUpdate)

updateDisplaysForPropertyChanges

public void updateDisplaysForPropertyChanges()
Update displays if associated properties (like interpolation) have changed.


updateDisplaysWithoutAutoRanging

public void updateDisplaysWithoutAutoRanging()
Update displays with auto-ranging suppressed. This is for situations where data is changed in the display itself (knot points being dragged) and auto-ranging would cause problems with the usre interaction.


setInterpolation

public void setInterpolation(Interpolation method)
Sets the interpolation method for this numeric input probe.

Parameters:
method - interpolation method.

getInterpolation

public Interpolation getInterpolation()
Returns the interpolation method for this numeric input probe.

Returns:
interpolation method
See Also:
setInterpolation(maspack.interpolation.Interpolation)

setInterpolationOrder

public void setInterpolationOrder(Interpolation.Order order)
Sets the interpolation order for this numeric probe.

Parameters:
order - new interpolation order

getInterpolationOrder

public Interpolation.Order getInterpolationOrder()
Returns the interpolation order for this numeric probe.

Returns:
interpolation order

setFormat

public void setFormat(java.lang.String fmtStr)

getFormat

public java.lang.String getFormat()

isCloneable

public boolean isCloneable()
Overrides:
isCloneable in class Probe

getDefaultDisplayMax

public double getDefaultDisplayMax()

getDefaultDisplayMin

public double getDefaultDisplayMin()

setDefaultDisplayRange

public void setDefaultDisplayRange(double min,
                                   double max)

setDefaultDisplayRange

public void setDefaultDisplayRange(double[] minmax)

increaseDisplayRanges

public void increaseDisplayRanges()
Increase the display range of each numeric probe panel.


decreaseDisplayRanges

public void decreaseDisplayRanges()
Decrease the display range of each numeric probe panel.


applyDefaultDisplayRanges

public void applyDefaultDisplayRanges()

getDefaultDisplayRange

public double[] getDefaultDisplayRange()

getMinMaxValues

public double[] getMinMaxValues()

isEmpty

public boolean isEmpty()

getRange

public double[] getRange()

setRangeHints

public void setRangeHints(double[] ranges)
Description copied from interface: Displayable
Sets the range hints associated with this displayable object. This is optional information which specifies minimum and maximum values in both the horizontal and vertical directions.

Specified by:
setRangeHints in interface Displayable
Parameters:
ranges - range hints. The first and second elements are the minimum and maximum horizontal values, and the third and fourth elements are the minimun and maximum vertical values.
See Also:
Displayable.getRangeHints(double[])

getRangeHints

public void getRangeHints(double[] ranges)
Description copied from interface: Displayable
Gets the range hints associated with this displayable object. Ranges hints that are unused should be given values of 0.

Specified by:
getRangeHints in interface Displayable
Parameters:
ranges - range hints. The first and second elements are the minimum and maximum horizontal values, and the third and fourth elements are the minimun and maximum vertical values.
See Also:
Displayable.setRangeHints(double[])

scaleNumericList

public void scaleNumericList(double scale)
Scales the values of a numberic probe. Method added by Chad. author: Chad Scales the values of a numberic probe.

Parameters:
scale - the parameter by which to scale the values.

setScale

public void setScale(double s)
Overrides:
setScale in class Probe

getNumericList

public NumericList getNumericList()

getVariables

public java.util.LinkedHashMap<java.lang.String,NumericProbeVariable> getVariables()

getDrivers

public NumericProbeDriver[] getDrivers()

getAttachedProperties

public Property[] getAttachedProperties()

isValidVariableName

public static boolean isValidVariableName(java.lang.String name)

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Overrides:
clone in class ModelComponentBase
Throws:
java.lang.CloneNotSupportedException

isPrintable

public boolean isPrintable()
Overrides:
isPrintable in class Probe

getData

public VectorNd getData(double sec)

print

public void print(double sec)
Overrides:
print in class Probe

setLegendLabels

public void setLegendLabels(java.util.ArrayList<java.lang.String> labels)

getPlotTraceInfo

public PlotTraceInfo getPlotTraceInfo(int idx)

getOrderedTraceIndex

public int getOrderedTraceIndex(int order)

setTraceOrder

public void setTraceOrder(int[] indices)
Sets a new ordering for the plot traces. This is specified by an array giving the indices of the plot traces in the order they should be plotted.


swapPlotTraceOrder

public void swapPlotTraceOrder(PlotTraceInfo pti0,
                               PlotTraceInfo pti1)

resetTraceOrder

public void resetTraceOrder()

setTraceVisible

public void setTraceVisible(int idx,
                            boolean visible)

isTraceVisible

public boolean isTraceVisible(int idx)

setTraceColor

public void setTraceColor(int idx,
                          java.awt.Color color)

getTraceColor

public java.awt.Color getTraceColor(int idx)

resetTraceColors

public void resetTraceColors()

setTraceLabel

public void setTraceLabel(int idx,
                          java.lang.String label)

getTraceLabel

public java.lang.String getTraceLabel(int idx)

getLegend

public LegendDisplay getLegend()

removeLegend

public void removeLegend()

dispose

public void dispose()
Remove resources used by this agent. Should be overridden by sub-classes as necessary.

Specified by:
dispose in interface ModelAgent
Overrides:
dispose in class ModelAgentBase