public class MultiPointSpring.WrapSegment extends MultiPointSpring.Segment implements HasNumericState
myPntA, myPntB| Modifier and Type | Method and Description |
|---|---|
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()
Returns
true if this component currently holds 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(java.util.ArrayList<Point3d> pnts)
Initialize the knots in the strand so that they are distributed evenly
along a specified list of points.
|
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 initializing 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, getPntBequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitadvanceState, getAuxVarDerivative, getAuxVarState, numAuxVars, requiresAdvance, setAuxVarStatepublic 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 void initializeStrand(java.util.ArrayList<Point3d> pnts)
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.Segmentpublic MultiPointSpring.SubSegment lastSubSegment()
null.lastSubSegment in class MultiPointSpring.Segmentpublic boolean hasSubSegments()
hasSubSegments in class MultiPointSpring.Segmenttrue if this segment has subsegments.public void getState(DataBuffer data)
getState in interface HasNumericStatedata - buffer for storing the state values.public void setState(DataBuffer data)
setState in interface HasNumericStatedata - buffer containing the state informationpublic boolean hasState()
true if this component currently holds state. This
allows the presence of state to depend on the component's configuration.hasState in interface HasNumericStatetrue if this component holds statepublic int getStateVersion()
getStateVersion in interface HasNumericStatepublic MultiPointSpring.WrapSegment clone()
clone in interface Clonableclone in class MultiPointSpring.Segment