Class RectilinearAvoidObstaclesPathFinder

    • Constructor Detail

      • RectilinearAvoidObstaclesPathFinder

        public RectilinearAvoidObstaclesPathFinder()
        The empty constructor.
    • Method Detail

      • addObstacle

        public void addObstacle​(org.eclipse.draw2d.geometry.Rectangle rect)
        Description copied from interface: IPathFinder
        Adds an obstacle with the given bounds to the obstacles.
        Specified by:
        addObstacle in interface IPathFinder
        Parameters:
        rect - the bounds of this obstacle
      • removeObstacle

        public void removeObstacle​(org.eclipse.draw2d.geometry.Rectangle rect)
        Description copied from interface: IPathFinder
        Removes the obstacle with the rectangle's bounds from the routing.
        Specified by:
        removeObstacle in interface IPathFinder
        Parameters:
        rect - the bounds of the obstacle to remove
      • isSmallObstacle

        protected boolean isSmallObstacle​(org.eclipse.draw2d.geometry.Rectangle rect)
      • addSpacing

        protected org.eclipse.draw2d.geometry.Rectangle addSpacing​(org.eclipse.draw2d.geometry.Rectangle rect)
      • updateObstacle

        public void updateObstacle​(org.eclipse.draw2d.geometry.Rectangle oldBounds,
                                   org.eclipse.draw2d.geometry.Rectangle newBounds)
        Description copied from interface: IPathFinder
        Updates the position of an existing obstacle.
        Specified by:
        updateObstacle in interface IPathFinder
        Parameters:
        oldBounds - the old bounds(used to find the obstacle)
        newBounds - the new bounds
      • find

        public RoutePath find​(Position start,
                              Position end,
                              boolean strict)
        Description copied from interface: IPathFinder
        Finds the path
        Specified by:
        find in interface IPathFinder
        Parameters:
        start - the start position
        end - the end position
        strict - the flag
        Returns:
        finded path
        See Also:
        RoutePath
      • filterObstacles

        protected void filterObstacles​(Position pos,
                                       boolean strict)
      • restoreObstacles

        protected void restoreObstacles()
      • getSpacing

        public int getSpacing()
        Gets the spacing maintained between figure and path.
        Default: 10.
        Specified by:
        getSpacing in interface IPathFinder
        Returns:
        the spacing maintained between figure and path.
      • setSpacing

        public void setSpacing​(int spacing)
        Sets the spacing maintained between figure and path.
        Specified by:
        setSpacing in interface IPathFinder
        Parameters:
        spacing - the spacing to set