Class EmbeddedTreeLineSubset3D
- java.lang.Object
-
- org.apache.commons.geometry.euclidean.threed.line.LineSubset3D
-
- org.apache.commons.geometry.euclidean.threed.line.EmbeddedTreeLineSubset3D
-
- All Implemented Interfaces:
Embedding<Vector3D,Vector1D>
,RegionEmbedding<Vector3D,Vector1D>
,Sized
public final class EmbeddedTreeLineSubset3D extends LineSubset3D
Class representing an arbitrary subset of a line in 3D Euclidean space using aRegionBSPTree1D
. This class can represent convex, non-convex, finite, infinite, and empty regions.This class is mutable and not thread safe.
-
-
Field Summary
Fields Modifier and Type Field Description private RegionBSPTree1D
region
The 1D region representing the area on the line.
-
Constructor Summary
Constructors Constructor Description EmbeddedTreeLineSubset3D(Line3D line)
Construct a new, empty subset for the given line.EmbeddedTreeLineSubset3D(Line3D line, boolean full)
Construct a new subset for the given line.EmbeddedTreeLineSubset3D(Line3D line, RegionBSPTree1D region)
Construct a new instance from its defining line and subspace region.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Bounds3D
getBounds()
Get the 3D bounding box of the line subset or null if the subset is empty or infinite.Vector3D
getCentroid()
Get the centroid, or geometric center, of the line subset or null if the subset is empty or infinite.double
getSize()
Get the size of the instance.RegionBSPTree1D
getSubspaceRegion()
Get the subspace region for the instance.java.util.List<LineConvexSubset3D>
toConvex()
Return a list ofLineConvexSubset3D
instances representing the same region as this instance.java.lang.String
toString()
EmbeddedTreeLineSubset3D
transform(Transform<Vector3D> transform)
Transform this instance.-
Methods inherited from class org.apache.commons.geometry.euclidean.threed.line.LineSubset3D
getLine, toSpace, toSubspace
-
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.Sized
isFinite, isInfinite
-
-
-
-
Field Detail
-
region
private final RegionBSPTree1D region
The 1D region representing the area on the line.
-
-
Constructor Detail
-
EmbeddedTreeLineSubset3D
public EmbeddedTreeLineSubset3D(Line3D line)
Construct a new, empty subset for the given line.- Parameters:
line
- line defining the subset
-
EmbeddedTreeLineSubset3D
public EmbeddedTreeLineSubset3D(Line3D line, boolean full)
Construct a new subset for the given line. Iffull
is true, then the subset will cover the entire line; otherwise, it will be empty.- Parameters:
line
- line defining the subsetfull
- if true, the subset will cover the entire space; otherwise it will be empty
-
EmbeddedTreeLineSubset3D
public EmbeddedTreeLineSubset3D(Line3D line, RegionBSPTree1D region)
Construct a new instance from its defining line and subspace region.- Parameters:
line
- line defining the subsetregion
- subspace region for the subset
-
-
Method Detail
-
getSize
public double getSize()
Get the size of the instance.- Returns:
- the size of the instance
-
getSubspaceRegion
public RegionBSPTree1D getSubspaceRegion()
Get the subspace region for the instance.- Specified by:
getSubspaceRegion
in interfaceRegionEmbedding<Vector3D,Vector1D>
- Specified by:
getSubspaceRegion
in classLineSubset3D
- Returns:
- the subspace region for the instance
-
getCentroid
public Vector3D getCentroid()
Get the centroid, or geometric center, of the line subset or null if the subset is empty or infinite.- Specified by:
getCentroid
in classLineSubset3D
- Returns:
- the centroid of the line subset, or null if the subset is empty or infinite
-
getBounds
public Bounds3D getBounds()
Get the 3D bounding box of the line subset or null if the subset is empty or infinite.- Specified by:
getBounds
in classLineSubset3D
- Returns:
- the 3D bounding box the line subset or null if the subset is empty or infinite
-
transform
public EmbeddedTreeLineSubset3D transform(Transform<Vector3D> transform)
Transform this instance.- Parameters:
transform
- the transform to apply- Returns:
- a new, transformed instance
-
toConvex
public java.util.List<LineConvexSubset3D> toConvex()
Return a list ofLineConvexSubset3D
instances representing the same region as this instance.- Returns:
- a list of
LineConvexSubset3D
instances representing the same region as this instance.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-