public static void TestProximity2D_3()
 {
     com.epl.geometry.OperatorFactoryLocal factory   = com.epl.geometry.OperatorFactoryLocal.GetInstance();
     com.epl.geometry.OperatorProximity2D  proximity = (com.epl.geometry.OperatorProximity2D)factory.GetOperator(com.epl.geometry.Operator.Type.Proximity2D);
     com.epl.geometry.Polygon polygon = new com.epl.geometry.Polygon();
     polygon.StartPath(new com.epl.geometry.Point(-120, 22));
     polygon.LineTo(new com.epl.geometry.Point(-120, 10));
     polygon.LineTo(new com.epl.geometry.Point(-110, 10));
     polygon.LineTo(new com.epl.geometry.Point(-110, 22));
     com.epl.geometry.Point point = new com.epl.geometry.Point();
     point.SetXY(-110, 20);
     com.epl.geometry.Proximity2DResult result = proximity.GetNearestCoordinate(polygon, point, false);
     com.epl.geometry.Point             point2 = new com.epl.geometry.Point();
     point2.SetXY(-120, 12);
     com.epl.geometry.Proximity2DResult[] results = proximity.GetNearestVertices(polygon, point2, 10, 12);
 }
Пример #2
0
 /// <summary>
 /// Finds all vertices in the given distance from the specified point, sorted
 /// from the closest to the furthest.
 /// </summary>
 /// <remarks>
 /// Finds all vertices in the given distance from the specified point, sorted
 /// from the closest to the furthest.
 /// See OperatorProximity2D.
 /// </remarks>
 /// <param name="inputPoint">The point to start from.</param>
 /// <param name="geometry">The geometry to consider.</param>
 /// <param name="searchRadius">The search radius.</param>
 /// <param name="maxVertexCountToReturn">The maximum number number of vertices to return.</param>
 /// <returns>Proximity2DResult containing the array of nearest vertices.</returns>
 public static com.epl.geometry.Proximity2DResult[] GetNearestVertices(com.epl.geometry.Geometry geometry, com.epl.geometry.Point inputPoint, double searchRadius, int maxVertexCountToReturn)
 {
     com.epl.geometry.OperatorProximity2D proximity = (com.epl.geometry.OperatorProximity2D)factory.GetOperator(com.epl.geometry.Operator.Type.Proximity2D);
     com.epl.geometry.Proximity2DResult[] results   = proximity.GetNearestVertices(geometry, inputPoint, searchRadius, maxVertexCountToReturn);
     return(results);
 }