Package com.anylogic.engine.markup
- java.lang.Object
-
- com.anylogic.engine.markup.Polygon2D
- All Implemented Interfaces:
java.io.Serializable
@AnyLogicInternalAPI public class Polygon2D extends java.lang.Object implements java.io.Serializable
- See Also:
- Serialized Form
Polygon2D(MarkupShape owner) |
|
Constructor | Description |
---|
void |
addVertex(double x,
double y) |
|
boolean |
contains(double px,
double py) |
|
double |
getArea() |
|
Point |
getCenter(Point out) |
|
double |
getNearestPoint(Point output,
double rx,
double ry) |
|
int |
getNPoints() |
Returns the number of points in the markup element.
|
java.awt.geom.Path2D.Double |
getPath() |
|
double |
getPointDx(int i) |
Returns the x coordinate of a particular point of the markup element relative to the start point.
|
double |
getPointDy(int i) |
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(java.util.Random rng,
Point out) |
|
void |
setPoints(double[] dx,
double[] dy) |
|
Modifier and Type | Method | Description |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
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 java.awt.geom.Path2D.Double getPath()
public Point getCenter(Point out)
public Point randomPointInside(java.util.Random rng, Point out)
public boolean contains(double px, double py)
public double getNearestPoint(Point output, double rx, double ry)
-
How can we improve this article?
-