artisynth.core.probes
Class WayPointProbe

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.OutputProbe
                  extended by artisynth.core.probes.WayPointProbe
All Implemented Interfaces:
HasState, ModelAgent, ModelComponent, java.lang.Cloneable, HasProperties, HierarchyNode, Scannable

public class WayPointProbe
extends OutputProbe


Nested Class Summary
 
Nested classes/interfaces inherited from interface artisynth.core.modelbase.ModelComponent
ModelComponent.NavpanelVisibility
 
Field Summary
 
Fields inherited from class artisynth.core.probes.Probe
myProps, useOldSaveMethod, writeStartStopTimeInSeconds
 
Fields inherited from class artisynth.core.modelbase.ModelComponentBase
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames
 
Constructor Summary
WayPointProbe()
           
WayPointProbe(RootModel model)
           
 
Method Summary
 WayPoint add(WayPoint newWay)
          Adds a WayPoint to this probe, and returns any WayPoint that previously occupied the same time location.
 void apply(double t)
          Called when the probe is being applied to a model
 void clear()
           
 java.util.Iterator<WayPoint> get()
           
 WayPoint get(double time)
           
 WayPoint getAfter(double t)
           
 WayPoint getBreakPointAfter(double time)
           
 boolean getCheckState()
           
 WayPoint getLastValid()
           
 WayPoint getNearestValidBefore(double time)
          Find the nearest valid waypoint to a time t, whose time is less or equal to t.
 java.util.LinkedList<WayPoint> getPoints()
           
 RootModel getRootModel()
           
 WayPoint getValidAfter(double t)
           
 WayPoint getValidBefore(double time)
          Return the valid waypoint immediately before time, or null if there is no such waypoint.
 WayPoint getValidOnOrBefore(double time)
          Return the waypoint immediately on or before time, or null if there is no such waypoint.
 void invalidateAfterTime(double t)
          Invalidates all waypoints after a specified time.
 void invalidateAll()
          Invalidates all waypoints
 boolean isEventTime(double t)
           
 void load()
          Load waypoint state data from the attached file.
 void loadfrom()
           
 void loadfrom(java.lang.String fileName)
           
 double maxEventTime()
           
 double nextEventTime(double t)
           
 int numValid()
           
 void postscan(java.util.Deque<ScanToken> tokens, CompositeComponent ancestor)
          Performs any required post-scanning for this component.
 boolean remove(WayPoint way)
           
 void save()
          Write all waypoint state to the attached file if it exists.
 void saveas()
           
 void saveas(java.lang.String fileName)
           
 void scan(ReaderTokenizer rtok, java.lang.Object ref)
          Scans this element from a ReaderTokenizer.
 boolean scanItem(ReaderTokenizer rtok, java.util.Deque<ScanToken> tokens)
           
 void setCheckState(boolean enable)
           
 int size()
           
 void writeItems(java.io.PrintWriter pw, NumberFormat fmt, CompositeComponent ancestor)
          write components to a file
 
Methods inherited from class artisynth.core.probes.Probe
createState, getAllPropertyInfo, getAttachedFile, getAttachedFileName, getChildren, getDefaultScale, getDefaultStartTime, getDefaultStopTime, getDefaultUpdateInterval, getInitialState, getProperty, getScale, getStartTime, getState, getStopTime, getTimelineTime, getTrack, getUpdateInterval, getVirtualTime, hasAttachedFile, hasChildren, hasState, isActive, isAttachedFileRelative, isCloneable, isInput, isPrintable, isScalable, isSettable, print, setActive, setAttachedFileName, setData, setName, setScalable, setScale, setStartStopTimes, setStartTime, setState, setStopTime, setTrack, setUpdateInterval
 
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, 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, setFixed, setMarked, setNumber, setParent, setSelected, updateReferences
 
Methods inherited from interface maspack.util.Scannable
isWritable
 

Constructor Detail

WayPointProbe

public WayPointProbe()

WayPointProbe

public WayPointProbe(RootModel model)
Method Detail

setCheckState

public void setCheckState(boolean enable)

getCheckState

public boolean getCheckState()

add

public WayPoint add(WayPoint newWay)
Adds a WayPoint to this probe, and returns any WayPoint that previously occupied the same time location.

Parameters:
newWay - new WayPoint to add
Returns:
previous WayPoint with the same time, if any

get

public java.util.Iterator<WayPoint> get()

remove

public boolean remove(WayPoint way)

clear

public void clear()

nextEventTime

public double nextEventTime(double t)
Overrides:
nextEventTime in class Probe

isEventTime

public boolean isEventTime(double t)
Overrides:
isEventTime in class Probe

size

public int size()

numValid

public int numValid()

maxEventTime

public double maxEventTime()

getPoints

public java.util.LinkedList<WayPoint> getPoints()

getAfter

public WayPoint getAfter(double t)

getValidAfter

public WayPoint getValidAfter(double t)

getNearestValidBefore

public WayPoint getNearestValidBefore(double time)
Find the nearest valid waypoint to a time t, whose time is less or equal to t. Return null if there is no such waypoint.


getLastValid

public WayPoint getLastValid()

getBreakPointAfter

public WayPoint getBreakPointAfter(double time)

getValidOnOrBefore

public WayPoint getValidOnOrBefore(double time)
Return the waypoint immediately on or before time, or null if there is no such waypoint.


getValidBefore

public WayPoint getValidBefore(double time)
Return the valid waypoint immediately before time, or null if there is no such waypoint.


get

public WayPoint get(double time)

apply

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

Overrides:
apply in class OutputProbe

invalidateAfterTime

public void invalidateAfterTime(double t)
Invalidates all waypoints after a specified time.

Parameters:
t - invalidate waypoints after this time

invalidateAll

public void invalidateAll()
Invalidates all waypoints


save

public void save()
Write all waypoint state to the attached file if it exists.

Overrides:
save in class Probe

saveas

public void saveas()

saveas

public void saveas(java.lang.String fileName)

load

public void load()
Load waypoint state data from the attached file.

Overrides:
load in class Probe

loadfrom

public void loadfrom(java.lang.String fileName)

loadfrom

public void loadfrom()

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 Probe
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

postscan

public void postscan(java.util.Deque<ScanToken> tokens,
                     CompositeComponent ancestor)
              throws java.io.IOException
Description copied from interface: ModelComponent
Performs any required post-scanning for this component. This involves handling any information whose processing was deferred during the scan() method and stored in the token queue. The most common use of this method is to resolve the paths of component references, which may not have been created at the time of the initial scan() call.

Specified by:
postscan in interface ModelComponent
Overrides:
postscan in class ModelComponentBase
Parameters:
tokens - token information that was stored during scan().
ancestor - ancestor component with respect to which reference component paths are defined.
Throws:
java.io.IOException

scanItem

public boolean scanItem(ReaderTokenizer rtok,
                        java.util.Deque<ScanToken> tokens)
                 throws java.io.IOException
Throws:
java.io.IOException

writeItems

public void writeItems(java.io.PrintWriter pw,
                       NumberFormat fmt,
                       CompositeComponent ancestor)
                throws java.io.IOException
Description copied from class: Probe
write components to a file

Throws:
java.io.IOException

getRootModel

public RootModel getRootModel()