public final class MarkupSegmentArc extends MarkupSegment
Constructor and Description |
---|
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) |
Modifier and Type | Method and Description |
---|---|
void |
addTo(java.awt.geom.Path2D path)
Adds this segment to the given path assuming that path is currently positioned on
the start point of this segment
|
java.util.List<java.awt.Shape> |
convertToShapes()
Converts the markup segment into java.awt.geom primitives
like
Arc2D or Line2D |
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.
|
BoundingRectangle |
getBoundingRectangle() |
double |
getDistanceSq(double x,
double y)
For horizontal segments, calculates and returns the square of distance to the
point (in the XY-projection).
|
double |
getDistanceSq(double x,
double y,
double z)
Calculates and returns the square of distance to the given (x, y, z) point.
|
Position |
getEnd(Position out)
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(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. |
double |
getNearestPoint(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. |
double |
getNearestPointOnRay2D(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).
|
double |
getOffsetOfPoint(double x,
double y)
Calculates distance by segment to the given point.
|
double |
getRatioStartToEnd()
Returns the start to end ratio
|
Position |
getStart(Position out)
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()
Prepares segment after setting parameters.
|
void |
setAngles(double startAngle,
double endAngle,
double ratioStartToEnd)
Sets the angles of this arc.
|
java.lang.String |
toString() |
getDistanceSq, getEnd, getEndX, getEndY, getEndZ, getNearestPoint, getOffsetFrom2D, getPositionAtOffset, getStart, getStartX, getStartY, getStartZ, length, length2D, setEnd, setEnd, setStart, setStart, setStartNextTo
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()
AbstractMarkupSegment
public void setAngles(double startAngle, double endAngle, double ratioStartToEnd)
startAngle
- start angleendAngle
- end angleratioStartToEnd
- start to and ratiopublic double getStartAngle()
public double getEndAngle()
public double getRatioStartToEnd()
public Position getStart(Position out)
AbstractMarkupSegment
getStart
in class AbstractMarkupSegment
out
- output object to write to, may be null
public Position getEnd(Position out)
AbstractMarkupSegment
getEnd
in class AbstractMarkupSegment
out
- output object to write to, may be null
public double getNearestPoint(double x, double y, Point out)
MarkupSegment
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).getNearestPoint
in class MarkupSegment
x
- x coordinate of the pointy
- y coordinate of the pointout
- the output point to write result to. Note that output.z
is left unchanged.public double getNearestPoint(double x, double y, double z, Point out)
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.getNearestPoint
in class MarkupSegment
x
- x coordinate of the pointy
- y coordinate of the pointz
- z coordinate of the pointoutput
- the output point to write result to.public double getDistanceSq(double x, double y)
MarkupSegment
getDistanceSq
in class MarkupSegment
x
- x coordinate of the pointy
- y coordinate of the pointpublic double getDistanceSq(double x, double y, double z)
MarkupSegment
getDistanceSq
in class MarkupSegment
x
- x coordinate of the pointy
- y coordinate of the pointz
- z coordinate of the pointpublic void addTo(java.awt.geom.Path2D path)
IMarkupSegment
addTo
in interface IMarkupSegment
path
- the path to add this segment topublic java.lang.String toString()
toString
in class java.lang.Object
public double getOffsetOfPoint(double x, double y)
IMarkupSegment
getOffsetOfPoint
in interface IMarkupSegment
x
- the x coordinate of the given point.y
- the y coordinate of the given pointpublic double getNearestPointOnRay2D(double x1, double y1, double x2, double y2, Point out)
IMarkupSegment
+infinity
if there is no intersections.getNearestPointOnRay2D
in interface IMarkupSegment
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+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)
@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 java.util.List<java.awt.Shape> convertToShapes()
MarkupSegment
Arc2D
or Line2D
convertToShapes
in class MarkupSegment
@AnyLogicInternalAPI public BoundingRectangle getBoundingRectangle()
Copyright © AnyLogic North America, LLC. All Rights Reserved.