artisynth.core.mechmodels
Interface HasAuxState

All Known Subinterfaces:
RigidBodyConstrainer
All Known Implementing Classes:
CollisionHandler, CollisionHandlerGeneric, CollisionHandlerOld, ConstrainerBase, FemModel3d, FemMuscleModel, FullPlanarJoint, HydrostatModel, JointBase, MarkerPlanarConnector, ParticleMeshConstraint, ParticlePlaneConstraint, PlanarConnector, PointToPointMuscle, RevoluteJoint, RigidBodyConnector, RigidBodyContact, RollPitchJoint, SegmentedPlanarConnector, SolidJoint, SphericalJoint, SphericalJointBase, SphericalRpyJoint, SpongeModel

public interface HasAuxState

Indicates a model component that has auxiliary state information that can be stored as a sequence of double and integer values.


Nested Class Summary
static class HasAuxState.StateContext
           
 
Method Summary
 void advanceAuxState(double t0, double t1)
          Called at the very beginning of the time step (in the system's preadvance() method) to perform any required updating of the component's state before the application in input probes or controllers.
 void getAuxState(DataBuffer data)
          Saves state information for this component by adding data to the supplied DataBuffer.
 void getInitialAuxState(DataBuffer newData, DataBuffer oldData)
          Saves initial state information data for this component by adding data to the supplied data buffer.
 void setAuxState(DataBuffer data)
          Restores the state for this component by reading from the supplied data buffer, starting at the current buffer offsets.
 void skipAuxState(DataBuffer data)
          Skips over the state information for this component contained in the supplied data buffer, starting at the current buffer offsets.
 

Method Detail

advanceAuxState

void advanceAuxState(double t0,
                     double t1)
Called at the very beginning of the time step (in the system's preadvance() method) to perform any required updating of the component's state before the application in input probes or controllers. If no such updating is required, this method may do nothing.

Parameters:
t0 - beginning time associated with the time step advance
t1 - end time associated with the time step advance

skipAuxState

void skipAuxState(DataBuffer data)
Skips over the state information for this component contained in the supplied data buffer, starting at the current buffer offsets. Essentially this a dummy read; the buffer offsets should be advanced over the state information, but that information should not actually be stored in the component.

Parameters:
data - buffer containing the state information

getAuxState

void getAuxState(DataBuffer data)
Saves state information for this component by adding data to the supplied DataBuffer. Existing data in the buffer should not be disturbed.

Parameters:
data - buffer for storing the state values.

getInitialAuxState

void getInitialAuxState(DataBuffer newData,
                        DataBuffer oldData)
Saves initial state information data for this component by adding data to the supplied data buffer. Existing data in the buffer should not be disturbed.

If oldData is non-null, then this contains previously stored initial state information (starting at its current buffer offsets), which should be stored into newData in place of the current component state data. This may only be partially possible if the component's state structure has changed since oldData was written.

Parameters:
newData - buffer for storing the state values.
oldData - if non-null, contains old state information that should be written into newData in place of the current state information.

setAuxState

void setAuxState(DataBuffer data)
Restores the state for this component by reading from the supplied data buffer, starting at the current buffer offsets.

Parameters:
data - buffer containing the state information