org.apache.commons.math3.geometry.euclidean.twod
private static class PolygonsSet.SegmentsBuilder extends java.lang.Object implements BSPTreeVisitor<Euclidean2D>
BSPTreeVisitor.Order
Modifier and Type | Field and Description |
---|---|
private AVLTree<PolygonsSet.ComparableSegment> |
sorted
Sorted segments.
|
Constructor and Description |
---|
PolygonsSet.SegmentsBuilder()
Simple constructor.
|
Modifier and Type | Method and Description |
---|---|
private void |
addContribution(SubHyperplane<Euclidean2D> sub,
boolean reversed)
Add he contribution of a boundary facet.
|
AVLTree<PolygonsSet.ComparableSegment> |
getSorted()
Get the sorted segments.
|
void |
visitInternalNode(BSPTree<Euclidean2D> node)
Visit a BSP tree node node having a non-null sub-hyperplane.
|
void |
visitLeafNode(BSPTree<Euclidean2D> node)
Visit a leaf BSP tree node node having a null sub-hyperplane.
|
BSPTreeVisitor.Order |
visitOrder(BSPTree<Euclidean2D> node)
Determine the visit order for this node.
|
private AVLTree<PolygonsSet.ComparableSegment> sorted
public PolygonsSet.SegmentsBuilder()
public BSPTreeVisitor.Order visitOrder(BSPTree<Euclidean2D> 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.
visitOrder
in interface BSPTreeVisitor<Euclidean2D>
node
- BSP node guaranteed to have a non null cut sub-hyperplaneBSPTreeVisitor.Order.PLUS_MINUS_SUB
, BSPTreeVisitor.Order.PLUS_SUB_MINUS
,
BSPTreeVisitor.Order.MINUS_PLUS_SUB
, BSPTreeVisitor.Order.MINUS_SUB_PLUS
,
BSPTreeVisitor.Order.SUB_PLUS_MINUS
, BSPTreeVisitor.Order.SUB_MINUS_PLUS
public void visitInternalNode(BSPTree<Euclidean2D> node)
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.
visitInternalNode
in interface BSPTreeVisitor<Euclidean2D>
node
- BSP node guaranteed to have a non null cut sub-hyperplaneBSPTreeVisitor.visitLeafNode(org.apache.commons.math3.geometry.partitioning.BSPTree)
public void visitLeafNode(BSPTree<Euclidean2D> node)
visitLeafNode
in interface BSPTreeVisitor<Euclidean2D>
node
- leaf BSP node having a null sub-hyperplaneBSPTreeVisitor.visitInternalNode(org.apache.commons.math3.geometry.partitioning.BSPTree)
private void addContribution(SubHyperplane<Euclidean2D> sub, boolean reversed)
sub
- boundary facetreversed
- if true, the facet has the inside on its plus sidepublic AVLTree<PolygonsSet.ComparableSegment> getSorted()
Copyright (c) 2003-2013 Apache Software Foundation