Package geomss.geom.cst
Class CSTCurveTrans
- java.lang.Object
-
- geomss.geom.AbstractGeomElement<T>
-
- geomss.geom.AbstractCurve<CSTCurve>
-
- geomss.geom.cst.CSTCurve
-
- geomss.geom.cst.CSTCurveTrans
-
- All Implemented Interfaces:
Curve<CSTCurve>
,GeomElement<CSTCurve>
,GeomTransform<CSTCurve>
,ParametricGeometry<CSTCurve>
,Transformable<CSTCurve>
,java.io.Serializable
,java.lang.Cloneable
,java.lang.Comparable
,javolution.lang.Reusable
,javolution.xml.XMLSerializable
public final class CSTCurveTrans extends CSTCurve implements GeomTransform<CSTCurve>
AGeomTransform
object that refers to aCSTCurve
object and masquerades as a CSTCurve object itself.Modified by: Joseph A. Huwaldt
- Version:
- November 28, 2015
- Author:
- Joseph A. Huwaldt, Date: October 7, 2015
- 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 CSTCurveTrans
copy()
Returns a copy of this CSTCurveTrans instanceallocated
by the calling thread (possibly on the stack).BasicCSTCurve
copyToReal()
Return a copy of the child object transformed by this transformation.boolean
equals(java.lang.Object obj)
Compares this NurbsCurveTrans against the specified object for strict equality.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).CSTClassFunction
getCFunction()
Return the class function associated with this CST curve.CSTCurve
getChild()
Returns the child object transformed by this transform element.Parameter<javax.measure.quantity.Length>
getChord()
Return the chord length of the curve.Parameter<javax.measure.quantity.Length>
getOffsetTE()
Return the offset of the trailing edge of the curve from the chord line.Point
getOrigin()
Return the origin of the leading edge of this curve.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<javax.measure.quantity.Length>>
getSDerivatives(double s, int grade)
Calculate all the derivatives from0
tograde
with respect to parametric distance on the curve for the given parametric distance along the curve,d^{grade}p(s)/d^{grade}s
.CSTShapeFunction
getSFunction()
Return the shape function associated with this CST curve.GTransform
getTotalTransform()
Returns the total transformation represented by an entire chain of GeomTransform objects below this one.GTransform
getTransform()
Returns the transformation represented by this transformation element.javax.measure.unit.Unit<javax.measure.quantity.Length>
getUnit()
Returns the unit in which the geometry of this curve is stated.Vector<javax.measure.quantity.Dimensionless>
getXhat()
Return the chord-wise direction of this curve (the curve X-direction).Vector<javax.measure.quantity.Dimensionless>
getYhat()
Return the in-plane direction of this curve perpendicular to the chord-wise direction (the curve Y-direction).int
hashCode()
Returns the hash code for this parameter.BasicCSTCurve
immutable()
Return an immutable version of this CST curve.boolean
isValid()
Returntrue
if this curve contains valid and finite numerical components.static CSTCurveTrans
newInstance(CSTCurve child, GTransform transform)
static void
recycle(CSTCurveTrans instance)
Recycles aCSTCurveTrans
instance immediately (on the stack when executing in a StackContext).CSTCurveTrans
reverse()
Return a new curve that is identical to this one, but with the parameterization reversed.void
setTransform(GTransform transform)
Sets the transformation represented by this transformation element.GeomList<CSTCurve>
splitAt(double s)
Split this curve 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).CSTCurveTrans
to(javax.measure.unit.Unit<javax.measure.quantity.Length> unit)
Returns the equivalent to this curve but stated in the specified unit.CSTCurveTrans
toDimension(int newDim)
Return the equivalent of this curve converted to the specified number of physical dimensions.NurbsCurve
toNurbs(Parameter<javax.measure.quantity.Length> tol)
Return a NURBS curve representation of this curve to within the specified tolerance.-
Methods inherited from class geomss.geom.cst.CSTCurve
getTransformed, isDegenerate, isPlanar, size
-
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, splitAt
-
Methods inherited from class geomss.geom.AbstractGeomElement
addChangeListener, clone, compareTo, getAllUserData, getID, getName, getUserData, putAllUserData, putUserData, removeChangeListener, removeUserData, reset, setName, toString, toText
-
Methods inherited from interface geomss.geom.GeomElement
addChangeListener, getAllUserData, getID, getLimitPoint, getName, getParDimension, getUserData, putAllUserData, putUserData, removeChangeListener, removeUserData, setName, size, toText
-
Methods inherited from interface geomss.geom.Transformable
getTransformed
-
-
-
-
Method Detail
-
newInstance
public static CSTCurveTrans newInstance(CSTCurve child, GTransform transform)
- Parameters:
child
- The CSTCurve 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:
getTransform
in interfaceGeomTransform<CSTCurve>
- 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:
getTotalTransform
in interfaceGeomTransform<CSTCurve>
- 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:
setTransform
in interfaceGeomTransform<CSTCurve>
- Parameters:
transform
- The transform to set this transform element to (may not benull
).
-
getChild
public CSTCurve getChild()
Returns the child object transformed by this transform element.- Specified by:
getChild
in interfaceGeomTransform<CSTCurve>
- Returns:
- The child object transformed by this element.
-
getCFunction
public CSTClassFunction getCFunction()
Return the class function associated with this CST curve.- Specified by:
getCFunction
in classCSTCurve
- Returns:
- The class function associated with this CST curve.
-
getSFunction
public CSTShapeFunction getSFunction()
Return the shape function associated with this CST curve.- Specified by:
getSFunction
in classCSTCurve
- Returns:
- The shape function associated with this CST curve.
-
getOffsetTE
public Parameter<javax.measure.quantity.Length> getOffsetTE()
Return the offset of the trailing edge of the curve from the chord line.- Specified by:
getOffsetTE
in classCSTCurve
- Returns:
- The offset of the trailing edge of the curve from the chord line.
-
getChord
public Parameter<javax.measure.quantity.Length> getChord()
Return the chord length of the curve. This defines the scale or size of the curve.
-
getOrigin
public Point getOrigin()
Return the origin of the leading edge of this curve. This defines the s=0 location of the curve in space.
-
getXhat
public Vector<javax.measure.quantity.Dimensionless> getXhat()
Return the chord-wise direction of this curve (the curve X-direction).
-
getYhat
public Vector<javax.measure.quantity.Dimensionless> getYhat()
Return the in-plane direction of this curve perpendicular to the chord-wise direction (the curve Y-direction).
-
copyToReal
public BasicCSTCurve copyToReal()
Return a copy of the child object transformed by this transformation.- Specified by:
copyToReal
in interfaceCurve<CSTCurve>
- Specified by:
copyToReal
in interfaceGeomElement<CSTCurve>
- Specified by:
copyToReal
in interfaceGeomTransform<CSTCurve>
- Returns:
- A copy of this object with any transformations or subranges removed (applied).
-
immutable
public BasicCSTCurve immutable()
Return an immutable version of this CST curve.
-
isValid
public boolean isValid()
Returntrue
if this curve contains valid and finite numerical components. A value offalse
will be returned if any of the coordinate values are NaN or Inf.- Specified by:
isValid
in interfaceGeomElement<CSTCurve>
- Returns:
- true if this element contains valid and finite numerical values.
-
getPhyDimension
public int getPhyDimension()
Returns the number of physical dimensions of the geometry element.- Specified by:
getPhyDimension
in interfaceGeomElement<CSTCurve>
- Returns:
- The number of physical dimensions of this geometry 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:
getRealPoint
in interfaceCurve<CSTCurve>
- 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 from0
tograde
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.- Specified by:
getSDerivatives
in interfaceCurve<CSTCurve>
- 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:
getBoundsMin
in interfaceGeomElement<CSTCurve>
- 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:
getBoundsMax
in interfaceGeomElement<CSTCurve>
- Returns:
- The maximum bounding box coordinate for this geometry element.
- Throws:
java.lang.IndexOutOfBoundsException
- if this list contains no elements.
-
reverse
public CSTCurveTrans reverse()
Return a new curve that is identical to this one, but with the parameterization reversed. This does not change the origin or axis directions, but only the curve parameterization; what was s=0 will become s=1, etc
-
splitAt
public GeomList<CSTCurve> splitAt(double s)
Split this curve 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). The origin, chord length, and trailing edge offset from chord-line will be identical for the the returned segments and this curve. The only change is in the parameterization.
-
getUnit
public javax.measure.unit.Unit<javax.measure.quantity.Length> getUnit()
Returns the unit in which the geometry of this curve is stated.- Specified by:
getUnit
in interfaceGeomElement<CSTCurve>
- Returns:
- The unit in which the geometry in this element are stated.
-
to
public CSTCurveTrans 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:
to
in interfaceCurve<CSTCurve>
- Specified by:
to
in interfaceGeomElement<CSTCurve>
- Specified by:
to
in interfaceParametricGeometry<CSTCurve>
- 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 CSTCurveTrans 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:
toDimension
in interfaceCurve<CSTCurve>
- Specified by:
toDimension
in interfaceGeomElement<CSTCurve>
- Specified by:
toDimension
in interfaceParametricGeometry<CSTCurve>
- 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.
-
toNurbs
public NurbsCurve toNurbs(Parameter<javax.measure.quantity.Length> tol)
Return a NURBS curve representation of this curve to within the specified tolerance.
-
copy
public CSTCurveTrans copy()
Returns a copy of this CSTCurveTrans instanceallocated
by the calling thread (possibly on the stack).- Specified by:
copy
in interfaceCurve<CSTCurve>
- Specified by:
copy
in interfaceGeomElement<CSTCurve>
- Specified by:
copy
in interfaceParametricGeometry<CSTCurve>
- 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:
equals
in classAbstractGeomElement<CSTCurve>
- Parameters:
obj
- the object to compare with.- Returns:
true
if this transform is identical to that transform;false
otherwise.
-
hashCode
public int hashCode()
Returns the hash code for this parameter.- Overrides:
hashCode
in classAbstractGeomElement<CSTCurve>
- Returns:
- the hash code value.
-
recycle
public static void recycle(CSTCurveTrans instance)
Recycles aCSTCurveTrans
instance immediately (on the stack when executing in a StackContext).- Parameters:
instance
- The instance to be recycled.
-
-