Class Edge

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Circle circle
      Circle supporting the edge.
      private Vertex end
      End vertex.
      private double length
      Length of the arc.
      private Vertex start
      Start vertex.
    • Constructor Summary

      Constructors 
      Constructor Description
      Edge​(Vertex start, Vertex end, double length, Circle circle)
      Build an edge not contained in any node yet.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private Vertex addSubEdge​(Vertex subStart, Vertex subEnd, double subLength, java.util.List<Edge> list, Circle splitCircle)
      Add a sub-edge to a list if long enough.
      Circle getCircle()
      Get the circle supporting this edge.
      Vertex getEnd()
      Get end vertex.
      double getLength()
      Get the length of the arc.
      Vector3D getPointAt​(double alpha)
      Get an intermediate point.
      Vertex getStart()
      Get start vertex.
      (package private) void setNextEdge​(Edge next)
      Connect the instance with a following edge.
      (package private) void split​(Circle splitCircle, java.util.List<Edge> outsideList, java.util.List<Edge> insideList)
      Split the edge.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • start

        private final Vertex start
        Start vertex.
      • end

        private Vertex end
        End vertex.
      • length

        private final double length
        Length of the arc.
      • circle

        private final Circle circle
        Circle supporting the edge.
    • Constructor Detail

      • Edge

        Edge​(Vertex start,
             Vertex end,
             double length,
             Circle circle)
        Build an edge not contained in any node yet.
        Parameters:
        start - start vertex
        end - end vertex
        length - length of the arc (it can be greater than \( \pi \))
        circle - circle supporting the edge
    • Method Detail

      • getStart

        public Vertex getStart()
        Get start vertex.
        Returns:
        start vertex
      • getEnd

        public Vertex getEnd()
        Get end vertex.
        Returns:
        end vertex
      • getLength

        public double getLength()
        Get the length of the arc.
        Returns:
        length of the arc (can be greater than \( \pi \))
      • getCircle

        public Circle getCircle()
        Get the circle supporting this edge.
        Returns:
        circle supporting this edge
      • getPointAt

        public Vector3D getPointAt​(double alpha)
        Get an intermediate point.

        The angle along the edge should normally be between 0 and getLength() in order to remain within edge limits. However, there are no checks on the value of the angle, so user can rebuild the full circle on which an edge is defined if they want.

        Parameters:
        alpha - angle along the edge, counted from getStart()
        Returns:
        an intermediate point
      • setNextEdge

        void setNextEdge​(Edge next)
        Connect the instance with a following edge.
        Parameters:
        next - edge following the instance
      • split

        void split​(Circle splitCircle,
                   java.util.List<Edge> outsideList,
                   java.util.List<Edge> insideList)
        Split the edge.

        Once split, this edge is not referenced anymore by the vertices, it is replaced by the two or three sub-edges and intermediate splitting vertices are introduced to connect these sub-edges together.

        Parameters:
        splitCircle - circle splitting the edge in several parts
        outsideList - list where to put parts that are outside of the split circle
        insideList - list where to put parts that are inside the split circle
      • addSubEdge

        private Vertex addSubEdge​(Vertex subStart,
                                  Vertex subEnd,
                                  double subLength,
                                  java.util.List<Edge> list,
                                  Circle splitCircle)
        Add a sub-edge to a list if long enough.

        If the length of the sub-edge to add is smaller than the Circle.getTolerance() tolerance of the support circle, it will be ignored.

        Parameters:
        subStart - start of the sub-edge
        subEnd - end of the sub-edge
        subLength - length of the sub-edge
        splitCircle - circle splitting the edge in several parts
        list - list where to put the sub-edge
        Returns:
        end vertex of the edge (subEnd if the edge was long enough and really added, subStart if the edge was too small and therefore ignored)