Class FindPathThroughForbiddenArea
- Namespace
- CADability
- Assembly
- CADability.dll
Class to find a polyline between two points that does not cross the forbidden area
public class FindPathThroughForbiddenArea
- Inheritance
-
FindPathThroughForbiddenArea
- Inherited Members
Constructors
FindPathThroughForbiddenArea(BoundingRect[])
Constructor to define the forbidden area
public FindPathThroughForbiddenArea(BoundingRect[] forbiddenArea)
Parameters
forbiddenAreaBoundingRect[]Rectangle which may not be crossed
Methods
ContainsPoint(GeoPoint2D)
Tests whether the provided point toTest is contained in one of the rectangles
public bool ContainsPoint(GeoPoint2D toTest)
Parameters
toTestGeoPoint2DPoint to test
Returns
- bool
true if contained, false otherwise.
ContainsPoint(GeoPoint2D, double)
public bool ContainsPoint(GeoPoint2D toTest, double xyOffset)
Parameters
toTestGeoPoint2DxyOffsetdouble
Returns
FindPath(GeoPoint2D, GeoPoint2D, double)
Finds a polyline which connects startPoint and endPoint
and returns the intermediate points. The resulting polyline does not cross the forbidden area
public List<GeoPoint2D> FindPath(GeoPoint2D startPoint, GeoPoint2D endPoint, double xyOffset)
Parameters
startPointGeoPoint2DThe polyline starts here
endPointGeoPoint2Dthe polyline end here
xyOffsetdoubleDistance to keep from the forbidden areas: the forbidden areas are inflated by this value
Returns
- List<GeoPoint2D>
Intermediate points to go around the forbidden area
PolyLineHitTest(GeoPoint2D[])
Tests whether the provided polyline interferes with one of the rectangles
public bool PolyLineHitTest(GeoPoint2D[] toTest)
Parameters
toTestGeoPoint2D[]The polyline
Returns
- bool
true when the polyline and one of the rectangles interfere, fals otherwise
PolyLineHitTest(GeoPoint2D[], double)
public bool PolyLineHitTest(GeoPoint2D[] toTest, double xyOffset)
Parameters
toTestGeoPoint2D[]xyOffsetdouble