AnyLogic
Expand
Font size
All Implemented Interfaces:
IMarkupSegment, Serializable

public final class MarkupSegmentArc
extends MarkupSegment
Arched markup segment for continuous space.
Author:
AnyLogic North America, LLC https://anylogic.com
See Also:
Serialized Form

Constructor Summary

ConstructorDescription
MarkupSegmentArc() 
MarkupSegmentArc(double sx, double sy, double sz, double ex, double ey, double ez, double startAngle, double endAngle, double ratioStartToEnd) 
MarkupSegmentArc(double sx, double sy, double sz, double ex, double ey, double ez, double startAngle, double endAngle, double ratioStartToEnd, double sArcCenterX, double sArcCenterY, double sArcRadius, double sArcStartAngle, double sArcAngle, double eArcCenterX, double eArcCenterY, double eArcRadius, double eArcStartAngle, double eArcAngle) 

Method Summary

Modifier and TypeMethodDescription
voidaddTo(Path2D path)
Adds this segment to the given path assuming that path is currently positioned on the start point of this segment
List<Shape>convertToShapes()
Converts the markup segment into java.awt.geom primitives like Arc2D or Line2D
static PointgetArgNearestPointOnRay2D(double ax, double ay, double bx, double by, double arcCenterX, double arcCenterY, double sx, double sy, double ex, double ey, double arcRadius, double arcAngle, double arcSign, Point out)
Deprecated.
BoundingRectanglegetBoundingRectangle() 
doublegetDistanceSq(double x, double y)
For horizontal segments, calculates and returns the square of distance to the point (in the XY-projection).
doublegetDistanceSq(double x, double y, double z)
Calculates and returns the square of distance to the given (x, y, z) point.
PositiongetEnd(Position out)
Returns the location of the end position of the segment
doublegetEndAngle()
Returns the angle of the tangent to the segment at its end
doublegetEndArcAngle() 
doublegetEndArcCenterX() 
doublegetEndArcCenterY() 
doublegetEndArcRadius() 
doublegetEndArcSign() 
doublegetEndArcStartAngle() 
doublegetJoinX() 
doublegetJoinY() 
doublegetJoinZ() 
doublegetNearestPoint(double x, double y, double z, Point out)
Calculates (using the output object) the point in this space markup element pseudo-nearest to the given (x, y, z) point: the chosen point is really nearest in the 2D (XY) plane.
doublegetNearestPoint(double x, double y, Point out)
For horizontal segments, calculates (using the output object) the point in this space markup element nearest to the given (x, y) point.
doublegetNearestPointOnRay2D(double x1, double y1, double x2, double y2, Point out)
Calculates (and sets in the 'out' object) the point where this segment intersects the given ray with the minimum distance from ray beginning (if there are several intersection points like in arc segments).
doublegetOffsetOfPoint(double x, double y)
Calculates distance by segment to the given point.
doublegetRatioStartToEnd()
Returns the start to end ratio
PositiongetStart(Position out)
Returns the location of the start position of the segment
doublegetStartAngle()
Returns the angle of the tangent to the segment at its start
doublegetStartArcAngle() 
doublegetStartArcCenterX() 
doublegetStartArcCenterY() 
doublegetStartArcRadius() 
doublegetStartArcSign() 
doublegetStartArcStartAngle() 
voidinitialize() 
voidsetAngles(double startAngle, double endAngle, double ratioStartToEnd)
Sets the angles of this arc.
StringtoString() 

Methods inherited from class java.lang.Object

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

Constructor Details

MarkupSegmentArc

public MarkupSegmentArc()

MarkupSegmentArc

public MarkupSegmentArc(double sx,
 double sy,
 double sz,
 double ex,
 double ey,
 double ez,
 double startAngle,
 double endAngle,
 double ratioStartToEnd)

MarkupSegmentArc

public MarkupSegmentArc(double sx,
 double sy,
 double sz,
 double ex,
 double ey,
 double ez,
 double startAngle,
 double endAngle,
 double ratioStartToEnd,
 double sArcCenterX,
 double sArcCenterY,
 double sArcRadius,
 double sArcStartAngle,
 double sArcAngle,
 double eArcCenterX,
 double eArcCenterY,
 double eArcRadius,
 double eArcStartAngle,
 double eArcAngle)

Method Details

initialize

public void initialize()

setAngles

public void setAngles(double startAngle,
 double endAngle,
 double ratioStartToEnd)
Sets the angles of this arc. The element should be uninitialized
Parameters:
startAngle - start angle
endAngle - end angle
ratioStartToEnd - start to and ratio

getStartAngle

public double getStartAngle()
Returns the angle of the tangent to the segment at its start

getEndAngle

public double getEndAngle()
Returns the angle of the tangent to the segment at its end

getRatioStartToEnd

public double getRatioStartToEnd()
Returns the start to end ratio

getStart

public Position getStart(Position out)
Description copied from class: AbstractMarkupSegment
Returns the location of the start position of the segment
Specified by:
getStart in class AbstractMarkupSegment
Parameters:
out - output object to write to, may be null
Returns:
the Position object with coordinates of the segment start

getEnd

public Position getEnd(Position out)
Description copied from class: AbstractMarkupSegment
Returns the location of the end position of the segment
Specified by:
getEnd in class AbstractMarkupSegment
Parameters:
out - output object to write to, may be null
Returns:
the Position object with coordinates of the segment end

getNearestPoint

public double getNearestPoint(double x,
 double y,
 Point out)
Description copied from class: MarkupSegment
For horizontal segments, 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).
Specified by:
getNearestPoint in class MarkupSegment
Parameters:
x - x coordinate of the point
y - y coordinate of the point
out - 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

getNearestPoint

public double getNearestPoint(double x,
 double y,
 double z,
 Point out)
Calculates (using the output object) the point in this space markup element pseudo-nearest to the given (x, y, z) point: the chosen point is really nearest in the 2D (XY) plane. Returns the square of distance to the point.
Specified by:
getNearestPoint in class MarkupSegment
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

getDistanceSq

public double getDistanceSq(double x,
 double y)
Description copied from class: MarkupSegment
For horizontal segments, calculates and 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).
Specified by:
getDistanceSq in class MarkupSegment
Parameters:
x - x coordinate of the point
y - y coordinate of the point
Returns:
the square of distance to the given point in the horizontal (XY) projection

getDistanceSq

public double getDistanceSq(double x,
 double y,
 double z)
Description copied from class: MarkupSegment
Calculates and returns the square of distance to the given (x, y, z) point.
Specified by:
getDistanceSq in class MarkupSegment
Parameters:
x - x coordinate of the point
y - y coordinate of the point
z - z coordinate of the point
Returns:
the square of distance to the given point

addTo

public void addTo(Path2D path)
Description copied from interface: IMarkupSegment
Adds this segment to the given path assuming that path is currently positioned on the start point of this segment
Specified by:
addTo in interface IMarkupSegment
Parameters:
path - the path to add this segment to

toString

public String toString()
Overrides:
toString in class Object

getOffsetOfPoint

public double getOffsetOfPoint(double x,
 double y)
Description copied from interface: IMarkupSegment
Calculates distance by segment to the given point. Point is specified by a pair of coordinates. The given point should by on this segment.
Specified by:
getOffsetOfPoint in interface IMarkupSegment
Parameters:
x - the x coordinate of the given point.
In case of GIS environment this is the latitude of the given point, measured in degrees (-90 ... (South) ... 0 ... (North) ... +90)
y - the y coordinate of the given point
In case of GIS environment this is the longitude of the given point, measured in degrees (-180 ... (West) ... 0 ... (East) ... +180)
Returns:
the distance by segment to the given point

getNearestPointOnRay2D

public double getNearestPointOnRay2D(double x1,
 double y1,
 double x2,
 double y2,
 Point out)
Description copied from interface: IMarkupSegment
Calculates (and sets in the 'out' object) the point where this segment intersects the given ray with the minimum distance from ray beginning (if there are several intersection points like in arc segments). Returns the square of that distance.
Returns +infinity if there is no intersections.
Specified by:
getNearestPointOnRay2D in interface IMarkupSegment
Parameters:
x1 - the X coordinate of the start point of the ray
y1 - the Y coordinate of the start point of the ray
x2 - the X coordinate of some point on the ray
y2 - the Y coordinate of some point on the ray
out - the Point object to write result to
Returns:
the square of the distance from ray beginning to the nearest intersection point or +infinity if there is no intersections

getArgNearestPointOnRay2D

@Deprecated
@AnyLogicInternalAPI
public static Point getArgNearestPointOnRay2D(double ax,
 double ay,
 double bx,
 double by,
 double arcCenterX,
 double arcCenterY,
 double sx,
 double sy,
 double ex,
 double ey,
 double arcRadius,
 double arcAngle,
 double arcSign,
 Point out)
Deprecated.

getStartArcCenterX

@AnyLogicInternalAPI
public double getStartArcCenterX()

getStartArcCenterY

@AnyLogicInternalAPI
public double getStartArcCenterY()

getStartArcRadius

@AnyLogicInternalAPI
public double getStartArcRadius()

getStartArcStartAngle

@AnyLogicInternalAPI
public double getStartArcStartAngle()

getStartArcAngle

@AnyLogicInternalAPI
public double getStartArcAngle()

getStartArcSign

@AnyLogicInternalAPI
public double getStartArcSign()

getEndArcCenterX

@AnyLogicInternalAPI
public double getEndArcCenterX()

getEndArcCenterY

@AnyLogicInternalAPI
public double getEndArcCenterY()

getEndArcRadius

@AnyLogicInternalAPI
public double getEndArcRadius()

getEndArcStartAngle

@AnyLogicInternalAPI
public double getEndArcStartAngle()

getEndArcAngle

@AnyLogicInternalAPI
public double getEndArcAngle()

getEndArcSign

@AnyLogicInternalAPI
public double getEndArcSign()

getJoinX

@AnyLogicInternalAPI
public double getJoinX()

getJoinY

@AnyLogicInternalAPI
public double getJoinY()

getJoinZ

@AnyLogicInternalAPI
public double getJoinZ()

convertToShapes

public List<Shape> convertToShapes()
Description copied from class: MarkupSegment
Converts the markup segment into java.awt.geom primitives like Arc2D or Line2D
Specified by:
convertToShapes in class MarkupSegment
Returns:
the list of primitives that comprise the markup segment

getBoundingRectangle

@AnyLogicInternalAPI
public BoundingRectangle getBoundingRectangle()