Class PolygonsSet.Vertex

java.lang.Object
org.apache.commons.math3.geometry.euclidean.twod.PolygonsSet.Vertex
Enclosing class:
PolygonsSet

private static class PolygonsSet.Vertex extends Object
Internal class for holding vertices while they are processed to build a BSP tree.
  • Field Details

    • location

      private final Vector2D location
      Vertex location.
    • incoming

      private PolygonsSet.Edge incoming
      Incoming edge.
    • outgoing

      private PolygonsSet.Edge outgoing
      Outgoing edge.
    • lines

      private final List<Line> lines
      Lines bound with this vertex.
  • Constructor Details

    • Vertex

      Vertex(Vector2D location)
      Build a non-processed vertex not owned by any node yet.
      Parameters:
      location - vertex location
  • Method Details

    • getLocation

      public Vector2D getLocation()
      Get Vertex location.
      Returns:
      vertex location
    • bindWith

      public void bindWith(Line line)
      Bind a line considered to contain this vertex.
      Parameters:
      line - line to bind with this vertex
    • sharedLineWith

      public Line sharedLineWith(PolygonsSet.Vertex vertex)
      Get the common line bound with both the instance and another vertex, if any.

      When two vertices are both bound to the same line, this means they are already handled by node associated with this line, so there is no need to create a cut hyperplane for them.

      Parameters:
      vertex - other vertex to check instance against
      Returns:
      line bound with both the instance and another vertex, or null if the two vertices do not share a line yet
    • setIncoming

      public void setIncoming(PolygonsSet.Edge incoming)
      Set incoming edge.

      The line supporting the incoming edge is automatically bound with the instance.

      Parameters:
      incoming - incoming edge
    • getIncoming

      public PolygonsSet.Edge getIncoming()
      Get incoming edge.
      Returns:
      incoming edge
    • setOutgoing

      public void setOutgoing(PolygonsSet.Edge outgoing)
      Set outgoing edge.

      The line supporting the outgoing edge is automatically bound with the instance.

      Parameters:
      outgoing - outgoing edge
    • getOutgoing

      public PolygonsSet.Edge getOutgoing()
      Get outgoing edge.
      Returns:
      outgoing edge