Package geomss.geom
Class GeomPlane
- java.lang.Object
-
- geomss.geom.AbstractGeomElement<GeomPlane>
-
- geomss.geom.GeomPlane
-
- All Implemented Interfaces:
GeomElement<GeomPlane>,Transformable<GeomPlane>,java.io.Serializable,java.lang.Cloneable,java.lang.Comparable,javolution.lang.Reusable,javolution.xml.XMLSerializable
- Direct Known Subclasses:
GeomPlaneTrans,Plane
public abstract class GeomPlane extends AbstractGeomElement<GeomPlane> implements Transformable<GeomPlane>
The interface and implementation in common to all 2D planes in n-dimensional space.Modified by: Joseph A. Huwaldt
- Version:
- November 25, 2015
- Author:
- Joseph A. Huwaldt, Date: June 14, 2009
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class geomss.geom.AbstractGeomElement
RESOURCES
-
-
Constructor Summary
Constructors Constructor Description GeomPlane()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description PlanechangeRefPoint(GeomPoint p)Return a new Plane that is identical to this plane, but with a different reference point (the plane is shifted to pass through the specified point).abstract GeomPlanecopy()Returns a copy of this GeomPlane instanceallocatedby the calling thread (possibly on the stack).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 (e.g.: min X, min Y, min Z).PointgetClosest(GeomPoint p)Return the closest point on this plane to the input point.abstract 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).GeomPointgetLimitPoint(int dim, boolean max, double tol)Returns the most extreme point, either minimum or maximum, in the specified coordinate direction on this geometry element.abstract GeomVector<javax.measure.quantity.Dimensionless>getNormal()Return the normal vector for the plane.intgetParDimension()Returns the number of parametric dimensions of the geometry element.abstract GeomPointgetRefPoint()Return the reference point for this plane.GeomPlaneTransgetTransformed(GTransform transform)Returns transformed version of this element.abstract Planeimmutable()Return an immutable version of this plane.PointStringintersect(Curve curve, double tol)Return the intersection between a curve and this plane.IntersectTypeintersect(GeomPoint L0, GeomVector Lu, MutablePoint out)Return the intersection between an infinite line/ray and this plane.PointString<SubrangePoint>intersect(LineSegment line)Return the intersection between a line segment and this plane.booleanisValid()Returntrueif this GeomPlane contains valid and finite numerical components.intsize()Returns the number of child-elements that make up this geometry element.abstract GeomPlanetoDimension(int newDim)Return a copy of this plane converted to the specified number of physical dimensions.javolution.text.TexttoText()Returns the text representation of this geometry element that consists of the name followed by the equation of a plane.-
Methods inherited from class geomss.geom.AbstractGeomElement
addChangeListener, clone, compareTo, equals, getAllUserData, getID, getName, getUserData, hashCode, putAllUserData, putUserData, removeChangeListener, removeUserData, reset, setName, toString
-
Methods inherited from interface geomss.geom.GeomElement
addChangeListener, copyToReal, getAllUserData, getID, getName, getPhyDimension, getUnit, getUserData, putAllUserData, putUserData, removeChangeListener, removeUserData, setName, to
-
-
-
-
Constructor Detail
-
GeomPlane
public GeomPlane()
-
-
Method Detail
-
immutable
public abstract Plane immutable()
Return an immutable version of this plane.- Returns:
- An immutable version of this plane.
-
size
public int size()
Returns the number of child-elements that make up this geometry element. This implementation always returns 0 as a GeomPlane is not made up of any other elements.- Specified by:
sizein interfaceGeomElement<GeomPlane>- Returns:
- The number of child-elements that make up this geometry element.
-
getParDimension
public int getParDimension()
Returns the number of parametric dimensions of the geometry element. This implementation always returns 0 as a GeomPlane is not parametric.- Specified by:
getParDimensionin interfaceGeomElement<GeomPlane>- Returns:
- The number of parametric dimensions of this geometry element.
-
getNormal
public abstract 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.- Returns:
- The normal vector for the plane.
-
getConstant
public abstract 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).- Returns:
- The constant term of the plane equation for this plane.
-
getRefPoint
public abstract GeomPoint 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.- Returns:
- The reference point for this plane.
-
toDimension
public abstract GeomPlane toDimension(int newDim)
Return a copy of this plane converted to the specified number of physical dimensions. If the number of dimensions is greater than this element, then zeros are added to the additional dimensions. If the number of dimensions is less than this element, then the extra dimensions are simply dropped (truncated). If the new dimensions are the same as the dimension of this element, then this element is simply returned.- Specified by:
toDimensionin interfaceGeomElement<GeomPlane>- Parameters:
newDim- The dimension of the plane to return.- Returns:
- A copy of this plane converted to the new dimensions.
-
changeRefPoint
public Plane changeRefPoint(GeomPoint p)
Return a new Plane that is identical to this plane, but with a different reference point (the plane is shifted to pass through the specified point).- Parameters:
p- The new reference point that the plane should pass through. May not be null.- Returns:
- A new Plane that is identical to this plane, but with a different reference point.
-
getBoundsMin
public Point getBoundsMin()
Return the coordinate point representing the minimum bounding box corner (e.g.: min X, min Y, min Z).- Specified by:
getBoundsMinin interfaceGeomElement<GeomPlane>- Returns:
- The minimum bounding box coordinate for this geometry element.
-
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<GeomPlane>- Returns:
- The maximum bounding box coordinate for this geometry element.
-
getLimitPoint
public GeomPoint getLimitPoint(int dim, boolean max, double tol)
Returns the most extreme point, either minimum or maximum, in the specified coordinate direction on this geometry element. This implementation simply returns this plane's reference point.- Specified by:
getLimitPointin interfaceGeomElement<GeomPlane>- Parameters:
dim- An index indicating the dimension to find the min/max point for (0=X, 1=Y, 2=Z, etc).max- Set totrueto return the maximum value,falseto return the minimum.tol- Fractional tolerance to refine the min/max point position to if necessary.- Returns:
- The point found on this element that is the min or max in the specified coordinate direction.
- See Also:
getBoundsMin(),getBoundsMax()
-
getClosest
public Point getClosest(GeomPoint p)
Return the closest point on this plane to the input point.- Parameters:
p- The point to find the closest point on this plane to. May not be null.- Returns:
- The point on the plane closest to the input point.
-
intersect
public PointString intersect(Curve curve, double tol)
Return the intersection between a curve and this plane.- Parameters:
curve- The curve to intersect with this plane. May not be null.tol- Fractional tolerance (in parameter space) to refine the point positions to.- Returns:
- A PointString containing zero or more subrange points made by the intersection of this plane with the specified curve. If no intersection is found, an empty PointString is returned.
-
intersect
public IntersectType intersect(GeomPoint L0, GeomVector Lu, MutablePoint out) throws DimensionException
Return the intersection between an infinite line/ray and this plane.- Parameters:
L0- A point on the line (origin of the line). May not be null.Lu- The direction vector for the line (does not have to be a unit vector). May not be null.out- The pre-defined output point on the line that will be filled in to represent the intersection of the line and the plane (not modified if there is no intersection). Ifnullis passed, then the point is not calculated, but the return codes of this method are still valid.- Returns:
- DISJOINT if the line and plane are disjoint (parallel), INTERSECT if there is a unique intersection and COINCIDENT if the line is coincident with the plane.
- Throws:
DimensionException
-
intersect
public PointString<SubrangePoint> intersect(LineSegment line) throws DimensionException
Return the intersection between a line segment and this plane.- Parameters:
line- The line segment to intersect with this plane. May not be null.- Returns:
- A PointString containing zero or one subrange points on the line made by the intersection of the line segment with this plane. If no intersection is found, an empty PointString is returned.
- Throws:
DimensionException
-
copy
public abstract GeomPlane copy()
Returns a copy of this GeomPlane instanceallocatedby the calling thread (possibly on the stack).- Specified by:
copyin interfaceGeomElement<GeomPlane>- Returns:
- an identical and independent copy of this point.
-
isValid
public boolean isValid()
Returntrueif this GeomPlane 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<GeomPlane>- Returns:
- true if this geometry element contains valid and finite data.
-
getTransformed
public GeomPlaneTrans getTransformed(GTransform transform)
Returns transformed version of this element. The returned object implementsGeomTransformand contains this element as a child.- Specified by:
getTransformedin interfaceTransformable<GeomPlane>- Parameters:
transform- The transformation to apply to this geometry. May not be null.- Returns:
- A new plane that is identical to this one with the specified transformation applied.
- Throws:
DimensionException- if this plane is not 3D.
-
toText
public javolution.text.Text toText()
Returns the text representation of this geometry element that consists of the name followed by the equation of a plane. For example:{aPlane = {1, 0, 0, 2 ft}}If there is no name, then the output looks like this:{1, 0, 0, 2 ft}- Specified by:
toTextin interfaceGeomElement<GeomPlane>- Overrides:
toTextin classAbstractGeomElement<GeomPlane>- Returns:
- the text representation of this geometry element.
-
-