AnyLogic
Expand
Font size
All Implemented Interfaces:
IPathData, java.io.Serializable, java.lang.Iterable<T>
Direct Known Subclasses:
CircularCurve, GISCurve

@AnyLogicInternalAPI
public abstract class AbstractNetworkCurve<T extends AbstractMarkupSegment>
extends AbstractCurve<T>
See Also:
Serialized Form

Constructor Summary

Constructors 
AbstractNetworkCurve()  
Constructor Description

Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods 
boolean containsSq​(double px, double py, double squareDistance)
Test if the shape contains the point with the given coordinates (relative to this shape's container, i.e.
double getNearestPoint​(Point givenPoint, Point out)
Returns the point on this curve closest to the specified point
double getNearestPointOnRay​(double x1, double y1, double x2, double y2, Point out)
Calculates the intersection point between this element and the given ray.
boolean isClosed()
Returns true if the end point of the last segment equals the start point of the first segment, false otherwise
abstract void lineTo​(Point endPoint)
Adds line segment (available for markup elements created with no-argument constructor)
abstract void startDrawing​(Point startPoint)
Starts drawing (available for markup elements created with no-argument constructor)
Modifier and Type Method Description

Methods inherited from class com.anylogic.engine.markup.AbstractCurve

addSegment, getEndPoint, getPositionAtOffset, getSegment, getSegmentCount, getStartPoint, isInitialized, iterator, length, segmentsStream, toString

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

Methods inherited from interface java.lang.Iterable

forEach, spliterator

Constructor Detail

AbstractNetworkCurve

public AbstractNetworkCurve()

Method Detail

containsSq

public boolean containsSq​(double px,
                          double py,
                          double squareDistance)
Test if the shape contains the point with the given coordinates (relative to this shape's container, i.e. in the same system with the coordinates of this shape, x and y), using the given tolerance
Parameters:
px - the x coordinate relative to this shape's container
py - the y coordinate relative to this shape's container
squareDistance - the square of distance tolerance to determine whether the given point lies on the path line or not
Returns:
true if the shape contains the point with the given coordinates

getNearestPointOnRay

public double getNearestPointOnRay​(double x1,
                                   double y1,
                                   double x2,
                                   double y2,
                                   Point out)
Calculates the intersection point between this element and the given ray. If there are several intersections, returns the one nearest to the ray start
Parameters:
x1 - the x coordinate of ray start
y1 - the y coordinate of ray start
x2 - the x coordinate of some ray point
y2 - the y coordinate of some ray point
out - the output: intersection point, should be not null
Returns:
the offset of the nearest point or -1 if there is no intersections with the given ray

isClosed

public boolean isClosed()
Returns true if the end point of the last segment equals the start point of the first segment, false otherwise
Returns:
true if this curve is closed

lineTo

public abstract void lineTo​(Point endPoint)
Adds line segment (available for markup elements created with no-argument constructor)
Parameters:
endPoint - the segment end point

startDrawing

public abstract void startDrawing​(Point startPoint)
Starts drawing (available for markup elements created with no-argument constructor)
Parameters:
startPoint - starting point

getNearestPoint

public double getNearestPoint​(Point givenPoint,
                              Point out)
Returns the point on this curve closest to the specified point
Parameters:
givenPoint - specified point
out - output object, may be null
Returns:
closest point on the curve
How can we improve this article?