Class RectilinearAvoidObstaclesPathFinder
- java.lang.Object
-
- com._1c.g5.v8.dt.common.gef.drow2d.RectilinearAvoidObstaclesPathFinder
-
- All Implemented Interfaces:
IPathFinder
public class RectilinearAvoidObstaclesPathFinder extends Object implements IPathFinder
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_SPACINGThe default spacing maintained between figure and path.
-
Constructor Summary
Constructors Constructor Description RectilinearAvoidObstaclesPathFinder()The empty constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddObstacle(org.eclipse.draw2d.geometry.Rectangle rect)Adds an obstacle with the given bounds to the obstacles.protected org.eclipse.draw2d.geometry.RectangleaddSpacing(org.eclipse.draw2d.geometry.Rectangle rect)protected IHighwayMatrixcreateMatrix()protected voidfilterObstacles(Position pos, boolean strict)RoutePathfind(Position start, Position end, boolean strict)Finds the pathprotected List<Highway>getHighways(Position position, boolean strict)protected IHighwayMatrixgetMatrix()intgetSpacing()Gets the spacing maintained between figure and path.
Default: 10.protected booleanisDirect(Position start, Position end)protected booleanisSmallObstacle(org.eclipse.draw2d.geometry.Rectangle rect)voidremoveObstacle(org.eclipse.draw2d.geometry.Rectangle rect)Removes the obstacle with the rectangle's bounds from the routing.protected voidrestoreObstacles()voidsetSpacing(int spacing)Sets the spacing maintained between figure and path.voidupdateObstacle(org.eclipse.draw2d.geometry.Rectangle oldBounds, org.eclipse.draw2d.geometry.Rectangle newBounds)Updates the position of an existing obstacle.
-
-
-
Field Detail
-
DEFAULT_SPACING
public static final int DEFAULT_SPACING
The default spacing maintained between figure and path.- See Also:
getSpacing(),setSpacing(int), Constant Field Values
-
-
Method Detail
-
addObstacle
public void addObstacle(org.eclipse.draw2d.geometry.Rectangle rect)
Description copied from interface:IPathFinderAdds an obstacle with the given bounds to the obstacles.- Specified by:
addObstaclein interfaceIPathFinder- Parameters:
rect- the bounds of this obstacle
-
removeObstacle
public void removeObstacle(org.eclipse.draw2d.geometry.Rectangle rect)
Description copied from interface:IPathFinderRemoves the obstacle with the rectangle's bounds from the routing.- Specified by:
removeObstaclein interfaceIPathFinder- 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:IPathFinderUpdates the position of an existing obstacle.- Specified by:
updateObstaclein interfaceIPathFinder- 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:IPathFinderFinds the path- Specified by:
findin interfaceIPathFinder- Parameters:
start- the start positionend- the end positionstrict- the flag- Returns:
- finded path
- See Also:
RoutePath
-
filterObstacles
protected void filterObstacles(Position pos, boolean strict)
-
restoreObstacles
protected void restoreObstacles()
-
getMatrix
protected IHighwayMatrix getMatrix()
-
createMatrix
protected IHighwayMatrix createMatrix()
-
getSpacing
public int getSpacing()
Gets the spacing maintained between figure and path.
Default: 10.- Specified by:
getSpacingin interfaceIPathFinder- Returns:
- the spacing maintained between figure and path.
-
setSpacing
public void setSpacing(int spacing)
Sets the spacing maintained between figure and path.- Specified by:
setSpacingin interfaceIPathFinder- Parameters:
spacing- the spacing to set
-
-