artisynth.core.probes
Class Probe

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

public abstract class Probe
extends ModelAgentBase


Nested Class Summary
 
Nested classes/interfaces inherited from interface artisynth.core.modelbase.ModelComponent
ModelComponent.NavpanelVisibility
 
Field Summary
static PropertyList myProps
           
static boolean useOldSaveMethod
           
static boolean writeStartStopTimeInSeconds
           
 
Fields inherited from class artisynth.core.modelbase.ModelComponentBase
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames
 
Constructor Summary
Probe()
           
 
Method Summary
abstract  void apply(double t)
          Called when the probe is being applied to a model
 ComponentState createState(ComponentState prevState)
          Factory routine to create a state object for this component, which can then be used as an argument for HasState.setState(artisynth.core.modelbase.ComponentState) and HasState.getState(artisynth.core.modelbase.ComponentState).
 PropertyList getAllPropertyInfo()
          Returns a list giving static information about all properties exported by this object.
 java.io.File getAttachedFile()
           
 java.lang.String getAttachedFileName()
           
 java.util.Iterator<? extends HierarchyNode> getChildren()
          
static double getDefaultScale()
           
static double getDefaultStartTime()
           
static double getDefaultStopTime()
           
static double getDefaultUpdateInterval()
           
 void getInitialState(ComponentState newstate, ComponentState oldstate)
          Gets an initial state for this component and returns the value in state.
 Property getProperty(java.lang.String name)
          Returns a property associated with a specified path name.
 double getScale()
           
 double getStartTime()
           
 void getState(ComponentState state)
          Get the current state of this component.
 double getStopTime()
           
 double getTimelineTime(double t)
           
 java.lang.Integer getTrack()
          Returns the Timeline track number associated with this probe.
 double getUpdateInterval()
           
 double getVirtualTime(double sec)
           
 boolean hasAttachedFile()
           
 boolean hasChildren()
          
 boolean hasState()
          Returns true if this component has state.
 boolean isActive()
           
 boolean isAttachedFileRelative()
           
 boolean isCloneable()
           
 boolean isEventTime(double t)
           
 boolean isInput()
          Returns true if this probe is an input probe, and false otherwise.
 boolean isPrintable()
           
 boolean isScalable()
           
 boolean isSettable()
           
 void load()
           
 double nextEventTime(double t)
           
 void print(double sec)
           
 void save()
           
 void scan(ReaderTokenizer rtok, java.lang.Object ref)
          Scans this element from a ReaderTokenizer.
 void setActive(boolean active)
           
 void setAttachedFileName(java.lang.String fileName)
           
 void setData(double sec)
           
 void setName(java.lang.String name)
          Sets the name of this component.
 void setScalable(boolean enable)
           
 void setScale(double s)
           
 void setStartStopTimes(double startTime, double stopTime)
           
 void setStartTime(double t)
           
 void setState(ComponentState state)
          Set the state of this component.
 void setStopTime(double t)
           
 void setTrack(int num)
          Sets the Timeline track number associated with this probe.
 void setUpdateInterval(double t)
           
 
Methods inherited from class artisynth.core.modelbase.ModelAgentBase
dispose, finalize, getModel, initialize, setModel, setModelFromComponent, write
 
Methods inherited from class artisynth.core.modelbase.ModelComponentBase
checkFlag, checkName, checkNameUniqueness, clearFlag, clone, 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

useOldSaveMethod

public static boolean useOldSaveMethod

writeStartStopTimeInSeconds

public static boolean writeStartStopTimeInSeconds

myProps

public static PropertyList myProps
Constructor Detail

Probe

public Probe()
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 ModelComponentBase
Returns:
static information for all exported properties

getDefaultStartTime

public static double getDefaultStartTime()

getDefaultStopTime

public static double getDefaultStopTime()

getDefaultScale

public static double getDefaultScale()

getDefaultUpdateInterval

public static double getDefaultUpdateInterval()

getProperty

public Property getProperty(java.lang.String name)
Description copied from class: ModelComponentBase
Returns a property associated with a specified path name. All properties exported by this object must have a name which is a valid Java identifier. Specifying one of these names causes the corresponding Property to be returned. Handles to sub-properties can also be obtained by delimiting the sub-property name(s) by '.' characters. A sub-property exists if the value of a property is itself an object which exports properties. It is only possible to obtain a sub-property handle if each of its ancestor properties exports their values by reference.

Specified by:
getProperty in interface HasProperties
Overrides:
getProperty in class ModelComponentBase
Parameters:
name - name of the desired property or sub-property
Returns:
handle to the property

getStartTime

public double getStartTime()

setStartTime

public void setStartTime(double t)

getStopTime

public double getStopTime()

setStopTime

public void setStopTime(double t)

setStartStopTimes

public void setStartStopTimes(double startTime,
                              double stopTime)

getScale

public double getScale()

setScale

public void setScale(double s)

setScalable

public void setScalable(boolean enable)

isScalable

public boolean isScalable()

getUpdateInterval

public double getUpdateInterval()

setUpdateInterval

public void setUpdateInterval(double t)

setName

public void setName(java.lang.String name)
Sets the name of this component. When the name is set, this method should call notifyParentOfChange with a NameChangeEvent so that it's parent can update the name map entry and other ancestors can adjust for the new name.

Component names can be specified as null. However, if not null, they should have non-zero length and should not begin with a digit or contain the characters '.' or '/'. Implementations can use ModelComponentBase.checkName() to determine if a proposed name is valid.

Specified by:
setName in interface ModelComponent
Overrides:
setName in class ModelComponentBase
Parameters:
name - new component name

hasChildren

public boolean hasChildren()

Specified by:
hasChildren in interface HierarchyNode
Overrides:
hasChildren in class ModelComponentBase

getChildren

public java.util.Iterator<? extends HierarchyNode> getChildren()

Specified by:
getChildren in interface HierarchyNode
Overrides:
getChildren in class ModelComponentBase

isEventTime

public boolean isEventTime(double t)

nextEventTime

public double nextEventTime(double t)

isActive

public boolean isActive()

setActive

public void setActive(boolean active)

apply

public abstract void apply(double t)
Called when the probe is being applied to a model


isCloneable

public boolean isCloneable()

save

public void save()
          throws java.io.IOException
Throws:
java.io.IOException

load

public void load()
          throws java.io.IOException
Throws:
java.io.IOException

getVirtualTime

public double getVirtualTime(double sec)

getTimelineTime

public double getTimelineTime(double t)

scan

public void scan(ReaderTokenizer rtok,
                 java.lang.Object ref)
          throws java.io.IOException
Description copied from class: ModelComponentBase
Scans this element from a ReaderTokenizer. The expected text format is assumed to be compatible with that produced by write.

Specified by:
scan in interface ModelComponent
Specified by:
scan in interface Scannable
Overrides:
scan in class ModelComponentBase
Parameters:
rtok - Tokenizer from which to scan the element
ref - optional reference object which can be used for resolving references to other objects
Throws:
java.io.IOException - if an I/O or formatting error occured

isAttachedFileRelative

public boolean isAttachedFileRelative()

getAttachedFile

public java.io.File getAttachedFile()

setAttachedFileName

public void setAttachedFileName(java.lang.String fileName)

getAttachedFileName

public java.lang.String getAttachedFileName()

hasAttachedFile

public boolean hasAttachedFile()

setTrack

public void setTrack(int num)
Sets the Timeline track number associated with this probe. The Timeline should use this method to keep the track information current.

Parameters:
num - new track< number

getTrack

public java.lang.Integer getTrack()
Returns the Timeline track number associated with this probe.

Returns:
timeline track number

isInput

public boolean isInput()
Returns true if this probe is an input probe, and false otherwise.

Returns:
true if this is an input probe

isSettable

public boolean isSettable()

setData

public void setData(double sec)

isPrintable

public boolean isPrintable()

print

public void print(double sec)

hasState

public boolean hasState()
Description copied from interface: ModelComponent
Returns true if this component has state. Structure change events involving components that have state will cause the current state history of of the system to be cleared.

Specified by:
hasState in interface ModelComponent
Overrides:
hasState in class ModelComponentBase

createState

public ComponentState createState(ComponentState prevState)
Description copied from interface: HasState
Factory routine to create a state object for this component, which can then be used as an argument for HasState.setState(artisynth.core.modelbase.ComponentState) and HasState.getState(artisynth.core.modelbase.ComponentState). The state object does not have to be set to the component's current state. If the component does not have any state information, this method should return an instance of EmptyState.

Parameters:
prevState - If non-null, supplies a previous state that was created by this component and which can be used to provide pre-sizing hints.
Returns:
new object for storing this component's state

getState

public void getState(ComponentState state)
Description copied from interface: HasState
Get the current state of this component.

Parameters:
state - receives the state information

setState

public void setState(ComponentState state)
Description copied from interface: HasState
Set the state of this component.

Parameters:
state - state to be copied

getInitialState

public void getInitialState(ComponentState newstate,
                            ComponentState oldstate)
Description copied from interface: HasState
Gets an initial state for this component and returns the value in state. If prevstate is non-null, then it is assumed to contain a previous initial state value returned by this method, and state should be set to be as consistent with this previous state as possible. For example, suppose that this component currently contains subcomponents A, B, and C, while the prevstate contains the state from a previous time when it had components B, C, and D. Then state should contain substate values for B and C that are taken from prevstate. To facilitate this, the information returned in state should contain additional information such as the identities of all the (current) sub-components.

Parameters:
newstate - receives the state information
oldstate - previous state information; may be null.