Top Description Fields Constructors Methods
org.apache.commons.math3.geometry.spherical.twod

pack-priv Class EdgesBuilder

extends Object
implements BSPTreeVisitor<Sphere2D>
Class Inheritance
All Implemented Interfaces
org.apache.commons.math3.geometry.partitioning.BSPTreeVisitor
Imports
java.util.ArrayList, .IdentityHashMap, .List, .Map, org.apache.commons.math3.exception.MathIllegalStateException, org.apache.commons.math3.exception.util.LocalizedFormats, org.apache.commons.math3.geometry.euclidean.threed.Vector3D, org.apache.commons.math3.geometry.partitioning.BSPTree, .BSPTreeVisitor, .BoundaryAttribute, org.apache.commons.math3.geometry.spherical.oned.Arc, .ArcsSet, .S1Point

Visitor building edges.
Since
3.3

Field Summary

Modifier and TypeField and Description
private final Map<Edge, BSPTree<Sphere2D>>
edgeToNode

Built edges and their associated nodes.

private final Map<BSPTree<Sphere2D>, List<Edge>>
nodeToEdgesList

Reversed map.

private final BSPTree<Sphere2D>
root

Root of the tree.

private final double
tolerance

Tolerance below which points are consider to be identical.

Constructor Summary

AccessConstructor and Description
pack-priv
EdgesBuilder(final BSPTree<Sphere2D>
tree root
root
,
final double
below which points are consider to be identical
tolerance
)

Simple constructor.

Method Summary

Modifier and TypeMethod and Description
private void
addContribution(final SubCircle
boundary facet
sub
,
final boolean
if true, the facet has the inside on its plus side
reversed
,
final BSPTree<Sphere2D>
node to which the edge belongs
node
)

Add the contribution of a boundary edge.

public List<Edge>

Returns:

boundary edges
getEdges
()

Get the boundary edges.

private Edge

Returns:

other edge, starting where the previous one ends (they have not been connected yet)
getFollowingEdge
(final Edge
edge to be continued
previous
)

Get the edge that should naturally follow another one.

public void
visitInternalNode(final BSPTree<Sphere2D>
BSP node guaranteed to have a non null cut sub-hyperplane
node
)

Implements org.apache.commons.math3.geometry.partitioning.BSPTreeVisitor.visitInternalNode.

Visit a BSP tree node node having a non-null sub-hyperplane.

public void
visitLeafNode(final BSPTree<Sphere2D>
leaf BSP node having a null sub-hyperplane
node
)

Implements org.apache.commons.math3.geometry.partitioning.BSPTreeVisitor.visitLeafNode.

Visit a leaf BSP tree node node having a null sub-hyperplane.

public BSPTreeVisitor.Order
visitOrder(final BSPTree<Sphere2D>
BSP node guaranteed to have a non null cut sub-hyperplane
node
)

Implements org.apache.commons.math3.geometry.partitioning.BSPTreeVisitor.visitOrder.

Determine the visit order for this node.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

edgeToNodeback to summary
private final Map<Edge, BSPTree<Sphere2D>> edgeToNode

Built edges and their associated nodes.

nodeToEdgesListback to summary
private final Map<BSPTree<Sphere2D>, List<Edge>> nodeToEdgesList

Reversed map.

rootback to summary
private final BSPTree<Sphere2D> root

Root of the tree.

toleranceback to summary
private final double tolerance

Tolerance below which points are consider to be identical.

Constructor Detail

EdgesBuilderback to summary
pack-priv EdgesBuilder(final BSPTree<Sphere2D> root, final double tolerance)

Simple constructor.

Parameters
root:BSPTree<Sphere2D>

tree root

tolerance:double

below which points are consider to be identical

Method Detail

addContributionback to summary
private void addContribution(final SubCircle sub, final boolean reversed, final BSPTree<Sphere2D> node)

Add the contribution of a boundary edge.

Parameters
sub:SubCircle

boundary facet

reversed:boolean

if true, the facet has the inside on its plus side

node:BSPTree<Sphere2D>

node to which the edge belongs

getEdgesback to summary
public List<Edge> getEdges() throws MathIllegalStateException

Get the boundary edges.

Returns:List<Edge>

boundary edges

Exceptions
MathIllegalStateException:
if there is not a single other edge
getFollowingEdgeback to summary
private Edge getFollowingEdge(final Edge previous) throws MathIllegalStateException

Get the edge that should naturally follow another one.

Parameters
previous:Edge

edge to be continued

Returns:Edge

other edge, starting where the previous one ends (they have not been connected yet)

Exceptions
MathIllegalStateException:
if there is not a single other edge
visitInternalNodeback to summary
public void visitInternalNode(final BSPTree<Sphere2D> node)

Implements org.apache.commons.math3.geometry.partitioning.BSPTreeVisitor.visitInternalNode.

Doc from org.apache.commons.math3.geometry.partitioning.BSPTreeVisitor.visitInternalNode.

Visit a BSP tree node node having a non-null sub-hyperplane.

It is guaranteed that this method will be called after visitOrder has been called for a given node, it wil be called exactly once for each internal node.

Parameters
node:BSPTree<Sphere2D>

BSP node guaranteed to have a non null cut sub-hyperplane

visitLeafNodeback to summary
public void visitLeafNode(final BSPTree<Sphere2D> node)

Implements org.apache.commons.math3.geometry.partitioning.BSPTreeVisitor.visitLeafNode.

Doc from org.apache.commons.math3.geometry.partitioning.BSPTreeVisitor.visitLeafNode.

Visit a leaf BSP tree node node having a null sub-hyperplane.

Parameters
node:BSPTree<Sphere2D>

leaf BSP node having a null sub-hyperplane

visitOrderback to summary
public BSPTreeVisitor.Order visitOrder(final BSPTree<Sphere2D> node)

Implements org.apache.commons.math3.geometry.partitioning.BSPTreeVisitor.visitOrder.

Doc from org.apache.commons.math3.geometry.partitioning.BSPTreeVisitor.visitOrder.

Determine the visit order for this node.

Before attempting to visit an internal node, this method is called to determine the desired ordering of the visit. It is guaranteed that this method will be called before visitInternalNode for a given node, it will be called exactly once for each internal node.

Parameters
node:BSPTree<Sphere2D>

BSP node guaranteed to have a non null cut sub-hyperplane

Returns:BSPTreeVisitor.Order

desired visit order, must be one of Order#PLUS_MINUS_SUB, Order#PLUS_SUB_MINUS, Order#MINUS_PLUS_SUB, Order#MINUS_SUB_PLUS, Order#SUB_PLUS_MINUS, Order#SUB_MINUS_PLUS