Package geomss.geom
Class SubrangeCurve
- java.lang.Object
-
- geomss.geom.AbstractGeomElement<T>
-
- geomss.geom.AbstractCurve<SubrangeCurve>
-
- geomss.geom.SubrangeCurve
-
- All Implemented Interfaces:
Curve<SubrangeCurve>,GeomElement<SubrangeCurve>,ParametricGeometry<SubrangeCurve>,Subrange<Curve>,Transformable<SubrangeCurve>,java.io.Serializable,java.lang.Cloneable,java.lang.Comparable,javolution.lang.Reusable,javolution.xml.XMLSerializable
public final class SubrangeCurve extends AbstractCurve<SubrangeCurve> implements Subrange<Curve>
ACurveelement that refers to aParametricGeometryobject such as aCurveorSurfaceand a parametric curve on that parametric object.Modified by: Joseph A. Huwaldt
- Version:
- November 27, 2015
- Author:
- Joseph A. Huwaldt, Date: May 28, 2009
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class geomss.geom.AbstractCurve
GTOL
-
Fields inherited from class geomss.geom.AbstractGeomElement
RESOURCES
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SubrangeCurvecopy()Returns a copy of thisSubrangeCurveinstanceallocatedby the calling thread (possibly on the stack).SubrangeCurvecopyToReal()Return a copy of this object with any transformations or subranges removed (applied).booleanequals(java.lang.Object obj)Compares this SubrangeCurve against the specified object for strict equality (same values and same units).PointgetBoundsMax()Return the coordinate point representing the maximum bounding box corner (e.g.: max X, max Y, max Z).PointgetBoundsMin()Return the coordinate point representing the minimum bounding box corner of this geometry element (e.g.: min X, min Y, min Z).ParametricGeometrygetChild()Returns the child object this point is subranged onto.CurvegetParPosition()Returns the parametric position on the child object that this curve refers to.intgetPhyDimension()Returns the number of physical dimensions of the geometry element.PointgetRealPoint(double s)Calculate a point on the curve for the given parametric distance along the curve,p(s).java.util.List<Vector<javax.measure.quantity.Length>>getSDerivatives(double s, int grade)Calculate all the derivatives from0togradewith respect to parametric distance on the curve for the given parametric distance along the curve,d^{grade}p(s)/d^{grade}s.SubrangeCurvegetTransformed(GTransform transform)Returns transformed version of this element.javax.measure.unit.Unit<javax.measure.quantity.Length>getUnit()Returns the unit in which this curves values are stated.inthashCode()Returns the hash code for this parameter.booleanisDegenerate(Parameter<javax.measure.quantity.Length> tol)Returntrueif this curve is degenerate (i.e.: has length less than the specified tolerance).booleanisValid()Returntrueif this SubrangeCurve contains valid and finite numerical components.static SubrangeCurvenewInstance(ParametricGeometry child, Curve par)Returns aSubrangeCurveinstance referring to the specifiedParametricGeometryand parametric location.static voidrecycle(SubrangeCurve instance)Recycles aSubrangeCurveinstance immediately (on the stack when executing in aStackContext).SubrangeCurvereverse()Return a new curve that is identical to this one, but with the parameterization reversed.voidsetParPosition(Curve par)Sets the parametric position on the child object that this curve refers to.intsize()Returns the number of child-elements that make up this geometry element.GeomList<SubrangeCurve>splitAt(double s)Split thisSubrangeCurveat 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).SubrangeCurveto(javax.measure.unit.Unit<javax.measure.quantity.Length> unit)Returns the equivalent to this curve but stated in the specified unit.SubrangeCurvetoDimension(int newDim)Return the equivalent of this curve converted to the specified number of physical dimensions.NurbsCurvetoNurbs(Parameter<javax.measure.quantity.Length> tol)Return a NURBS curve representation of this curve to within the specified tolerance.javolution.text.TexttoText()Returns the text representation of this geometry element.-
Methods inherited from class geomss.geom.AbstractCurve
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
-
Methods inherited from class geomss.geom.AbstractGeomElement
addChangeListener, clone, compareTo, getAllUserData, getID, getName, getUserData, putAllUserData, putUserData, removeChangeListener, removeUserData, reset, setName, toString
-
Methods inherited from interface geomss.geom.GeomElement
addChangeListener, getAllUserData, getID, getName, getUserData, putAllUserData, putUserData, removeChangeListener, removeUserData, setName
-
-
-
-
Method Detail
-
newInstance
public static SubrangeCurve newInstance(ParametricGeometry child, Curve par)
Returns aSubrangeCurveinstance referring to the specifiedParametricGeometryand parametric location.- Parameters:
child- TheParametricGeometryobject that this curve is subranged onto (may not benull).par- A curve of the parametric position (between 0 and 1) along each parametric dimension where the curve is located (may not benull).- Returns:
- the subrange curve having the specified values.
- Throws:
DimensionException- if the input child object's parametric dimension is not compatible with the input parametric distance point.
-
getParPosition
public Curve getParPosition()
Returns the parametric position on the child object that this curve refers to.- Specified by:
getParPositionin interfaceSubrange<Curve>- Returns:
- The parametric position on the child object that this curve refers to.
-
setParPosition
public void setParPosition(Curve par)
Sets the parametric position on the child object that this curve refers to.- Specified by:
setParPositionin interfaceSubrange<Curve>- Parameters:
par- The parametric position (between 0 and 1) along each parametric dimension where the curve is located (may not benull).
-
getChild
public ParametricGeometry getChild()
Returns the child object this point is subranged onto.
-
recycle
public static void recycle(SubrangeCurve instance)
Recycles aSubrangeCurveinstance immediately (on the stack when executing in aStackContext).- Parameters:
instance- The instance to be recycled.
-
size
public int size()
Returns the number of child-elements that make up this geometry element. This implementation returns the size of the child object.- Specified by:
sizein interfaceGeomElement<SubrangeCurve>- Returns:
- The number of child-elements that make up this geometry element.
-
getPhyDimension
public int getPhyDimension()
Returns the number of physical dimensions of the geometry element.- Specified by:
getPhyDimensionin interfaceGeomElement<SubrangeCurve>- Returns:
- The number of physical dimensions of this element.
-
getRealPoint
public Point getRealPoint(double s)
Calculate a point on the curve for the given parametric distance along the curve,p(s).- Specified by:
getRealPointin interfaceCurve<SubrangeCurve>- Parameters:
s- parametric distance to calculate a point for (0.0 to 1.0 inclusive).- Returns:
- the calculated point
-
getSDerivatives
public java.util.List<Vector<javax.measure.quantity.Length>> getSDerivatives(double s, int grade)
Calculate all the derivatives from0togradewith 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.- Specified by:
getSDerivativesin interfaceCurve<SubrangeCurve>- Parameters:
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)- Returns:
- A list of derivatives up to the specified grade of the curve at the specified parametric position.
- Throws:
java.lang.IllegalArgumentException- if the grade is < 0.
-
getBoundsMin
public Point getBoundsMin()
Return the coordinate point representing the minimum bounding box corner of this geometry element (e.g.: min X, min Y, min Z).- Specified by:
getBoundsMinin interfaceGeomElement<SubrangeCurve>- Returns:
- The minimum bounding box coordinate for this geometry element.
- Throws:
java.lang.IndexOutOfBoundsException- if this list contains no elements.
-
getBoundsMax
public Point getBoundsMax()
Return the coordinate point representing the maximum bounding box corner (e.g.: max X, max Y, max Z).- Specified by:
getBoundsMaxin interfaceGeomElement<SubrangeCurve>- Returns:
- The maximum bounding box coordinate for this geometry element.
- Throws:
java.lang.IndexOutOfBoundsException- if this list contains no elements.
-
isValid
public boolean isValid()
Returntrueif this SubrangeCurve contains valid and finite numerical components. A value offalsewill be returned if any of the coordinate values are NaN or Inf.- Specified by:
isValidin interfaceGeomElement<SubrangeCurve>- Returns:
- true if this element contains valid and finite numerical values.
-
isDegenerate
public boolean isDegenerate(Parameter<javax.measure.quantity.Length> tol)
Returntrueif this curve is degenerate (i.e.: has length less than the specified tolerance).- Specified by:
isDegeneratein interfaceCurve<SubrangeCurve>- Specified by:
isDegeneratein interfaceParametricGeometry<SubrangeCurve>- Overrides:
isDegeneratein classAbstractCurve<SubrangeCurve>- Parameters:
tol- The tolerance for determining if this curve is degenerate. May not be null.- Returns:
- true if this curve is degenerate.
-
getUnit
public javax.measure.unit.Unit<javax.measure.quantity.Length> getUnit()
Returns the unit in which this curves values are stated.- Specified by:
getUnitin interfaceGeomElement<SubrangeCurve>- Returns:
- The unit that this object is stated in.
-
to
public SubrangeCurve to(javax.measure.unit.Unit<javax.measure.quantity.Length> unit) throws javax.measure.converter.ConversionException
Returns the equivalent to this curve but stated in the specified unit.- Specified by:
toin interfaceCurve<SubrangeCurve>- Specified by:
toin interfaceGeomElement<SubrangeCurve>- Specified by:
toin interfaceParametricGeometry<SubrangeCurve>- Parameters:
unit- the length unit of the curve to be returned. May not be null.- Returns:
- an equivalent to this curve but stated in the specified unit.
- Throws:
javax.measure.converter.ConversionException- if the the input unit is not a length unit.
-
toDimension
public SubrangeCurve toDimension(int newDim)
Return the equivalent of this curve converted to the specified number of physical dimensions. If the number of dimensions is greater than this element, then zeros are added to the additional dimensions. If the number of dimensions is less than this element, then the extra dimensions are simply dropped (truncated). If the new dimensions are the same as the dimension of this element, then this element is simply returned.- Specified by:
toDimensionin interfaceCurve<SubrangeCurve>- Specified by:
toDimensionin interfaceGeomElement<SubrangeCurve>- Specified by:
toDimensionin interfaceParametricGeometry<SubrangeCurve>- Parameters:
newDim- The dimension of the curve to return.- Returns:
- The equivalent of this curve converted to the new dimensions.
-
toNurbs
public NurbsCurve toNurbs(Parameter<javax.measure.quantity.Length> tol)
Return a NURBS curve representation of this curve to within the specified tolerance.- Specified by:
toNurbsin interfaceCurve<SubrangeCurve>- Parameters:
tol- The greatest possible difference between this curve and the NURBS representation returned. May not be null.- Returns:
- A NURBS curve that represents this curve to within the specified tolerance.
-
reverse
public SubrangeCurve reverse()
Return a new curve that is identical to this one, but with the parameterization reversed.- Specified by:
reversein interfaceCurve<SubrangeCurve>- Returns:
- A new curve identical to this one, but with the parameterization reversed.
-
splitAt
public GeomList<SubrangeCurve> splitAt(double s)
Split thisSubrangeCurveat 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).- Specified by:
splitAtin interfaceCurve<SubrangeCurve>- Parameters:
s- The parametric position where this curve should be split (must not be 0 or 1!).- Returns:
- A list containing two curves: 0 == the lower curve, 1 == the upper curve.
-
copy
public SubrangeCurve copy()
Returns a copy of thisSubrangeCurveinstanceallocatedby the calling thread (possibly on the stack).- Specified by:
copyin interfaceCurve<SubrangeCurve>- Specified by:
copyin interfaceGeomElement<SubrangeCurve>- Specified by:
copyin interfaceParametricGeometry<SubrangeCurve>- Returns:
- an identical and independent copy of this curve.
-
copyToReal
public SubrangeCurve copyToReal()
Return a copy of this object with any transformations or subranges removed (applied). This method is not yet implemented and current returns a new SubrangeCurve with the child and subrange curve geometry copied to real.- Specified by:
copyToRealin interfaceCurve<SubrangeCurve>- Specified by:
copyToRealin interfaceGeomElement<SubrangeCurve>- Returns:
- A copy of this object with any transformations or subranges removed (applied).
-
getTransformed
public SubrangeCurve getTransformed(GTransform transform)
Returns transformed version of this element. The returned object implements is a new SubrangeCurve instance with the transformed version of this object's child as it's child.- Specified by:
getTransformedin interfaceTransformable<SubrangeCurve>- Parameters:
transform- The transformation to apply to this geometry. May not be null.- Returns:
- A new triangle that is identical to this one with the specified transformation applied.
- Throws:
DimensionException- if this point is not 3D.
-
equals
public boolean equals(java.lang.Object obj)
Compares this SubrangeCurve against the specified object for strict equality (same values and same units).- Overrides:
equalsin classAbstractGeomElement<SubrangeCurve>- Parameters:
obj- the object to compare with.- Returns:
trueif this point is identical to that point;falseotherwise.
-
hashCode
public int hashCode()
Returns the hash code for this parameter.- Overrides:
hashCodein classAbstractGeomElement<SubrangeCurve>- Returns:
- the hash code value.
-
toText
public javolution.text.Text toText()
Returns the text representation of this geometry element.- Specified by:
toTextin interfaceGeomElement<SubrangeCurve>- Overrides:
toTextin classAbstractGeomElement<SubrangeCurve>- Returns:
- A text representation of this geometry element.
-
-