|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectartisynth.core.modelbase.ModelComponentBase
artisynth.core.modelbase.ComponentList<ModelComponent>
artisynth.core.modelbase.ModelBase
public abstract class ModelBase
Base class providing some default implementations of the Model interface.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface artisynth.core.modelbase.ModelComponent |
---|
ModelComponent.NavpanelVisibility |
Nested classes/interfaces inherited from interface artisynth.core.modelbase.CompositeComponent |
---|
CompositeComponent.NavpanelDisplay |
Field Summary | |
---|---|
static PropertyList |
myProps
|
Fields inherited from class artisynth.core.modelbase.ComponentList |
---|
DEFAULT_NAVPANEL_DISPLAY |
Fields inherited from class artisynth.core.modelbase.ModelComponentBase |
---|
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames |
Constructor Summary | |
---|---|
ModelBase()
|
|
ModelBase(java.lang.String name)
|
Method Summary | |
---|---|
abstract StepAdjustment |
advance(double t0,
double t1,
int flags)
Advances this object from time t0 to time t1. |
ModelBase |
copy(java.util.Map<ModelComponent,ModelComponent> copyMap,
int flags)
|
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) . |
void |
dispose()
Called when the model is discarded. |
PropertyList |
getAllPropertyInfo()
Returns a list giving static information about all properties exported by this object. |
void |
getInitialState(ComponentState state)
|
void |
getInitialState(ComponentState newstate,
ComponentState oldstate)
Gets an initial state for this component and returns the value in state . |
double |
getMaxStepSize()
Returns the maximum step size by which this model should be advanced within a simulation loop. |
void |
getState(ComponentState state)
Get the current state of this component. |
boolean |
hierarchyContainsReferences()
Returns true if the component hierarchy formed by this component and its descendents is closed with respect to references. |
void |
initialize(double t)
Causes this model to initialize itself at time t. |
StepAdjustment |
preadvance(double t0,
double t1,
int flags)
Prepares this object for advance from time t0 to time t1. |
void |
setInitialState(ComponentState state)
|
void |
setMaxStepSize(double sec)
Sets the maximum step size by which this model should be advanced within a simulation loop. |
void |
setState(ComponentState state)
Set the state of this component. |
Methods inherited from class artisynth.core.modelbase.ComponentList |
---|
add, add, addAll, addComponents, addFixed, addNumbered, clear, clone, componentChanged, contains, contains, containsAll, copy, ensureCapacity, findComponent, get, get, getByNumber, getChildren, getNavpanelDisplay, getNumberLimit, getShortName, getTypeParameter, hasChildren, hasParameterizedType, indexOf, isEmpty, iterator, nextComponentNumber, numComponents, postscan, remove, remove, removeAll, removeAll, removeComponents, retainAll, scan, setNavpanelDisplay, setNumberingStartAtOne, setShortName, size, toArray, toArray, updateNameMap |
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, hasState, isFixed, isMarked, isSelected, notifyParentOfChange, postscan, scan, setFixed, setMarked, setName, setNumber, setParent, setSelected, updateReferences |
Methods inherited from interface maspack.properties.HasProperties |
---|
getProperty |
Methods inherited from interface maspack.properties.HierarchyNode |
---|
getChildren, hasChildren |
Methods inherited from interface maspack.util.Scannable |
---|
isWritable, write |
Methods inherited from interface artisynth.core.modelbase.ComponentListView |
---|
getName |
Methods inherited from interface java.util.Collection |
---|
equals, hashCode |
Field Detail |
---|
public static PropertyList myProps
Constructor Detail |
---|
public ModelBase(java.lang.String name)
public ModelBase()
Method Detail |
---|
public PropertyList getAllPropertyInfo()
HasProperties
getAllPropertyInfo
in interface HasProperties
getAllPropertyInfo
in class ComponentList<ModelComponent>
public void setState(ComponentState state)
setState
in interface HasState
state
- state to be copiedpublic void getState(ComponentState state)
getState
in interface HasState
state
- receives the state informationpublic void setInitialState(ComponentState state)
public void getInitialState(ComponentState state)
public void getInitialState(ComponentState newstate, ComponentState oldstate)
HasState
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.
getInitialState
in interface HasState
newstate
- receives the state informationoldstate
- previous state information; may be null
.public void initialize(double t)
HasState.setState(artisynth.core.modelbase.ComponentState)
, in which case t
may have an arbitrary value.
initialize
in interface Model
t
- initialization time (seconds)public StepAdjustment preadvance(double t0, double t1, int flags)
If the method determines that the step size should be
reduced, it can return a StepAdjustment
object indicating
the recommended reduction. Otherwise, the method may return
null
preadvance
in interface Model
t0
- current time (seconds)t1
- new time to advance to (seconds)flags
- reserved for future use
public abstract StepAdjustment advance(double t0, double t1, int flags)
If the method determines that the step size should be
reduced, it can return a StepAdjustment
object indicating
the recommended reduction. Otherwise, the method may return
null
advance
in interface Model
t0
- current time (seconds)t1
- new time to advance to (seconds)flags
- reserved for future use
public double getMaxStepSize()
getMaxStepSize
in interface Model
public void setMaxStepSize(double sec)
sec
- maximum step size (seconds)public ComponentState createState(ComponentState prevState)
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
.
createState
in interface HasState
prevState
- If non-null, supplies a previous state that
was created by this component and which can be used to provide
pre-sizing hints.
public void dispose()
dispose
in interface Model
dispose
in interface Disposable
public boolean hierarchyContainsReferences()
In particular, this means that one does not need to search outside the hierarchy when looking for dependencies.
hierarchyContainsReferences
in interface CompositeComponent
hierarchyContainsReferences
in class ComponentList<ModelComponent>
public ModelBase copy(java.util.Map<ModelComponent,ModelComponent> copyMap, int flags)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |