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.AbstractCurveGTOL
 - 
Fields inherited from class geomss.geom.AbstractGeomElementRESOURCES
 
- 
 - 
Method SummaryAll 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.AbstractCurveextractGrid, 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.AbstractGeomElementaddChangeListener, clone, compareTo, getAllUserData, getID, getName, getUserData, putAllUserData, putUserData, removeChangeListener, removeUserData, reset, setName, toString
 - 
Methods inherited from interface geomss.geom.GeomElementaddChangeListener, getAllUserData, getID, getName, getUserData, putAllUserData, putUserData, removeChangeListener, removeUserData, setName
 
- 
 
- 
- 
- 
Method Detail- 
newInstancepublic static SubrangeCurve newInstance(ParametricGeometry child, Curve par) Returns aSubrangeCurveinstance referring to the specifiedParametricGeometryand parametric location.- Parameters:
- child- The- ParametricGeometryobject 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).
- 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.
 
 - 
getParPositionpublic Curve getParPosition() Returns the parametric position on the child object that this curve refers to.- Specified by:
- getParPositionin interface- Subrange<Curve>
- Returns:
- The parametric position on the child object that this curve refers to.
 
 - 
setParPositionpublic void setParPosition(Curve par) Sets the parametric position on the child object that this curve refers to.- Specified by:
- setParPositionin interface- Subrange<Curve>
- Parameters:
- par- The parametric position (between 0 and 1) along each parametric dimension where the curve is located (may not be- null).
 
 - 
getChildpublic ParametricGeometry getChild() Returns the child object this point is subranged onto.
 - 
recyclepublic static void recycle(SubrangeCurve instance) Recycles aSubrangeCurveinstance immediately (on the stack when executing in aStackContext).- Parameters:
- instance- The instance to be recycled.
 
 - 
sizepublic 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 interface- GeomElement<SubrangeCurve>
- Returns:
- The number of child-elements that make up this geometry element.
 
 - 
getPhyDimensionpublic int getPhyDimension() Returns the number of physical dimensions of the geometry element.- Specified by:
- getPhyDimensionin interface- GeomElement<SubrangeCurve>
- Returns:
- The number of physical dimensions of this element.
 
 - 
getRealPointpublic Point getRealPoint(double s) Calculate a point on the curve for the given parametric distance along the curve,p(s).- Specified by:
- getRealPointin interface- Curve<SubrangeCurve>
- Parameters:
- s- parametric distance to calculate a point for (0.0 to 1.0 inclusive).
- Returns:
- the calculated point
 
 - 
getSDerivativespublic 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 interface- Curve<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.
 
 - 
getBoundsMinpublic 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 interface- GeomElement<SubrangeCurve>
- Returns:
- The minimum bounding box coordinate for this geometry element.
- Throws:
- java.lang.IndexOutOfBoundsException- if this list contains no elements.
 
 - 
getBoundsMaxpublic Point getBoundsMax() Return the coordinate point representing the maximum bounding box corner (e.g.: max X, max Y, max Z).- Specified by:
- getBoundsMaxin interface- GeomElement<SubrangeCurve>
- Returns:
- The maximum bounding box coordinate for this geometry element.
- Throws:
- java.lang.IndexOutOfBoundsException- if this list contains no elements.
 
 - 
isValidpublic 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 interface- GeomElement<SubrangeCurve>
- Returns:
- true if this element contains valid and finite numerical values.
 
 - 
isDegeneratepublic 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 interface- Curve<SubrangeCurve>
- Specified by:
- isDegeneratein interface- ParametricGeometry<SubrangeCurve>
- Overrides:
- isDegeneratein class- AbstractCurve<SubrangeCurve>
- Parameters:
- tol- The tolerance for determining if this curve is degenerate. May not be null.
- Returns:
- true if this curve is degenerate.
 
 - 
getUnitpublic javax.measure.unit.Unit<javax.measure.quantity.Length> getUnit() Returns the unit in which this curves values are stated.- Specified by:
- getUnitin interface- GeomElement<SubrangeCurve>
- Returns:
- The unit that this object is stated in.
 
 - 
topublic 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 interface- Curve<SubrangeCurve>
- Specified by:
- toin interface- GeomElement<SubrangeCurve>
- Specified by:
- toin interface- ParametricGeometry<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.
 
 - 
toDimensionpublic 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 interface- Curve<SubrangeCurve>
- Specified by:
- toDimensionin interface- GeomElement<SubrangeCurve>
- Specified by:
- toDimensionin interface- ParametricGeometry<SubrangeCurve>
- Parameters:
- newDim- The dimension of the curve to return.
- Returns:
- The equivalent of this curve converted to the new dimensions.
 
 - 
toNurbspublic NurbsCurve toNurbs(Parameter<javax.measure.quantity.Length> tol) Return a NURBS curve representation of this curve to within the specified tolerance.- Specified by:
- toNurbsin interface- Curve<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.
 
 - 
reversepublic SubrangeCurve reverse() Return a new curve that is identical to this one, but with the parameterization reversed.- Specified by:
- reversein interface- Curve<SubrangeCurve>
- Returns:
- A new curve identical to this one, but with the parameterization reversed.
 
 - 
splitAtpublic 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 interface- Curve<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.
 
 - 
copypublic SubrangeCurve copy() Returns a copy of thisSubrangeCurveinstanceallocatedby the calling thread (possibly on the stack).- Specified by:
- copyin interface- Curve<SubrangeCurve>
- Specified by:
- copyin interface- GeomElement<SubrangeCurve>
- Specified by:
- copyin interface- ParametricGeometry<SubrangeCurve>
- Returns:
- an identical and independent copy of this curve.
 
 - 
copyToRealpublic 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 interface- Curve<SubrangeCurve>
- Specified by:
- copyToRealin interface- GeomElement<SubrangeCurve>
- Returns:
- A copy of this object with any transformations or subranges removed (applied).
 
 - 
getTransformedpublic 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 interface- Transformable<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.
 
 - 
equalspublic boolean equals(java.lang.Object obj) Compares this SubrangeCurve against the specified object for strict equality (same values and same units).- Overrides:
- equalsin class- AbstractGeomElement<SubrangeCurve>
- Parameters:
- obj- the object to compare with.
- Returns:
- trueif this point is identical to that point;- falseotherwise.
 
 - 
hashCodepublic int hashCode() Returns the hash code for this parameter.- Overrides:
- hashCodein class- AbstractGeomElement<SubrangeCurve>
- Returns:
- the hash code value.
 
 - 
toTextpublic javolution.text.Text toText() Returns the text representation of this geometry element.- Specified by:
- toTextin interface- GeomElement<SubrangeCurve>
- Overrides:
- toTextin class- AbstractGeomElement<SubrangeCurve>
- Returns:
- A text representation of this geometry element.
 
 
- 
 
-