Top Description Fields Constructors Methods
org.apache.commons.math3.geometry.partitioning

public abstract Class AbstractSubHyperplane<S extends Space, T extends Space>

extends Object
implements SubHyperplane<S extends Space>
Class Inheritance
All Implemented Interfaces
org.apache.commons.math3.geometry.partitioning.SubHyperplane
Known Direct Subclasses
org.apache.commons.math3.geometry.spherical.oned.SubLimitAngle, org.apache.commons.math3.geometry.spherical.twod.SubCircle, org.apache.commons.math3.geometry.euclidean.oned.SubOrientedPoint, org.apache.commons.math3.geometry.euclidean.threed.SubPlane, org.apache.commons.math3.geometry.euclidean.twod.SubLine
Type Parameters
<S>
Type of the embedding space.
<T>
Type of the embedded sub-space.
Imports
java.util.HashMap, .Map, org.apache.commons.math3.geometry.Space

This class implements the dimension-independent parts of SubHyperplane.

sub-hyperplanes are obtained when parts of an hyperplane are chopped off by other hyperplanes that intersect it. The remaining part is a convex region. Such objects appear in BSP trees as the intersection of a cut hyperplane with the convex region which it splits, the chopping hyperplanes are the cut hyperplanes closer to the tree root.

Since
3.0

Field Summary

Modifier and TypeField and Description
private final Hyperplane<S>
hyperplane

Underlying hyperplane.

private final Region<T>
remainingRegion

Remaining region of the hyperplane.

Constructor Summary

AccessConstructor and Description
protected
AbstractSubHyperplane(final Hyperplane<S>
underlying hyperplane
hyperplane
,
final Region<T>
remaining region of the hyperplane
remainingRegion
)

Build a sub-hyperplane from an hyperplane and a region.

Method Summary

Modifier and TypeMethod and Description
public AbstractSubHyperplane<S, T>

Returns:

the transformed instance
applyTransform
(final Transform<S, T>
D-dimension transform to apply
transform
)

Apply a transform to the instance.

protected abstract AbstractSubHyperplane<S, T>

Returns:

a new sub-hyperplane
buildNew
(final Hyperplane<S>
underlying hyperplane
hyper
,
final Region<T>
remaining region of the hyperplane
remaining
)

Build a sub-hyperplane from an hyperplane and a region.

public AbstractSubHyperplane<S, T>
public Hyperplane<S>

Returns:

underlying hyperplane
getHyperplane
()

Implements org.apache.commons.math3.geometry.partitioning.SubHyperplane.getHyperplane.

Get the underlying hyperplane.

public Region<T>

Returns:

remaining region of the hyperplane
getRemainingRegion
()

Get the remaining region of the hyperplane.

public double
public boolean
private BSPTree<T>

Returns:

a new tree
recurseTransform
(final BSPTree<T>
current BSP tree node
node
,
final Hyperplane<S>
image of the instance hyperplane by the transform
transformed
,
final Transform<S, T>
transform to apply
transform
,
final Map<BSPTree<T>, BSPTree<T>>
transformed nodes map
map
)

Recursively transform a BSP-tree from a sub-hyperplane.

public AbstractSubHyperplane<S, T>
reunite(final SubHyperplane<S>
other sub-hyperplane to union (must be in the same hyperplane as the instance)
other
)

Implements org.apache.commons.math3.geometry.partitioning.SubHyperplane.reunite.

Compute the union of the instance and another sub-hyperplane.

public Side
side(Hyperplane<S>
hyperplane to check instance against
hyper
)

Implements org.apache.commons.math3.geometry.partitioning.SubHyperplane.side.

Deprecated

Compute the relative position of the instance with respect to an hyperplane.

public abstract SubHyperplane.SplitSubHyperplane<S>
split(Hyperplane<S>
splitting hyperplane
hyper
)

Redeclares org.apache.commons.math3.geometry.partitioning.SubHyperplane.split.

Split the instance in two parts by an hyperplane.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

hyperplaneback to summary
private final Hyperplane<S> hyperplane

Underlying hyperplane.

remainingRegionback to summary
private final Region<T> remainingRegion

Remaining region of the hyperplane.

Constructor Detail

AbstractSubHyperplaneback to summary
protected AbstractSubHyperplane(final Hyperplane<S> hyperplane, final Region<T> remainingRegion)

Build a sub-hyperplane from an hyperplane and a region.

Parameters
hyperplane:Hyperplane<S>

underlying hyperplane

remainingRegion:Region<T>

remaining region of the hyperplane

Method Detail

applyTransformback to summary
public AbstractSubHyperplane<S, T> applyTransform(final Transform<S, T> transform)

Apply a transform to the instance.

The instance must be a (D-1)-dimension sub-hyperplane with respect to the transform not a (D-2)-dimension sub-hyperplane the transform knows how to transform by itself. The transform will consist in transforming first the hyperplane and then the all region using the various methods provided by the transform.

Parameters
transform:Transform<S, T>

D-dimension transform to apply

Returns:AbstractSubHyperplane<S, T>

the transformed instance

buildNewback to summary
protected abstract AbstractSubHyperplane<S, T> buildNew(final Hyperplane<S> hyper, final Region<T> remaining)

Build a sub-hyperplane from an hyperplane and a region.

Parameters
hyper:Hyperplane<S>

underlying hyperplane

remaining:Region<T>

remaining region of the hyperplane

Returns:AbstractSubHyperplane<S, T>

a new sub-hyperplane

copySelfback to summary
public AbstractSubHyperplane<S, T> copySelf()

Implements org.apache.commons.math3.geometry.partitioning.SubHyperplane.copySelf.

Doc from org.apache.commons.math3.geometry.partitioning.SubHyperplane.copySelf.

Copy the instance.

The instance created is completely independent of the original one. A deep copy is used, none of the underlying objects are shared (except for the nodes attributes and immutable objects).

Returns:AbstractSubHyperplane<S, T>

a new sub-hyperplane, copy of the instance

getHyperplaneback to summary
public Hyperplane<S> getHyperplane()

Implements org.apache.commons.math3.geometry.partitioning.SubHyperplane.getHyperplane.

Get the underlying hyperplane.

Returns:Hyperplane<S>

underlying hyperplane

getRemainingRegionback to summary
public Region<T> getRemainingRegion()

Get the remaining region of the hyperplane.

The returned region is expressed in the canonical hyperplane frame and has the hyperplane dimension. For example a chopped hyperplane in the 3D euclidean is a 2D plane and the corresponding region is a convex 2D polygon.

Returns:Region<T>

remaining region of the hyperplane

getSizeback to summary
public double getSize()

Implements org.apache.commons.math3.geometry.partitioning.SubHyperplane.getSize.

Doc from org.apache.commons.math3.geometry.partitioning.SubHyperplane.getSize.

Get the size of the instance.

Returns:double

the size of the instance (this is a length in 1D, an area in 2D, a volume in 3D ...)

isEmptyback to summary
public boolean isEmpty()

Implements org.apache.commons.math3.geometry.partitioning.SubHyperplane.isEmpty.

Doc from org.apache.commons.math3.geometry.partitioning.SubHyperplane.isEmpty.

Check if the instance is empty.

Returns:boolean

true if the instance is empty

recurseTransformback to summary
private BSPTree<T> recurseTransform(final BSPTree<T> node, final Hyperplane<S> transformed, final Transform<S, T> transform, final Map<BSPTree<T>, BSPTree<T>> map)

Recursively transform a BSP-tree from a sub-hyperplane.

Parameters
node:BSPTree<T>

current BSP tree node

transformed:Hyperplane<S>

image of the instance hyperplane by the transform

transform:Transform<S, T>

transform to apply

map:Map<BSPTree<T>, BSPTree<T>>

transformed nodes map

Returns:BSPTree<T>

a new tree

reuniteback to summary
public AbstractSubHyperplane<S, T> reunite(final SubHyperplane<S> other)

Implements org.apache.commons.math3.geometry.partitioning.SubHyperplane.reunite.

Doc from org.apache.commons.math3.geometry.partitioning.SubHyperplane.reunite.

Compute the union of the instance and another sub-hyperplane.

Parameters
other:SubHyperplane<S>

other sub-hyperplane to union (must be in the same hyperplane as the instance)

Returns:AbstractSubHyperplane<S, T>

a new sub-hyperplane, union of the instance and other

sideback to summary
public Side side(Hyperplane<S> hyper)

Implements org.apache.commons.math3.geometry.partitioning.SubHyperplane.side.

Doc from org.apache.commons.math3.geometry.partitioning.SubHyperplane.side.

Deprecated

Compute the relative position of the instance with respect to an hyperplane.

Parameters
hyper:Hyperplane<S>

hyperplane to check instance against

Returns:Side

one of Side#PLUS, Side#MINUS, Side#BOTH, Side#HYPER

Annotations
@Deprecated
splitback to summary
public abstract SubHyperplane.SplitSubHyperplane<S> split(Hyperplane<S> hyper)

Redeclares org.apache.commons.math3.geometry.partitioning.SubHyperplane.split.

Doc from org.apache.commons.math3.geometry.partitioning.SubHyperplane.split.

Split the instance in two parts by an hyperplane.

Parameters
hyper:Hyperplane<S>

splitting hyperplane

Returns:SubHyperplane.SplitSubHyperplane<S>

an object containing both the part of the instance on the plus side of the hyperplane and the part of the instance on the minus side of the hyperplane