public final class SubrangeCurve extends AbstractCurve<SubrangeCurve> implements Subrange<Curve>
Curve
element that refers to a ParametricGeometry
object such as a
Curve
or Surface
and a parametric curve on that parametric object.
Modified by: Joseph A. Huwaldt
GTOL
RESOURCES
Modifier and Type | Method and Description |
---|---|
SubrangeCurve |
copy()
Returns a copy of this
SubrangeCurve instance
allocated by the calling thread
(possibly on the stack). |
SubrangeCurve |
copyToReal()
Return a copy of this object with any transformations or subranges removed
(applied).
|
boolean |
equals(java.lang.Object obj)
Compares this SubrangeCurve against the specified object for strict equality (same
values and same units).
|
Point |
getBoundsMax()
Return the coordinate point representing the maximum bounding box corner (e.g.: max
X, max Y, max Z).
|
Point |
getBoundsMin()
Return the coordinate point representing the minimum bounding box corner of this
geometry element (e.g.: min X, min Y, min Z).
|
ParametricGeometry |
getChild()
Returns the child object this point is subranged onto.
|
Curve |
getParPosition()
Returns the parametric position on the child object that this curve refers to.
|
int |
getPhyDimension()
Returns the number of physical dimensions of the geometry element.
|
Point |
getRealPoint(double s)
Calculate a point on the curve for the given parametric distance along the curve,
p(s) . |
java.util.List<Vector<Length>> |
getSDerivatives(double s,
int grade)
Calculate all the derivatives from
0 to grade with
respect to parametric distance on the curve for the given parametric distance along
the curve, d^{grade}p(s)/d^{grade}s . |
SubrangeCurve |
getTransformed(GTransform transform)
Returns transformed version of this element.
|
Unit<Length> |
getUnit()
Returns the unit in which this curves values are stated.
|
int |
hashCode()
Returns the hash code for this parameter.
|
boolean |
isDegenerate(Parameter<Length> tol)
Return
true if this curve is degenerate (i.e.: has length less than
the specified tolerance). |
boolean |
isValid()
Return
true if this SubrangeCurve contains valid and finite numerical
components. |
static SubrangeCurve |
newInstance(ParametricGeometry child,
Curve par)
Returns a
SubrangeCurve instance referring to the specified
ParametricGeometry and parametric location. |
static void |
recycle(SubrangeCurve instance)
Recycles a
SubrangeCurve instance immediately (on the stack when
executing in a StackContext ). |
SubrangeCurve |
reverse()
Return a new curve that is identical to this one, but with the parameterization
reversed.
|
void |
setParPosition(Curve par)
Sets the parametric position on the child object that this curve refers to.
|
int |
size()
Returns the number of child-elements that make up this geometry element.
|
GeomList<SubrangeCurve> |
splitAt(double s)
Split this
SubrangeCurve at the specified parametric position returning a
list containing two curves (a lower curve with smaller parametric positions than
"s" and an upper curve with larger parametric positions). |
SubrangeCurve |
to(Unit<Length> unit)
Returns the equivalent to this curve but stated in the specified unit.
|
SubrangeCurve |
toDimension(int newDim)
Return the equivalent of this curve converted to the specified number of physical
dimensions.
|
NurbsCurve |
toNurbs(Parameter<Length> tol)
Return a NURBS curve representation of this curve to within the specified
tolerance.
|
javolution.text.Text |
toText()
Returns the text representation of this geometry element.
|
extractGrid, getArcLength, getArcLength, getArcLength, getBinormal, getBinormal, getClosest, getClosest, getClosest, getClosest, getClosest, getClosest, getCurvature, getCurvature, getDerivatives, getEnclosedArea, getFarthest, getFarthest, getFarthest, getLimitPoint, getParDimension, getPoint, getPoint, getPointAtArcLength, getPrincipalNormal, getPrincipalNormal, getRealPoint, getSDerivative, getSDerivatives, getTangencyPoint, getTangent, getTangent, getTorsion, getTorsion, getVariationOfCurvature, getVariationOfCurvature, gridToTolerance, intersect, intersect, intersect, intersect, intersect, isCircular, isLine, isPlanar, splitAt
addChangeListener, clone, compareTo, getAllUserData, getID, getName, getUserData, putAllUserData, putUserData, removeChangeListener, removeUserData, reset, setName, toString
addChangeListener, getAllUserData, getID, getName, getUserData, putAllUserData, putUserData, removeChangeListener, removeUserData, setName
public static SubrangeCurve newInstance(ParametricGeometry child, Curve par)
SubrangeCurve
instance referring to the specified
ParametricGeometry
and parametric location.child
- The ParametricGeometry
object that this curve is subranged
onto (may not be null
).par
- A curve of the parametric position (between 0 and 1) along each
parametric dimension where the curve is located (may not be
null
).DimensionException
- if the input child object's parametric dimension is not
compatible with the input parametric distance point.public Curve getParPosition()
getParPosition
in interface Subrange<Curve>
public void setParPosition(Curve par)
setParPosition
in interface Subrange<Curve>
par
- The parametric position (between 0 and 1) along each parametric
dimension where the curve is located (may not be null
).public ParametricGeometry getChild()
public static void recycle(SubrangeCurve instance)
SubrangeCurve
instance immediately (on the stack when
executing in a StackContext
).instance
- The instance to be recycled.public int size()
size
in interface GeomElement<SubrangeCurve>
public int getPhyDimension()
getPhyDimension
in interface GeomElement<SubrangeCurve>
public Point getRealPoint(double s)
p(s)
.getRealPoint
in interface Curve<SubrangeCurve>
s
- parametric distance to calculate a point for (0.0 to 1.0 inclusive).public java.util.List<Vector<Length>> getSDerivatives(double s, int grade)
0
to grade
with
respect to parametric distance on the curve for the given parametric distance along
the curve, d^{grade}p(s)/d^{grade}s
.
Example:
1st derivative (grade = 1), this returns [p(s), dp(s)/ds]
;
2nd derivative (grade = 2), this returns [p(s), dp(s)/ds, d^2p(s)/d^2s]
; etc.
getSDerivatives
in interface Curve<SubrangeCurve>
s
- Parametric distance to calculate derivatives for (0.0 to 1.0
inclusive).grade
- The maximum grade to calculate the derivatives for (1=1st derivative,
2=2nd derivative, etc)java.lang.IllegalArgumentException
- if the grade is < 0.public Point getBoundsMin()
getBoundsMin
in interface GeomElement<SubrangeCurve>
java.lang.IndexOutOfBoundsException
- if this list contains no elements.public Point getBoundsMax()
getBoundsMax
in interface GeomElement<SubrangeCurve>
java.lang.IndexOutOfBoundsException
- if this list contains no elements.public boolean isValid()
true
if this SubrangeCurve contains valid and finite numerical
components. A value of false
will be returned if any of the coordinate
values are NaN or Inf.isValid
in interface GeomElement<SubrangeCurve>
public boolean isDegenerate(Parameter<Length> tol)
true
if this curve is degenerate (i.e.: has length less than
the specified tolerance).isDegenerate
in interface Curve<SubrangeCurve>
isDegenerate
in interface ParametricGeometry<SubrangeCurve>
isDegenerate
in class AbstractCurve<SubrangeCurve>
tol
- The tolerance for determining if this curve is degenerate. May not be
null.public Unit<Length> getUnit()
getUnit
in interface GeomElement<SubrangeCurve>
public SubrangeCurve to(Unit<Length> unit) throws ConversionException
to
in interface Curve<SubrangeCurve>
to
in interface GeomElement<SubrangeCurve>
to
in interface ParametricGeometry<SubrangeCurve>
unit
- the length unit of the curve to be returned. May not be null.ConversionException
- if the the input unit is not a length unit.public SubrangeCurve toDimension(int newDim)
toDimension
in interface Curve<SubrangeCurve>
toDimension
in interface GeomElement<SubrangeCurve>
toDimension
in interface ParametricGeometry<SubrangeCurve>
newDim
- The dimension of the curve to return.public NurbsCurve toNurbs(Parameter<Length> tol)
toNurbs
in interface Curve<SubrangeCurve>
tol
- The greatest possible difference between this curve and the NURBS
representation returned. May not be null.public SubrangeCurve reverse()
reverse
in interface Curve<SubrangeCurve>
public GeomList<SubrangeCurve> splitAt(double s)
SubrangeCurve
at the specified parametric position returning a
list containing two curves (a lower curve with smaller parametric positions than
"s" and an upper curve with larger parametric positions).splitAt
in interface Curve<SubrangeCurve>
s
- The parametric position where this curve should be split (must not be 0 or
1!).public SubrangeCurve copy()
SubrangeCurve
instance
allocated
by the calling thread
(possibly on the stack).copy
in interface Curve<SubrangeCurve>
copy
in interface GeomElement<SubrangeCurve>
copy
in interface ParametricGeometry<SubrangeCurve>
public SubrangeCurve copyToReal()
copyToReal
in interface Curve<SubrangeCurve>
copyToReal
in interface GeomElement<SubrangeCurve>
public SubrangeCurve getTransformed(GTransform transform)
getTransformed
in interface Transformable<SubrangeCurve>
transform
- The transformation to apply to this geometry. May not be null.DimensionException
- if this point is not 3D.public boolean equals(java.lang.Object obj)
equals
in class AbstractGeomElement<SubrangeCurve>
obj
- the object to compare with.true
if this point is identical to that point;
false
otherwise.public int hashCode()
hashCode
in class AbstractGeomElement<SubrangeCurve>
public javolution.text.Text toText()
toText
in interface GeomElement<SubrangeCurve>
toText
in class AbstractGeomElement<SubrangeCurve>