AnyLogic AnyLogic
Expand
Font size
  • 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

Constructor Summary

Constructors 
Polygon2D​(MarkupShape owner)  
Constructor Description

Method Summary

All Methods Instance Methods Concrete Methods 
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

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

Polygon2D

public Polygon2D​(MarkupShape owner)

Method Detail

setPoints

public void setPoints​(double[] dx,
                      double[] dy)

addVertex

public void addVertex​(double x,
                      double y)

initialize

public void initialize()

getXMin

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

getXMax

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

getYMin

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

getYMax

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

getNPoints

public int getNPoints()
Returns the number of points in the markup element.
Returns:
the number of points in the markup element

getPointDx

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())

getPointDy

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())

getArea

public double getArea()

getPath

public java.awt.geom.Path2D.Double getPath()

getCenter

public Point getCenter​(Point out)

randomPointInside

public Point randomPointInside​(java.util.Random rng,
                               Point out)

contains

public boolean contains​(double px,
                        double py)

getNearestPoint

public double getNearestPoint​(Point output,
                              double rx,
                              double ry)
How can we improve this article?