Package com.anylogic.engine.markup
- Field Summary
- Constructor Summary
- Method Summary
- Methods inherited from class com.anylogic.engine.markup.AbstractLevelMarkup
- Methods inherited from class com.anylogic.engine.markup.MarkupShape
- Methods inherited from class com.anylogic.engine.markup.AbstractMarkup
- Methods inherited from class java.lang.Object
- Methods inherited from interface com.anylogic.engine.markup.AggregatableAnimationElement
- Constructor Details
- Method Details
- java.lang.Object
- com.anylogic.engine.markup.AbstractMarkup
- com.anylogic.engine.markup.MarkupShape
- com.anylogic.engine.markup.AbstractLevelMarkup
- com.anylogic.engine.markup.TargetLine
- All Implemented Interfaces:
AggregatableAnimationElement
,HasLevel
,LevelElement
,LevelMarkup
,SVGElement
,UsdElement
,Serializable
public class TargetLine extends AbstractLevelMarkup
- See Also:
- Serialized Form
Constructor | Description |
---|---|
TargetLine() | |
TargetLine |
Deprecated.
deprecated in version 8.4, will be removed in the future releases
|
Modifier and Type | Method | Description |
---|---|---|
void | addPoint |
Adds a point to the collection that will be used to build a polyline of this target line.
|
boolean | contains |
Test if the shape contains the point with the given coordinates (relative
to this shape's container, i.e.
|
boolean | contains |
Test if the shape contains the point with the given coordinates (relative
to this shape's container, i.e.
|
boolean | containsSq |
Test if the shape contains the point with the given coordinates (relative
to this shape's container, i.e.
|
BoundingRectangle | getBoundingRectangle() | |
Color | getColor() |
Returns the color of the shape, or
null if shape has no color |
double | getNearestPoint |
Returns a point on the target line that is closest to the specified point
|
int | getNPoints() |
Returns the number of points in the shape.
|
final Point | getPointAtOffset |
Returns the point located on the path with the given
offset
distance calculated from start point. |
double | getPointDx |
Returns the x coordinate of a particular point of the shape relative to the start point.
|
double | getPointDy |
Returns the y coordinate of a particular point of the shape relative to the start point.
|
double | getX() |
Returns the x coordinate of the shape.
|
double | getY() |
Returns the y coordinate of the shape.
|
final double | length() |
Returns the length of the path, calculated in 3D space.
|
Point | randomPointInside() |
Returns a random point on this target line
|
final Point | randomPointInside |
Returns a random point on this target line
|
void | setColor |
Sets the color of the shape.
|
void | setPos |
Sets coordinates of the shape
|
Path2D | toPath2D() |
Returns the
Path2D representation of this target line |
error, getFullName, getOutsideLevelZ, getPresentable, getSpace, initialize, isClickHandled, isPublic, onClick, remove, setDrawMode, setOwner
discardOwner, executeUserAction, findSVGElement, getName, getOrGenerateUSDId, getSVGId, initializeInternal, isVisible, onAggregatorInitialized, onAggregatorVisibilityChanged, removeSVGFromOwner, resetSVGState, setVisible, updateDynamicProperties, updateDynamicPropertiesStructural, updateSVGProperties
public TargetLine()
@Deprecated public TargetLine(Agent owner, ShapeDrawMode drawMode, boolean isPublic, double x, double y, double[] dx, double[] dy, Color color)
Deprecated.
deprecated in version 8.4, will be removed in the future releases
- Parameters:
owner
-drawMode
-isPublic
-x
-y
-dx
-dy
-color
-
public double getX()
Returns the x coordinate of the shape.
- Returns:
- the x coordinate of the shape
public double getY()
Returns the y coordinate of the shape.
- Returns:
- the y coordinate of the shape
public void setPos(double x, double y)
Sets coordinates of the shape
- Parameters:
x
- the new value of x coordinatey
- the new value of y coordinate
public void addPoint(double x, double y)
Adds a point to the collection that will be used to build a polyline of this target line.
The element should be uninitialized
- Parameters:
x
- x coordinate of the pointy
- y coordinate of the point
public int getNPoints()
Returns the number of points in the shape.
- Returns:
- the number of points in the shape
public double getPointDx(int i)
Returns the x coordinate of a particular point of the shape relative to the start point.
- Parameters:
i
- the index of the point (starting from 0)- Returns:
- the x coordinate of the point relative to the start point
public double getPointDy(int i)
Returns the y coordinate of a particular point of the shape relative to the start point.
- Parameters:
i
- the index of the point (starting from 0)- Returns:
- the y coordinate of the point relative to the start point
public void setColor(Color color)
Sets the color of the shape.
- Parameters:
color
- the new color, null = do not draw the shape
public Color getColor()
Returns the color of the shape, or
null
if shape has no color- Returns:
- the color of the shape
public final double length()
Returns the length of the path, calculated in 3D space.
- Returns:
- the length of the path, a positive number
public final Point getPointAtOffset(double offset, Point out)
Returns the point located on the path with the given
offset
distance calculated from start point.- Parameters:
offset
- offset, non-negative value, should be less or equal to the length.out
- output object to write to, may benull
- Returns:
- the Point object with coordinates of the path point with the given offset and orientation along path at this point
public boolean contains(double px, double py)
Description copied from class:
MarkupShape
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)
- Specified by:
contains
in classMarkupShape
- Parameters:
px
- the x coordinate relative to this shape's containerpy
- the y coordinate relative to this shape's container- Returns:
true
if the shape contains the point with the given coordinates
public boolean contains(double px, double py, double distance)
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 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 Point randomPointInside()
Returns a random point on this target line
- Returns:
- a random point on this target line
public final Point randomPointInside(Random rng, Point out)
Returns a random point on this target line
- Parameters:
rng
- specified random number generatorout
- output object, may be null- Returns:
- a random point on this target line
public double getNearestPoint(double x, double y, Point out)
Returns a point on the target line that is closest to the specified point
- Parameters:
x
- x coordinate of the pointy
- y coordinate of the pointout
- output object, may be null- Returns:
- a point on the target line that is closest to the specified point
public Path2D toPath2D()
Returns the
Path2D
representation of this target line- Returns:
Path2D
representation of this target line
@AnyLogicInternalAPI public BoundingRectangle getBoundingRectangle()