Package geomss.geom
Class GeomPlaneTrans
- java.lang.Object
-
- geomss.geom.AbstractGeomElement<GeomPlane>
-
- geomss.geom.GeomPlane
-
- geomss.geom.GeomPlaneTrans
-
- All Implemented Interfaces:
GeomElement<GeomPlane>
,GeomTransform<GeomPlane>
,Transformable<GeomPlane>
,java.io.Serializable
,java.lang.Cloneable
,java.lang.Comparable
,javolution.lang.Reusable
,javolution.xml.XMLSerializable
public final class GeomPlaneTrans extends GeomPlane implements GeomTransform<GeomPlane>
AGeomTransform
element that refers to aGeomPlane
object and masquerades as a GeomPlane object itself.Modified by: Joseph A. Huwaldt
- Version:
- September 13, 2016
- Author:
- Joseph A. Huwaldt, Date: June 14, 2009
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class geomss.geom.AbstractGeomElement
RESOURCES
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description GeomPlaneTrans
copy()
Returns a copy of this GeomPlaneTrans instanceallocated
by the calling thread (possibly on the stack).Plane
copyToReal()
Return a copy of the child object transformed by this transformation.boolean
equals(java.lang.Object obj)
Compares this GeomPlaneTrans against the specified object for strict equality (same values and same units).GeomPlane
getChild()
Returns the child object transformed by this transform element.Parameter<javax.measure.quantity.Length>
getConstant()
Return the constant term of the plane equation (e.g.: "D" for a 3D plane:A*x + B*y + C*z = D
).GeomVector<javax.measure.quantity.Dimensionless>
getNormal()
Return the normal vector for the plane.int
getPhyDimension()
Returns the number of physical dimensions of the geometry element.GeomPointTrans
getRefPoint()
Return the reference point for this plane.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 in this element are stated.int
hashCode()
Returns the hash code for this object.Plane
immutable()
Return an immutable version of this plane.static GeomPlaneTrans
newInstance(GeomPlane child, GTransform transform)
static void
recycle(GeomPlaneTrans instance)
Recycles aGeomPlaneTrans
instance immediately (on the stack when executing in aStackContext
).void
setTransform(GTransform transform)
Sets the transformation represented by this transformation element.GeomPlane
to(javax.measure.unit.Unit<javax.measure.quantity.Length> unit)
Returns the equivalent to this element but stated in the specified unit.GeomPlaneTrans
toDimension(int newDim)
Return the equivalent of this plane converted to the specified number of physical dimensions.-
Methods inherited from class geomss.geom.GeomPlane
changeRefPoint, getBoundsMax, getBoundsMin, getClosest, getLimitPoint, getParDimension, getTransformed, intersect, intersect, intersect, isValid, size, toText
-
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, getBoundsMax, getBoundsMin, getID, getLimitPoint, getName, getParDimension, getUserData, isValid, putAllUserData, putUserData, removeChangeListener, removeUserData, setName, size, toText
-
Methods inherited from interface geomss.geom.Transformable
getTransformed
-
-
-
-
Method Detail
-
newInstance
public static GeomPlaneTrans newInstance(GeomPlane child, GTransform transform)
- Parameters:
child
- The plane 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.
- Throws:
DimensionException
- if the input element is not 3D.
-
getTransform
public GTransform getTransform()
Returns the transformation represented by this transformation element.- Specified by:
getTransform
in interfaceGeomTransform<GeomPlane>
- Returns:
- The transformation represented by this transformation 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<GeomPlane>
- Returns:
- The total transformation represented by an entire chain of GeomTransform objects below this one.
-
setTransform
public void setTransform(GTransform transform)
Sets the transformation represented by this transformation element.- Specified by:
setTransform
in interfaceGeomTransform<GeomPlane>
- Parameters:
transform
- The transform to set this transform element to (may not benull
).
-
getChild
public GeomPlane getChild()
Returns the child object transformed by this transform element.- Specified by:
getChild
in interfaceGeomTransform<GeomPlane>
- Returns:
- The child object transformed by this transform element.
-
copyToReal
public Plane copyToReal()
Return a copy of the child object transformed by this transformation.- Specified by:
copyToReal
in interfaceGeomElement<GeomPlane>
- Specified by:
copyToReal
in interfaceGeomTransform<GeomPlane>
- Returns:
- A copy of the child object transformed by this transformation.
-
recycle
public static void recycle(GeomPlaneTrans instance)
Recycles aGeomPlaneTrans
instance immediately (on the stack when executing in aStackContext
).- Parameters:
instance
- The instance to be recycled.
-
getPhyDimension
public int getPhyDimension()
Returns the number of physical dimensions of the geometry element. This implementation always returns 3.- Specified by:
getPhyDimension
in interfaceGeomElement<GeomPlane>
- Returns:
- The number of physical dimensions of this geometry element.
-
getNormal
public GeomVector<javax.measure.quantity.Dimensionless> getNormal()
Return the normal vector for the plane. The normal vector is a unit vector that is perpendicular to the plane.
-
getConstant
public Parameter<javax.measure.quantity.Length> getConstant()
Return the constant term of the plane equation (e.g.: "D" for a 3D plane:A*x + B*y + C*z = D
).- Specified by:
getConstant
in classGeomPlane
- Returns:
- The constant term of the plane equation for this plane.
-
getRefPoint
public GeomPointTrans getRefPoint()
Return the reference point for this plane. The reference point is an arbitrary point that is contained in the plane and is used as a reference when drawing the plane.- Specified by:
getRefPoint
in classGeomPlane
- Returns:
- The reference point for this plane.
-
toDimension
public GeomPlaneTrans toDimension(int newDim)
Return the equivalent of this plane 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 interfaceGeomElement<GeomPlane>
- Specified by:
toDimension
in classGeomPlane
- Parameters:
newDim
- The dimension of the plane to return. MUST equal 3.- Returns:
- The equivalent of this plane converted to the new dimensions.
- Throws:
java.lang.IllegalArgumentException
- if the new dimension is anything other than 3.
-
getUnit
public javax.measure.unit.Unit<javax.measure.quantity.Length> getUnit()
Returns the unit in which the geometry in this element are stated.- Specified by:
getUnit
in interfaceGeomElement<GeomPlane>
- Returns:
- The unit in which the geometry in this element are stated.
-
to
public GeomPlane to(javax.measure.unit.Unit<javax.measure.quantity.Length> unit) throws javax.measure.converter.ConversionException
Returns the equivalent to this element but stated in the specified unit.WARNING: If the unit changes, then the returned transform element DOES NOT refer back to the original plane (the link with the original plane is broken).
- Specified by:
to
in interfaceGeomElement<GeomPlane>
- Parameters:
unit
- the length unit of the element to be returned. May not be null.- Returns:
- an equivalent to this element but stated in the specified unit.
- Throws:
javax.measure.converter.ConversionException
- if the the input unit is not a length unit.
-
equals
public boolean equals(java.lang.Object obj)
Compares this GeomPlaneTrans against the specified object for strict equality (same values and same units).- Overrides:
equals
in classAbstractGeomElement<GeomPlane>
- Parameters:
obj
- the object to compare with.- Returns:
true
if this point is identical to that point;false
otherwise.
-
hashCode
public int hashCode()
Returns the hash code for this object.- Overrides:
hashCode
in classAbstractGeomElement<GeomPlane>
- Returns:
- the hash code value.
-
copy
public GeomPlaneTrans copy()
Returns a copy of this GeomPlaneTrans instanceallocated
by the calling thread (possibly on the stack).- Specified by:
copy
in interfaceGeomElement<GeomPlane>
- Specified by:
copy
in classGeomPlane
- Returns:
- an identical and independent copy of this object.
-
-