Region are subsets of a space, they can be infinite (whole space, half space, infinite stripe ...) or finite (polygons in 2D, polyhedrons in 3D ...). Their main characteristic is to separate points that are considered to be inside the region from points considered to be outside of it. In between, there may be points on the boundary of the region.
This implementation is limited to regions for which the boundary
is composed of several sub-hyperplanes,
including regions with no boundary at all: the whole space and the
empty region. They are not necessarily finite and not necessarily
path-connected. They can contain holes.
Regions can be combined using the traditional sets operations : union, intersection, difference and symetric difference (exclusive or) for the binary operations, complement for the unary operation.
Note that this interface is not intended to be implemented by Apache Commons Math users, it is only intended to be implemented within the library itself. New methods may be added even for minor versions, which breaks compatibility for external implementations.
| Modifier and Type | Class and Description |
|---|---|
| public static enum | Region.
Enumerate for the location of a point with respect to the region. |
| Modifier and Type | Method and Description |
|---|---|
| public Region | |
| public Region. | Returns: a code representing the point status: eitherLocation#INSIDE, Location#OUTSIDE or Location#BOUNDARYpoint to check point)Check a point with respect to the region. |
| public boolean | |
| public Region | |
| public Point | |
| public double | Returns: the size of the boundary (this is 0 in 1D, a length in 2D, an area in 3D ...)Get the size of the boundary. |
| public double | Returns: the size of the instance (this is a length in 1D, an area in 2D, a volume in 3D ...)Get the size of the instance. |
| public BSPTree | Returns: underlying BSP treeif true, the boundary attributes
at internal nodes are guaranteed to be included (they may be
included even if the argument is false, if they have already been
computed due to a previous call) includeBoundaryAttributes)Get the underlying BSP tree. |
| public SubHyperplane | Returns: filtered sub-hyperplanesub-hyperplane traversing the region sub)Get the parts of a sub-hyperplane that are contained in the region. |
| public boolean | |
| public boolean | Returns: true if the sub-tree starting at the given node is emptyroot node of the sub-tree (must have node)Region tree semantics, i.e. the leaf nodes must have
Boolean attributes representing an inside/outside
property)Check if the sub-tree starting at a given node is empty. |
| public boolean | Returns: true if the instance covers the full spaceCheck if the instance covers the full space. |
| public boolean | Returns: true if the sub-tree starting at the given node covers the full spaceroot node of the sub-tree (must have node)Region tree semantics, i.e. the leaf nodes must have
Boolean attributes representing an inside/outside
property)Check if the sub-tree starting at a given node covers the full space. |
| public BoundaryProjection | Returns: projection of the point on the boundarypoint to check point)Project a point on the boundary of the region. |
| public Side | Returns: one ofSide., Side., Side. or Side. (the latter result can occur only if the tree
contains only one cut hyperplane)reference hyperplane hyperplane)
Deprecated
as of 3.6, this method which was only intended for
internal use is not used anymore
Compute the relative position of the instance with respect to an hyperplane. |
| buildNew | back to summary |
|---|---|
| public Region Build a region using the instance as a prototype. This method allow to create new instances without knowing exactly the type of the region. It is an application of the prototype design pattern. The leaf nodes of the BSP tree must have a
| |
| checkPoint | back to summary |
|---|---|
| public Region. Check a point with respect to the region.
| |
| contains | back to summary |
|---|---|
| public boolean contains(final Region<S> region) Check if the instance entirely contains another region.
| |
| copySelf | back to summary |
|---|---|
| public Region Copy the instance. The instance created is completely independant of the original
one. A deep copy is used, none of the underlying objects are
shared (except for the underlying tree
| |
| getBarycenter | back to summary |
|---|---|
| public Point Get the barycenter of the instance.
| |
| getBoundarySize | back to summary |
|---|---|
| public double getBoundarySize() Get the size of the boundary.
| |
| getSize | back to summary |
|---|---|
| public double getSize() Get the size of the instance.
| |
| getTree | back to summary |
|---|---|
| public BSPTree Get the underlying BSP tree. Regions are represented by an underlying inside/outside BSP
tree whose leaf attributes are In addition to the leaf attributes, the internal nodes which
correspond to cells split by cut sub-hyperplanes may contain
Since computing the boundary is not always required and can be
time-consuming for large trees, these internal nodes attributes
are computed using lazy evaluation only when required by setting
the
| |
| intersection | back to summary |
|---|---|
| public SubHyperplane Get the parts of a sub-hyperplane that are contained in the region. The parts of the sub-hyperplane that belong to the boundary are not included in the resulting parts.
| |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() Check if the instance is empty.
| |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty(final BSPTree<S> node) Check if the sub-tree starting at a given node is empty. | |
| isFull | back to summary |
|---|---|
| public boolean isFull() Check if the instance covers the full space.
| |
| isFull | back to summary |
|---|---|
| public boolean isFull(final BSPTree<S> node) Check if the sub-tree starting at a given node covers the full space. | |
| projectToBoundary | back to summary |
|---|---|
| public BoundaryProjection Project a point on the boundary of the region.
| |
| side | back to summary |
|---|---|
| public Side side(final Hyperplane<S> hyperplane)
Deprecated as of 3.6, this method which was only intended for internal use is not used anymore Compute the relative position of the instance with respect to an hyperplane.
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final Region. | BOUNDARY
Code for points on the partition boundary. |
| public static final Region. | INSIDE
Code for points inside the partition. |
| public static final Region. | OUTSIDE
Code for points outside of the partition. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static Region. | |
| public static Region. |
| BOUNDARY | back to summary |
|---|---|
| public static final Region. Code for points on the partition boundary. | |
| INSIDE | back to summary |
|---|---|
| public static final Region. Code for points inside the partition. | |
| OUTSIDE | back to summary |
|---|---|
| public static final Region. Code for points outside of the partition. | |
| Location | back to summary |
|---|---|
| private Location() | |
| valueOf | back to summary |
|---|---|
| public static Region. | |
| values | back to summary |
|---|---|
| public static Region. | |