Package com.anylogic.engine.markup
- java.lang.Object
- com.anylogic.engine.markup.Polygon2D
- All Implemented Interfaces:
Serializable
@AnyLogicInternalAPI public class Polygon2D extends Object implements Serializable
- See Also:
- Serialized Form
Constructor | Description |
---|---|
Polygon2D |
Modifier and Type | Method | Description |
---|---|---|
void | addVertex | |
boolean | contains | |
double | getArea() | |
Point | getCenter | |
double | getNearestPoint | |
int | getNPoints() |
Returns the number of points in the markup element.
|
Path2D.Double | getPath() | |
double | getPointDx |
Returns the x coordinate of a particular point of the markup element relative to the start point.
|
double | getPointDy |
Returns the y coordinate of a particular point of the markup element relative to the start point.
|
double | getXMax() |
Returns the x coordinate of the bottom-right corner of bounding rectangle for this markup element.
|
double | getXMin() |
Returns the x coordinate of the top-left corner of bounding rectangle for this markup element.
|
double | getYMax() |
Returns the y coordinate of the bottom-right corner of bounding rectangle for this markup element.
|
double | getYMin() |
Returns the y coordinate of the top-left corner of bounding rectangle for this markup element.
|
void | initialize() | |
Point | randomPointInside | |
void | setPoints |
public Polygon2D(MarkupShape owner)
public void setPoints(double[] dx, double[] dy)
public void addVertex(double x, double y)
public void initialize()
public double getXMin()
Returns the x coordinate of the top-left corner of bounding rectangle for this markup element.
(
#getX()
is included)- Returns:
- the minimum x coordinate of the markup element
public double getXMax()
Returns the x coordinate of the bottom-right corner of bounding rectangle for this markup element.
(
#getX()
is included)- Returns:
- the maximum x coordinate of the markup element
public double getYMin()
Returns the y coordinate of the top-left corner of bounding rectangle for this markup element.
(
#getY()
is included)- Returns:
- the minimum y coordinate of the markup element
public double getYMax()
Returns the y coordinate of the bottom-right corner of bounding rectangle for this markup element.
(
#getY()
is included)- Returns:
- the maximum y coordinate of the markup element
public int getNPoints()
Returns the number of points in the markup element.
- Returns:
- the number of points in the markup element
public double getPointDx(int i)
Returns the x coordinate of a particular point of the markup element 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 (
#getX()
,#getY()
)
public double getPointDy(int i)
Returns the y coordinate of a particular point of the markup element 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 (
#getX()
,#getY()
)
public double getArea()
public Path2D.Double getPath()
public Point getCenter(Point out)
public Point randomPointInside(Random rng, Point out)
public boolean contains(double px, double py)
public double getNearestPoint(Point output, double rx, double ry)