Class EmbeddedTreePlaneSubset
java.lang.Object
org.apache.commons.geometry.euclidean.threed.AbstractPlaneSubset
org.apache.commons.geometry.euclidean.threed.AbstractEmbeddedRegionPlaneSubset
org.apache.commons.geometry.euclidean.threed.EmbeddedTreePlaneSubset
- All Implemented Interfaces:
Embedding<Vector3D,Vector2D>, HyperplaneSubset<Vector3D>, Splittable<Vector3D, HyperplaneSubset<Vector3D>>, RegionEmbedding<Vector3D, Vector2D>, Sized, PlaneSubset, PlaneSubset.Embedded
Class representing an arbitrary subset of a plane using a
RegionBSPTree2D.
This class can represent convex, non-convex, finite, infinite, and empty regions.
This class is mutable and not thread safe.
-
Nested Class Summary
Nested classes/interfaces inherited from interface PlaneSubset
PlaneSubset.Embedded -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final RegionBSPTree2DThe 2D region representing the area on the plane. -
Constructor Summary
ConstructorsConstructorDescriptionConstruct a new, empty plane subset for the given plane.EmbeddedTreePlaneSubset(EmbeddingPlane plane, boolean full) Construct a new subset for the given plane.EmbeddedTreePlaneSubset(EmbeddingPlane plane, RegionBSPTree2D region) Construct a new instance from its defining plane and subspace region. -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(EmbeddedTreePlaneSubset subset) Add a plane subset to this instance.voidadd(PlaneConvexSubset subset) Add a plane convex subset to this instance.Get aBounds3Dobject defining an axis-aligned bounding box containing all vertices for this subset.Return an object containing the plane subset as an embedded 2D subspace region.private Rotation2DConstruct a rotation transform used to transform the subspace of the given embedded region plane subset into the subspace of this instance.Get the embedded subspace region.split(Hyperplane<Vector3D> splitter) Split this instance with the given hyperplane.toConvex()Convert this instance into a list of convex child subsets representing the same region.Return a list of triangles representing the same subset region as this instance.Return a new hyperplane subset resulting from the application of the given transform.Methods inherited from class AbstractEmbeddedRegionPlaneSubset
classify, closest, getBoundsFromSubspace, getCentroid, getHyperplane, getPlane, getSize, isEmpty, isFull, toSpace, toString, toSubspaceMethods inherited from class AbstractPlaneSubset
intersection, intersectionMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Embedding
toSpace, toSubspaceMethods inherited from interface HyperplaneSubset
containsMethods inherited from interface Sized
isFinite, isInfinite
-
Field Details
-
region
The 2D region representing the area on the plane.
-
-
Constructor Details
-
EmbeddedTreePlaneSubset
Construct a new, empty plane subset for the given plane.- Parameters:
plane- plane containing the subset
-
EmbeddedTreePlaneSubset
Construct a new subset for the given plane. Iffullis true, then the subset will cover the entire plane; otherwise, it will be empty.- Parameters:
plane- plane containing the subsetfull- if true, the subset will cover the entire space; otherwise it will be empty
-
EmbeddedTreePlaneSubset
Construct a new instance from its defining plane and subspace region.- Parameters:
plane- plane containing the subsetregion- subspace region for the plane subset
-
-
Method Details
-
getEmbedded
Return an object containing the plane subset as an embedded 2D subspace region.- Returns:
- an object containing the plane subset as an embedded 2D subspace region
-
getSubspaceRegion
Get the embedded subspace region.- Returns:
- the embedded subspace region
-
toConvex
Convert this instance into a list of convex child subsets representing the same region. Implementations are not required to return an optimal convex subdivision of the current instance. They are free to return whatever subdivision is readily available.- Returns:
- a list of hyperplane convex subsets representing the same subspace region as this instance
-
toTriangles
Return a list of triangles representing the same subset region as this instance. AnIllegalStateExceptionis thrown if the subset has infinite size and therefore cannot be converted to triangles. If the subset has zero size (is empty), an empty list is returned.- Returns:
- a list of triangles representing the same subset region as this instance
-
getBounds
-
split
Split this instance with the given hyperplane.In all cases, the current instance is not modified. However, In order to avoid unnecessary copying, this method will use the current instance as the split value when the instance lies entirely on the plus or minus side of the splitter. For example, if this instance lies entirely on the minus side of the splitter, the plane subset returned by
Split.getMinus()will be this instance. Similarly,Split.getPlus()will return the current instance if it lies entirely on the plus side. Callers need to make special note of this, since this class is mutable.- Parameters:
splitter- the hyperplane to split this object with.- Returns:
- result of the split operation
-
transform
Return a new hyperplane subset resulting from the application of the given transform. The current instance is not modified.- Parameters:
transform- the transform instance to apply- Returns:
- new transformed hyperplane subset
-
add
Add a plane convex subset to this instance.- Parameters:
subset- plane convex subset to add- Throws:
IllegalArgumentException- if the given plane subset is not from a plane equivalent to this instance
-
add
Add a plane subset to this instance.- Parameters:
subset- plane subset to add- Throws:
IllegalArgumentException- if the given plane subset is not from a plane equivalent to this instance
-
getEmbeddedRegionRotation
Construct a rotation transform used to transform the subspace of the given embedded region plane subset into the subspace of this instance. Returns null if no transform is needed. This method must only be called with embedded regions that share an equivalent plane with this instance, meaning that the planes have the same origin point and normal- Parameters:
embedded- the embedded region plane subset to compare with the current instance- Returns:
- a rotation transform to convert from the subspace of the argument into the current subspace; returns null if no such transform is needed
-