Package com.anylogic.engine.markup
- java.lang.Object
- com.anylogic.engine.markup.AbstractCurve<T>
- com.anylogic.engine.markup.AbstractNetworkCurve<T>
- All Implemented Interfaces:
IPathData
,Serializable
,Iterable<T>
- Direct Known Subclasses:
CircularCurve
,GISCurve
@AnyLogicInternalAPI public abstract class AbstractNetworkCurve<T extends AbstractMarkupSegment> extends AbstractCurve<T>
- See Also:
- Serialized Form
Constructor | Description |
---|---|
AbstractNetworkCurve() |
Modifier and Type | Method | Description |
---|---|---|
boolean | containsSq |
Test if the shape contains the point with the given coordinates (relative
to this shape's container, i.e.
|
double | getNearestPoint |
Returns the point on this curve closest to the specified point
|
double | getNearestPointOnRay |
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 |
Adds line segment (available for markup elements created with no-argument constructor)
|
abstract void | startDrawing |
Starts drawing (available for markup elements created with no-argument constructor)
|
addSegment, getEndPoint, getPositionAtOffset, getSegment, getSegmentCount, getStartPoint, isInitialized, iterator, length, segmentsStream, toString
public AbstractNetworkCurve()
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 containerpy
- the y coordinate relative to this shape's containersquareDistance
- 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
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 starty1
- the y coordinate of ray startx2
- the x coordinate of some ray pointy2
- the y coordinate of some ray pointout
- the output: intersection point, should be notnull
- Returns:
- the offset of the nearest point or
-1
if there is no intersections with the given ray
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
public abstract void lineTo(Point endPoint)
Adds line segment (available for markup elements created with no-argument constructor)
- Parameters:
endPoint
- the segment end point
public abstract void startDrawing(Point startPoint)
Starts drawing (available for markup elements created with no-argument constructor)
- Parameters:
startPoint
- starting point
public double getNearestPoint(Point givenPoint, Point out)
Returns the point on this curve closest to the specified point
- Parameters:
givenPoint
- specified pointout
- output object, may be null- Returns:
- closest point on the curve