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

@AnyLogicInternalAPI
public abstract class CircularCurve
extends AbstractNetworkCurve<MarkupSegment>
See Also:
Serialized Form

Constructor Summary

Constructors 
CircularCurve()  
Constructor Description

Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods 
void arcTo​(double x, double y, double z, double startAngle, double endAngle, double ratioStartToEnd)
Adds arc segment with two circular arcs (available for markup elements created with no-argument constructor)
java.awt.geom.Rectangle2D getBounds()
Deprecated.
double getNearestPoint​(double x, double y, double z, Point out)
Calculates (using the output object) the point in this space markup element nearest to the given (x, y, z) point.
double getNearestPoint​(double x, double y, Point out)
Calculates (using the output object) the point in this space markup element nearest to the given (x, y) point.
java.awt.geom.Path2D getPath2D()
Returns the Path2D representation of this curve
Point getPointAtOffset​(double offset, Point out)
Returns the point located on the markup element with the given offset distance calculated from start point.
This method may be slightly faster in some cases but returns no orientation information (rotations).
void lineTo​(double x, double y, double z)
Adds line segment (available for markup elements created with no-argument constructor)
void lineTo​(Point endPoint)
Adds line segment (available for markup elements created with no-argument constructor)
void startDrawing​(double x, double y, double z)
Starts drawing (available for markup elements created with no-argument constructor)
void startDrawing​(Point startPoint)
Starts drawing (available for markup elements created with no-argument constructor)
Path3D toPath3D()
Converts this markup element to Path3D interface
Modifier and Type Method Description

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

containsSq, getNearestPoint, getNearestPointOnRay, isClosed

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

CircularCurve

public CircularCurve()

Method Detail

startDrawing

public void startDrawing​(double x,
                         double y,
                         double z)
Starts drawing (available for markup elements created with no-argument constructor)
Parameters:
x - the x coordinate of the first point
y - the y coordinate of the first point
z - the z coordinate of the first point

startDrawing

public void startDrawing​(Point startPoint)
Description copied from class: AbstractNetworkCurve
Starts drawing (available for markup elements created with no-argument constructor)
Specified by:
startDrawing in class AbstractNetworkCurve<MarkupSegment>
Parameters:
startPoint - starting point

lineTo

public void lineTo​(double x,
                   double y,
                   double z)
Adds line segment (available for markup elements created with no-argument constructor)
Parameters:
x - the x coordinate of the segment end point
y - the y coordinate of the segment end point
z - the z coordinate of the segment end point

lineTo

public void lineTo​(Point endPoint)
Description copied from class: AbstractNetworkCurve
Adds line segment (available for markup elements created with no-argument constructor)
Specified by:
lineTo in class AbstractNetworkCurve<MarkupSegment>
Parameters:
endPoint - the segment end point

arcTo

public void arcTo​(double x,
                  double y,
                  double z,
                  double startAngle,
                  double endAngle,
                  double ratioStartToEnd)
Adds arc segment with two circular arcs (available for markup elements created with no-argument constructor)
Parameters:
x - the x coordinate of the segment end point
y - the y coordinate of the segment end point
z - the z coordinate of the segment end point
startAngle - orientation of segment line start
endAngle - orientation of segment line end
ratioStartToEnd - ratio between two circular arcs

getPointAtOffset

public final Point getPointAtOffset​(double offset,
                                    Point out)
Returns the point located on the markup element with the given offset distance calculated from start point.
This method may be slightly faster in some cases but returns no orientation information (rotations).
Parameters:
offset - offset, non-negative value, should be less or equal to the full length.
out - output object to write to, may be null
Returns:
the Point object with coordinates of the point with the given offset
See Also:
AbstractCurve.getPositionAtOffset(double, Position)

getNearestPoint

public double getNearestPoint​(double x,
                              double y,
                              double z,
                              Point out)
Calculates (using the output object) the point in this space markup element nearest to the given (x, y, z) point. Returns the square of distance to the point.
Parameters:
x - x coordinate of the point
y - y coordinate of the point
z - z coordinate of the point
output - the output point to write result to.
Returns:
the square of distance to the nearest point

getNearestPoint

public double getNearestPoint​(double x,
                              double y,
                              Point out)
Calculates (using the output object) the point in this space markup element nearest to the given (x, y) point. Returns the square of distance to the point (in the XY-projection). All the calculations are performed in the horizontal projection (z-coordinates aren't used, as if all of the z coordinates were zero).
Parameters:
x - x coordinate of the point
y - y coordinate of the point
output - the output point to write result to. Note that output.z is left unchanged.
Returns:
the square of distance to the nearest point in the horizontal (XY) projection

toPath3D

public Path3D toPath3D()
Converts this markup element to Path3D interface

getPath2D

public java.awt.geom.Path2D getPath2D()
Returns the Path2D representation of this curve
Returns:
Path2D representation of this curve

getBounds

@Deprecated
public java.awt.geom.Rectangle2D getBounds()
Deprecated.
How can we improve this article?