Package geomss.geom.nurbs
Class NurbsCurveTrans
- java.lang.Object
-
- geomss.geom.AbstractGeomElement<T>
-
- geomss.geom.AbstractCurve<NurbsCurve>
-
- geomss.geom.nurbs.NurbsCurve
-
- geomss.geom.nurbs.NurbsCurveTrans
-
- All Implemented Interfaces:
Curve<NurbsCurve>,GeomElement<NurbsCurve>,GeomTransform<NurbsCurve>,ParametricGeometry<NurbsCurve>,Transformable<NurbsCurve>,java.io.Serializable,java.lang.Cloneable,java.lang.Comparable,javolution.lang.Reusable,javolution.xml.XMLSerializable
public final class NurbsCurveTrans extends NurbsCurve implements GeomTransform<NurbsCurve>
AGeomTransformobject that refers to aNurbsCurveobject and masquerades as a NurbsCurve object itself.Modified by: Joseph A. Huwaldt
- Version:
- November 28, 2015
- Author:
- Joseph A. Huwaldt, Date: April 30, 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 NurbsCurveTranscopy()Returns a copy of this NurbsCurveTrans instanceallocatedby the calling thread (possibly on the stack).BasicNurbsCurvecopyToReal()Return a copy of the child object transformed by this transformation.booleanequals(java.lang.Object obj)Compares this NurbsCurveTrans against the specified object for strict equality.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).NurbsCurvegetChild()Returns the child object transformed by this transform element.java.util.List<ControlPoint>getControlPoints()Return a list of transformed control points for this curve.intgetDegree()Return the degree of the NURBS curve.KnotVectorgetKnotVector()Return the knot vector of this curve.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.GTransformgetTotalTransform()Returns the total transformation represented by an entire chain of GeomTransform objects below this one.GTransformgetTransform()Returns the transformation represented by this transformation element.javax.measure.unit.Unit<javax.measure.quantity.Length>getUnit()Returns the unit in which the control points in this curve are stated.inthashCode()Returns the hash code for this parameter.BasicNurbsCurveimmutable()Return an immutable version of this NURBS curve.static NurbsCurveTransnewInstance(NurbsCurve child, GTransform transform)static voidrecycle(NurbsCurveTrans instance)Recycles aNurbsCurveTransinstance immediately (on the stack when executing in a StackContext).voidsetTransform(GTransform transform)Sets the transformation represented by this transformation element.intsize()Returns the number of child-elements that make up this geometry element.NurbsCurveTransto(javax.measure.unit.Unit<javax.measure.quantity.Length> unit)Returns the equivalent to this curve but stated in the specified unit.NurbsCurveTranstoDimension(int newDim)Return the equivalent of this curve converted to the specified number of physical dimensions.-
Methods inherited from class geomss.geom.nurbs.NurbsCurve
getArcLength, getArcLength, getTransformed, gridToTolerance, insertKnot, intersect, isDegenerate, isLine, isPlanar, isValid, mergeKnotVector, refineKnotVector, refineKnotVector, removeKnot, reverse, splitAt, toNurbs, toNurbs, toText
-
Methods inherited from class geomss.geom.AbstractCurve
extractGrid, 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, intersect, intersect, intersect, intersect, isCircular, 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, getLimitPoint, getName, getParDimension, getUserData, isValid, putAllUserData, putUserData, removeChangeListener, removeUserData, setName, toText
-
Methods inherited from interface geomss.geom.Transformable
getTransformed
-
-
-
-
Method Detail
-
newInstance
public static NurbsCurveTrans newInstance(NurbsCurve child, GTransform transform)
- Parameters:
child- The NurbsCurve that is the child of this transform element (may not benull).transform- The transform held by this transform element (may not benull).- Returns:
- the transform element having the specified values.
-
getTransform
public GTransform getTransform()
Returns the transformation represented by this transformation element.- Specified by:
getTransformin interfaceGeomTransform<NurbsCurve>- Returns:
- The transformation represented by this element.
-
getTotalTransform
public GTransform getTotalTransform()
Returns the total transformation represented by an entire chain of GeomTransform objects below this one.- Specified by:
getTotalTransformin interfaceGeomTransform<NurbsCurve>- Returns:
- The total transformation represented by the entire chain of transform objects.
-
setTransform
public void setTransform(GTransform transform)
Sets the transformation represented by this transformation element.- Specified by:
setTransformin interfaceGeomTransform<NurbsCurve>- Parameters:
transform- The transform to set this transform element to (may not benull).
-
getChild
public NurbsCurve getChild()
Returns the child object transformed by this transform element.- Specified by:
getChildin interfaceGeomTransform<NurbsCurve>- Returns:
- The child object transformed by this element.
-
copyToReal
public BasicNurbsCurve copyToReal()
Return a copy of the child object transformed by this transformation.- Specified by:
copyToRealin interfaceCurve<NurbsCurve>- Specified by:
copyToRealin interfaceGeomElement<NurbsCurve>- Specified by:
copyToRealin interfaceGeomTransform<NurbsCurve>- Returns:
- A copy of this object with any transformations or subranges removed (applied).
-
immutable
public BasicNurbsCurve immutable()
Return an immutable version of this NURBS curve.- Specified by:
immutablein classNurbsCurve- Returns:
- an immutable version of this curve.
-
size
public int size()
Returns the number of child-elements that make up this geometry element. This implementation returns the number of control points in the child NURBS curve.- Specified by:
sizein interfaceGeomElement<NurbsCurve>- 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<NurbsCurve>- Returns:
- The number of physical dimensions of this geometry element.
-
getControlPoints
public java.util.List<ControlPoint> getControlPoints()
Return a list of transformed control points for this curve.- Specified by:
getControlPointsin classNurbsCurve- Returns:
- the ordered control points
-
getKnotVector
public KnotVector getKnotVector()
Return the knot vector of this curve.- Specified by:
getKnotVectorin classNurbsCurve- Returns:
- The knot vector.
-
getDegree
public int getDegree()
Return the degree of the NURBS curve.- Specified by:
getDegreein classNurbsCurve- Returns:
- degree of curve
-
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<NurbsCurve>- 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<NurbsCurve>- 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<NurbsCurve>- 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<NurbsCurve>- Returns:
- The maximum bounding box coordinate for this geometry element.
- Throws:
java.lang.IndexOutOfBoundsException- if this list contains no elements.
-
getUnit
public javax.measure.unit.Unit<javax.measure.quantity.Length> getUnit()
Returns the unit in which the control points in this curve are stated.- Specified by:
getUnitin interfaceGeomElement<NurbsCurve>- Returns:
- The unit in which the geometry in this element are stated.
-
to
public NurbsCurveTrans 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<NurbsCurve>- Specified by:
toin interfaceGeomElement<NurbsCurve>- Specified by:
toin interfaceParametricGeometry<NurbsCurve>- 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 NurbsCurveTrans toDimension(int newDim)
Return the equivalent of this curve converted to the specified number of physical dimensions. This implementation will throw an exception if the specified dimension is anything other than 3.- Specified by:
toDimensionin interfaceCurve<NurbsCurve>- Specified by:
toDimensionin interfaceGeomElement<NurbsCurve>- Specified by:
toDimensionin interfaceParametricGeometry<NurbsCurve>- Parameters:
newDim- The dimension of the curve to return. MUST equal 3.- Returns:
- The equivalent of this curve converted to the new dimensions.
- Throws:
java.lang.IllegalArgumentException- if the new dimension is anything other than 3.
-
copy
public NurbsCurveTrans copy()
Returns a copy of this NurbsCurveTrans instanceallocatedby the calling thread (possibly on the stack).- Specified by:
copyin interfaceCurve<NurbsCurve>- Specified by:
copyin interfaceGeomElement<NurbsCurve>- Specified by:
copyin interfaceParametricGeometry<NurbsCurve>- Returns:
- an identical and independent copy of this point.
-
equals
public boolean equals(java.lang.Object obj)
Compares this NurbsCurveTrans against the specified object for strict equality.- Overrides:
equalsin classAbstractGeomElement<NurbsCurve>- Parameters:
obj- the object to compare with.- Returns:
trueif this transform is identical to that transform;falseotherwise.
-
hashCode
public int hashCode()
Returns the hash code for this parameter.- Overrides:
hashCodein classAbstractGeomElement<NurbsCurve>- Returns:
- the hash code value.
-
recycle
public static void recycle(NurbsCurveTrans instance)
Recycles aNurbsCurveTransinstance immediately (on the stack when executing in a StackContext).- Parameters:
instance- The instance to be recycled.
-
-