public class MultiPointSpring.WrapSegment extends MultiPointSpring.Segment implements HasNumericState
myPntA, myPntB
Modifier and Type | Method and Description |
---|---|
void |
advanceState(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.
|
MultiPointSpring.WrapSegment |
clone()
Creates a clone of this wrappable segment.
|
double |
computeEnergy()
Computes the elastic energy for the strand, given by the tension
between adjacent knots, plus the repulsion forces pushing knots out of
any wrappable which they are penetrating.
|
MultiPointSpring.SubSegment |
firstSubSegment()
If this segment has subsegments, return the first subsegment.
|
Point |
getABPoint(int idx)
Return the A/B in this wrappable segment indexed by
idx ,
(which should be less than the number of A/B points returned
by numABPoints() . |
double |
getForceTol()
Returns the force tolerance for this segment that corresponds to the
current convergence tolerance.
|
MultiPointSpring.WrapKnot |
getKnot(int idx)
Returns the
idx -th knot in this wrappable segment. |
void |
getState(DataBuffer data)
Saves state information for this component by adding data to the
supplied DataBuffer.
|
int |
getStateVersion()
Returns a version number for this component's state.
|
boolean |
hasState()
Specifies whether this component currently hold state.
|
boolean |
hasSubSegments()
Queries whether this segment has subsegments.
|
boolean |
inContact()
Returns true if this wrappable segment is in contact with one or
more wrappables.
|
void |
initializeStrand(Point3d[] initialPnts)
Initialize the knots in the strand so that they are distributed evenly
along the piecewise-linear path specified by the start and end points
and any initialization points that may have been specified.
|
MultiPointSpring.SubSegment |
lastSubSegment()
If this segment has subsegments, return the last subsegment.
|
int |
numABPoints()
Return the number of A/B points currently active in this
wrappable segment.
|
int |
numKnots()
Queries the number of knots in this wrappable segment.
|
void |
setState(DataBuffer data)
Restores the state for this component by reading from the supplied
data buffer, starting at the current buffer offsets.
|
getLength
public Point getABPoint(int idx)
idx
,
(which should be less than the number of A/B points returned
by numABPoints()
.public int numABPoints()
public void initializeStrand(Point3d[] initialPnts)
public double getForceTol()
MultiPointSpring.setConvergenceTol(double)
for
details.public double computeEnergy()
public boolean inContact()
public int numKnots()
public MultiPointSpring.WrapKnot getKnot(int idx)
idx
-th knot in this wrappable segment.idx
- indexed of the desired knotidx
-th knotpublic MultiPointSpring.SubSegment firstSubSegment()
null
.firstSubSegment
in class MultiPointSpring.Segment
public MultiPointSpring.SubSegment lastSubSegment()
null
.lastSubSegment
in class MultiPointSpring.Segment
public boolean hasSubSegments()
hasSubSegments
in class MultiPointSpring.Segment
true
if this segment has subsegments.public void getState(DataBuffer data)
getState
in interface HasNumericState
data
- buffer for storing the state values.public void setState(DataBuffer data)
setState
in interface HasNumericState
data
- buffer containing the state informationpublic void advanceState(double t0, double t1)
advanceState
in interface HasNumericState
t0
- beginning time associated with the time step advancet1
- end time associated with the time step advancepublic boolean hasState()
hasState
in interface HasNumericState
public int getStateVersion()
getStateVersion
in interface HasNumericState
public MultiPointSpring.WrapSegment clone()
clone
in interface Clonable
clone
in class MultiPointSpring.Segment