Class AbstractEmbeddedRegionPlaneSubset
- java.lang.Object
-
- org.apache.commons.geometry.euclidean.threed.AbstractPlaneSubset
-
- org.apache.commons.geometry.euclidean.threed.AbstractEmbeddedRegionPlaneSubset
-
- All Implemented Interfaces:
Embedding<Vector3D,Vector2D>
,HyperplaneSubset<Vector3D>
,Splittable<Vector3D,HyperplaneSubset<Vector3D>>
,RegionEmbedding<Vector3D,Vector2D>
,Sized
,PlaneSubset
,PlaneSubset.Embedded
- Direct Known Subclasses:
EmbeddedAreaPlaneConvexSubset
,EmbeddedTreePlaneSubset
abstract class AbstractEmbeddedRegionPlaneSubset extends AbstractPlaneSubset implements PlaneSubset.Embedded
Base class forPlaneSubset
implementations that use an embedded subspace region to define their plane subsets.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.commons.geometry.euclidean.threed.PlaneSubset
PlaneSubset.Embedded
-
-
Field Summary
Fields Modifier and Type Field Description private EmbeddingPlane
plane
The plane containing the embedded region.
-
Constructor Summary
Constructors Constructor Description AbstractEmbeddedRegionPlaneSubset(EmbeddingPlane plane)
Construct a new instance in the given plane.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RegionLocation
classify(Vector3D pt)
Classify a point with respect to the subset region.Vector3D
closest(Vector3D pt)
Return the closest point to the argument that is contained in the subset (ie, not classified asoutside
), or null if no such point exists.protected Bounds3D
getBoundsFromSubspace(BoundarySource2D src)
Compute 3D bounds from a subspace boundary source.Vector3D
getCentroid()
Get the centroid, or geometric center, of the hyperplane subset or null if no centroid exists or one exists but is not unique.EmbeddingPlane
getHyperplane()
Get the hyperplane containing this instance.EmbeddingPlane
getPlane()
Get the plane embedding the subspace region.double
getSize()
Get the size of the instance.boolean
isEmpty()
Return true if this instance does not contain any points.boolean
isFull()
Return true if this instance contains all points in the hyperplane.Vector3D
toSpace(Vector2D pt)
Transform a subspace point into a space point.java.lang.String
toString()
Vector2D
toSubspace(Vector3D pt)
Transform a space point into a subspace point.-
Methods inherited from class org.apache.commons.geometry.euclidean.threed.AbstractPlaneSubset
intersection, intersection
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.commons.geometry.core.Embedding
toSpace, toSubspace
-
Methods inherited from interface org.apache.commons.geometry.core.partitioning.HyperplaneSubset
contains, transform
-
Methods inherited from interface org.apache.commons.geometry.euclidean.threed.PlaneSubset
getBounds, getEmbedded, toConvex, toTriangles
-
Methods inherited from interface org.apache.commons.geometry.euclidean.threed.PlaneSubset.Embedded
getSubspaceRegion
-
Methods inherited from interface org.apache.commons.geometry.core.Sized
isFinite, isInfinite
-
Methods inherited from interface org.apache.commons.geometry.core.partitioning.Splittable
split
-
-
-
-
Field Detail
-
plane
private final EmbeddingPlane plane
The plane containing the embedded region.
-
-
Constructor Detail
-
AbstractEmbeddedRegionPlaneSubset
AbstractEmbeddedRegionPlaneSubset(EmbeddingPlane plane)
Construct a new instance in the given plane.- Parameters:
plane
- plane containing the subset
-
-
Method Detail
-
getPlane
public EmbeddingPlane getPlane()
Get the plane embedding the subspace region.- Specified by:
getPlane
in interfacePlaneSubset
- Specified by:
getPlane
in interfacePlaneSubset.Embedded
- Returns:
- the plane embedding the subspace region
- See Also:
PlaneSubset.getHyperplane()
-
getHyperplane
public EmbeddingPlane getHyperplane()
Get the hyperplane containing this instance.- Specified by:
getHyperplane
in interfaceHyperplaneSubset<Vector3D>
- Specified by:
getHyperplane
in interfacePlaneSubset
- Overrides:
getHyperplane
in classAbstractPlaneSubset
- Returns:
- the hyperplane containing this instance
-
isFull
public boolean isFull()
Return true if this instance contains all points in the hyperplane.- Specified by:
isFull
in interfaceHyperplaneSubset<Vector3D>
- Returns:
- true if this instance contains all points in the hyperplane
-
isEmpty
public boolean isEmpty()
Return true if this instance does not contain any points.- Specified by:
isEmpty
in interfaceHyperplaneSubset<Vector3D>
- Returns:
- true if this instance does not contain any points
-
getSize
public double getSize()
Get the size of the instance.
-
getCentroid
public Vector3D getCentroid()
Get the centroid, or geometric center, of the hyperplane subset or null if no centroid exists or one exists but is not unique. A centroid will not exist for empty or infinite subsets.The centroid of a geometric object is defined as the mean position of all points in the object, including interior points, vertices, and other points lying on the boundary. If a physical object has a uniform density, then its center of mass is the same as its geometric centroid.
- Specified by:
getCentroid
in interfaceHyperplaneSubset<Vector3D>
- Returns:
- the centroid of the hyperplane subset or null if no unique centroid exists
- See Also:
- Centroid
-
toSpace
public Vector3D toSpace(Vector2D pt)
Transform a subspace point into a space point.- Specified by:
toSpace
in interfaceEmbedding<Vector3D,Vector2D>
- Parameters:
pt
- lower-dimension point of the subspace- Returns:
- n-dimension point of the space corresponding to the specified subspace point
- See Also:
Embedding.toSubspace(Point)
-
toSubspace
public Vector2D toSubspace(Vector3D pt)
Transform a space point into a subspace point.- Specified by:
toSubspace
in interfaceEmbedding<Vector3D,Vector2D>
- Parameters:
pt
- n-dimension point of the space- Returns:
- lower-dimension point of the subspace corresponding to the specified space point
- See Also:
Embedding.toSpace(S)
-
classify
public RegionLocation classify(Vector3D pt)
Classify a point with respect to the subset region. The point is classified as follows:- Specified by:
classify
in interfaceHyperplaneSubset<Vector3D>
- Parameters:
pt
- the point to classify- Returns:
- classification of the point with respect to the hyperplane and subspace region
-
closest
public Vector3D closest(Vector3D pt)
Return the closest point to the argument that is contained in the subset (ie, not classified asoutside
), or null if no such point exists.- Specified by:
closest
in interfaceHyperplaneSubset<Vector3D>
- Parameters:
pt
- the reference point- Returns:
- the closest point to the reference point that is contained in the subset, or null if no such point exists
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getBoundsFromSubspace
protected Bounds3D getBoundsFromSubspace(BoundarySource2D src)
Compute 3D bounds from a subspace boundary source.- Parameters:
src
- subspace boundary source- Returns:
- 3D bounds from the given embedded subspace boundary source or null if no valid bounds could be determined
-
-