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>
AGeomTransformobject that refers to aCSTCurveobject 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 CSTCurveTranscopy()Returns a copy of this CSTCurveTrans instanceallocatedby the calling thread (possibly on the stack).BasicCSTCurvecopyToReal()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).CSTClassFunctiongetCFunction()Return the class function associated with this CST curve.CSTCurvegetChild()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.PointgetOrigin()Return the origin of the leading edge 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.CSTShapeFunctiongetSFunction()Return the shape function associated with this CST curve.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 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).inthashCode()Returns the hash code for this parameter.BasicCSTCurveimmutable()Return an immutable version of this CST curve.booleanisValid()Returntrueif this curve contains valid and finite numerical components.static CSTCurveTransnewInstance(CSTCurve child, GTransform transform)static voidrecycle(CSTCurveTrans instance)Recycles aCSTCurveTransinstance immediately (on the stack when executing in a StackContext).CSTCurveTransreverse()Return a new curve that is identical to this one, but with the parameterization reversed.voidsetTransform(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).CSTCurveTransto(javax.measure.unit.Unit<javax.measure.quantity.Length> unit)Returns the equivalent to this curve but stated in the specified unit.CSTCurveTranstoDimension(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.-
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:
getTransformin 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:
getTotalTransformin 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:
setTransformin 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:
getChildin 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:
getCFunctionin 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:
getSFunctionin 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:
getOffsetTEin 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:
copyToRealin interfaceCurve<CSTCurve>- Specified by:
copyToRealin interfaceGeomElement<CSTCurve>- Specified by:
copyToRealin 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()
Returntrueif this curve 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<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:
getPhyDimensionin 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:
getRealPointin 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 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<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:
getBoundsMinin 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:
getBoundsMaxin 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:
getUnitin 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:
toin interfaceCurve<CSTCurve>- Specified by:
toin interfaceGeomElement<CSTCurve>- Specified by:
toin 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:
toDimensionin interfaceCurve<CSTCurve>- Specified by:
toDimensionin interfaceGeomElement<CSTCurve>- Specified by:
toDimensionin 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 instanceallocatedby the calling thread (possibly on the stack).- Specified by:
copyin interfaceCurve<CSTCurve>- Specified by:
copyin interfaceGeomElement<CSTCurve>- Specified by:
copyin 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:
equalsin classAbstractGeomElement<CSTCurve>- 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<CSTCurve>- Returns:
- the hash code value.
-
recycle
public static void recycle(CSTCurveTrans instance)
Recycles aCSTCurveTransinstance immediately (on the stack when executing in a StackContext).- Parameters:
instance- The instance to be recycled.
-
-