Package com.anylogic.engine.markup
- Constructor Summary
- Method Summary
- Constructor Details
- Method Details
- initialize
- setAngles
- getStartAngle
- getEndAngle
- getRatioStartToEnd
- getStart
- getEnd
- getNearestPoint
- getNearestPoint
- getDistanceSq
- getDistanceSq
- addTo
- toString
- getOffsetOfPoint
- getNearestPointOnRay2D
- getArgNearestPointOnRay2D
- getStartArcCenterX
- getStartArcCenterY
- getStartArcRadius
- getStartArcStartAngle
- getStartArcAngle
- getStartArcSign
- getEndArcCenterX
- getEndArcCenterY
- getEndArcRadius
- getEndArcStartAngle
- getEndArcAngle
- getEndArcSign
- getJoinX
- getJoinY
- getJoinZ
- convertToShapes
- getBoundingRectangle
- java.lang.Object
- com.anylogic.engine.markup.AbstractMarkupSegment
- com.anylogic.engine.markup.MarkupSegment
- com.anylogic.engine.markup.MarkupSegmentArc
- 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 | Description |
---|---|
MarkupSegmentArc() | |
MarkupSegmentArc | |
MarkupSegmentArc |
Modifier and Type | Method | Description |
---|---|---|
void | addTo |
Adds this segment to the given path assuming that path is currently positioned on
the start point of this segment
|
List<Shape> | convertToShapes() | |
static Point | getArgNearestPointOnRay2D |
Deprecated.
|
BoundingRectangle | getBoundingRectangle() | |
double | getDistanceSq |
For horizontal segments, calculates and returns the square of distance to the
point (in the XY-projection).
|
double | getDistanceSq |
Calculates and returns the square of distance to the given (x, y, z) point.
|
Position | getEnd |
Returns the location of the end position of the segment
|
double | getEndAngle() |
Returns the angle of the tangent to the segment at its end
|
double | getEndArcAngle() | |
double | getEndArcCenterX() | |
double | getEndArcCenterY() | |
double | getEndArcRadius() | |
double | getEndArcSign() | |
double | getEndArcStartAngle() | |
double | getJoinX() | |
double | getJoinY() | |
double | getJoinZ() | |
double | getNearestPoint |
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. |
double | getNearestPoint |
For horizontal segments, calculates (using the
output object) the point in
this space markup element nearest to the given (x, y) point. |
double | getNearestPointOnRay2D |
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).
|
double | getOffsetOfPoint |
Calculates distance by segment to the given point.
|
double | getRatioStartToEnd() |
Returns the start to end ratio
|
Position | getStart |
Returns the location of the start position of the segment
|
double | getStartAngle() |
Returns the angle of the tangent to the segment at its start
|
double | getStartArcAngle() | |
double | getStartArcCenterX() | |
double | getStartArcCenterY() | |
double | getStartArcRadius() | |
double | getStartArcSign() | |
double | getStartArcStartAngle() | |
void | initialize() | |
void | setAngles |
Sets the angles of this arc.
|
String | toString() |
public MarkupSegmentArc()
public MarkupSegmentArc(double sx, double sy, double sz, double ex, double ey, double ez, double startAngle, double endAngle, double ratioStartToEnd)
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)
public void initialize()
public void setAngles(double startAngle, double endAngle, double ratioStartToEnd)
Sets the angles of this arc. The element should be uninitialized
- Parameters:
startAngle
- start angleendAngle
- end angleratioStartToEnd
- start to and ratio
public double getStartAngle()
Returns the angle of the tangent to the segment at its start
public double getEndAngle()
Returns the angle of the tangent to the segment at its end
public double getRatioStartToEnd()
Returns the start to end ratio
public Position getStart(Position out)
Description copied from class:
AbstractMarkupSegment
Returns the location of the start position of the segment
- Specified by:
getStart
in classAbstractMarkupSegment
- Parameters:
out
- output object to write to, may benull
- Returns:
- the Position object with coordinates of the segment start
public Position getEnd(Position out)
Description copied from class:
AbstractMarkupSegment
Returns the location of the end position of the segment
- Specified by:
getEnd
in classAbstractMarkupSegment
- Parameters:
out
- output object to write to, may benull
- Returns:
- the Position object with coordinates of the segment end
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 classMarkupSegment
- Parameters:
x
- x coordinate of the pointy
- y coordinate of the pointout
- the output point to write result to. Note thatoutput.z
is left unchanged.- Returns:
- the square of distance to the nearest point in the horizontal (XY) projection
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 classMarkupSegment
- Parameters:
x
- x coordinate of the pointy
- y coordinate of the pointz
- z coordinate of the pointoutput
- the output point to write result to.- Returns:
- the square of distance to the nearest point
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 classMarkupSegment
- Parameters:
x
- x coordinate of the pointy
- y coordinate of the point- Returns:
- the square of distance to the given point in the horizontal (XY) projection
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 classMarkupSegment
- Parameters:
x
- x coordinate of the pointy
- y coordinate of the pointz
- z coordinate of the point- Returns:
- the square of distance to the given point
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 interfaceIMarkupSegment
- Parameters:
path
- the path to add this segment to
public String toString()
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 interfaceIMarkupSegment
- Parameters:
x
- the x coordinate of the given point.
In case of GIS space 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 space 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
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
Returns
+infinity
if there is no intersections.- Specified by:
getNearestPointOnRay2D
in interfaceIMarkupSegment
- Parameters:
x1
- the X coordinate of the start point of the rayy1
- the Y coordinate of the start point of the rayx2
- the X coordinate of some point on the rayy2
- the Y coordinate of some point on the rayout
- 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
@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.
@AnyLogicInternalAPI public double getStartArcCenterX()
@AnyLogicInternalAPI public double getStartArcCenterY()
@AnyLogicInternalAPI public double getStartArcRadius()
@AnyLogicInternalAPI public double getStartArcStartAngle()
@AnyLogicInternalAPI public double getStartArcAngle()
@AnyLogicInternalAPI public double getStartArcSign()
@AnyLogicInternalAPI public double getEndArcCenterX()
@AnyLogicInternalAPI public double getEndArcCenterY()
@AnyLogicInternalAPI public double getEndArcRadius()
@AnyLogicInternalAPI public double getEndArcStartAngle()
@AnyLogicInternalAPI public double getEndArcAngle()
@AnyLogicInternalAPI public double getEndArcSign()
@AnyLogicInternalAPI public double getJoinX()
@AnyLogicInternalAPI public double getJoinY()
@AnyLogicInternalAPI public double getJoinZ()
public List<Shape> convertToShapes()
Description copied from class:
MarkupSegment
- Specified by:
convertToShapes
in classMarkupSegment
- Returns:
- the list of primitives that comprise the markup segment
@AnyLogicInternalAPI public BoundingRectangle getBoundingRectangle()