public final class GeomPointTrans extends GeomPoint implements GeomTransform<GeomPoint>
GeomTransform
element that refers to a GeomPoint
object and
masquerades as a GeomPoint object itself.
Modified by: Joseph A. Huwaldt
RESOURCES
Modifier and Type | Method and Description |
---|---|
GeomPointTrans |
copy()
Returns a copy of this GeomPointTrans instance
allocated by the calling thread
(possibly on the stack). |
Point |
copyToReal()
Return a copy of the child object transformed by this transformation.
|
boolean |
equals(java.lang.Object obj)
Compares this GeomPointTrans against the specified object for strict equality (same
values and same units).
|
GeomPoint |
getChild()
Returns the child object transformed by this transform element.
|
int |
getPhyDimension()
Returns the number of physical dimensions of the geometry element.
|
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.
|
Unit<Length> |
getUnit()
Returns the unit in which the
values in this point are stated in. |
double |
getValue(int i)
Returns the value of the Parameter in this point as a
double , stated
in this point's unit . |
double |
getValue(int i,
Unit<Length> unit)
Returns the value of a coordinate in this point as a
double , stated in
the specified unit. |
int |
hashCode()
Returns the hash code for this parameter.
|
Point |
immutable()
Return an immutable version of this point.
|
boolean |
isValid()
Return
true if this point contains valid and finite numerical
components. |
static void |
main(java.lang.String[] args)
Tests the methods in this class.
|
Point |
minus(GeomPoint that)
Returns the difference between this point and the one specified.
|
Point |
minus(Parameter<Length> that)
Subtracts the specified parameter from each component of this point.
|
static GeomPointTrans |
newInstance(GeomPoint child,
GTransform transform)
|
double |
normSqValue()
Returns the square of the Euclidean norm, magnitude, or length value of the vector
from the origin to this point (the dot product of the origin-to-this-point vector
and itself).
|
Point |
opposite()
Returns the negation of this point (all the values of each dimension negated).
|
Point |
plus(GeomPoint that)
Returns the sum of this point with the one specified.
|
Point |
plus(Parameter<Length> that)
Adds the specified parameter to each component of this point.
|
static void |
recycle(GeomPointTrans instance)
Recycles a
GeomPointTrans instance immediately (on the stack when
executing in a StackContext ). |
void |
setTransform(GTransform transform)
Sets the transformation represented by this transformation element.
|
Point |
times(double k)
Returns the product of this point with the specified coefficient.
|
GeomPointTrans |
to(Unit<Length> unit)
Returns the equivalent of this GeomPointTrans object that has a child point in the
specified units.
|
GeomPointTrans |
toDimension(int newDim)
Return the equivalent of this point converted to the specified number of physical
dimensions.
|
Float64Vector |
toFloat64Vector()
Returns the values stored in this transformed point, stated in this point's
unit , as a Float64Vector. |
Vector3D<Length> |
toVector3D()
Returns a Vector3D representation of this transformed point if possible.
|
distance, distanceSq, distanceSqValue, distanceValue, divide, divide, get, getBoundsMax, getBoundsMin, getLimitPoint, getNumberOfPoints, getParDimension, getTransformed, isApproxEqual, isApproxEqual, max, min, norm, normSq, normValue, size, times, toArray, toArray, toGeomVector, toParameterVector, toText
addChangeListener, clone, compareTo, getAllUserData, getID, getName, getUserData, putAllUserData, putUserData, removeChangeListener, removeUserData, reset, setName, toString
getTransformed
addChangeListener, getAllUserData, getBoundsMax, getBoundsMin, getID, getLimitPoint, getName, getParDimension, getUserData, putAllUserData, putUserData, removeChangeListener, removeUserData, setName, size, toText
public static GeomPointTrans newInstance(GeomPoint child, GTransform transform)
child
- The point that is the child of this transform element (may not be
null
).transform
- The transform held by this transform element (may not be
null
).DimensionException
- if the input element is not 3D.public GTransform getTransform()
getTransform
in interface GeomTransform<GeomPoint>
public GTransform getTotalTransform()
getTotalTransform
in interface GeomTransform<GeomPoint>
public void setTransform(GTransform transform)
setTransform
in interface GeomTransform<GeomPoint>
transform
- The transform to set this transform element to (may not be
null
).public GeomPoint getChild()
getChild
in interface GeomTransform<GeomPoint>
public Point copyToReal()
copyToReal
in interface GeomElement<GeomPoint>
copyToReal
in interface GeomTransform<GeomPoint>
copyToReal
in class GeomPoint
public static void recycle(GeomPointTrans instance)
GeomPointTrans
instance immediately (on the stack when
executing in a StackContext
).instance
- The instance to be recycled.public int getPhyDimension()
getPhyDimension
in interface GeomElement<GeomPoint>
public double getValue(int i)
double
, stated
in this point's unit
.public double getValue(int i, Unit<Length> unit)
double
, stated in
the specified unit.public double normSqValue()
normValue
if the
squared value is all that is needed.normSqValue
in class GeomPoint
this.normSq().getValue()
.GeomPoint.normValue()
public Point plus(GeomPoint that)
plus
in class GeomPoint
that
- the point to be added. May not be null.this + that
.DimensionException
- if point dimensions are different.public Point plus(Parameter<Length> that)
public Point minus(GeomPoint that)
minus
in class GeomPoint
that
- the point to be subtracted from this point. May not be null.this - that
.DimensionException
- if point dimensions are different.public Point minus(Parameter<Length> that)
public Point opposite()
public Point times(double k)
public boolean isValid()
true
if this point contains valid and finite numerical
components. A value of false
will be returned if any of the coordinate
values are NaN or Inf.isValid
in interface GeomElement<GeomPoint>
isValid
in class GeomPoint
public GeomPointTrans copy()
allocated
by the calling thread
(possibly on the stack).copy
in interface GeomElement<GeomPoint>
copy
in class GeomPoint
public Unit<Length> getUnit()
values
in this point are stated in.getUnit
in interface GeomElement<GeomPoint>
public GeomPointTrans to(Unit<Length> unit) throws ConversionException
WARNING: If the unit changes, then the returned transform element DOES NOT refer back to the original point (the link with the original point is broken).
to
in interface GeomElement<GeomPoint>
to
in interface PointGeometry<GeomPoint>
unit
- the length unit of the point to be returned. May not be null.ConversionException
- if the the input unit is not a length unit.public Vector3D<Length> toVector3D()
toVector3D
in class GeomPoint
DimensionException
- if this point has any number of dimensions other than 3.public Float64Vector toFloat64Vector()
unit
, as a Float64Vector.toFloat64Vector
in class GeomPoint
public GeomPointTrans toDimension(int newDim)
toDimension
in interface GeomElement<GeomPoint>
newDim
- The dimension of the point to return. MUST equal 3.java.lang.IllegalArgumentException
- if the new dimension is anything other than 3.public boolean equals(java.lang.Object obj)
equals
in class AbstractGeomElement<GeomPoint>
obj
- the object to compare with.true
if this point is identical to that point;
false
otherwise.public int hashCode()
hashCode
in class AbstractGeomElement<GeomPoint>
public static void main(java.lang.String[] args)
args
- Command-line arguments (not used).