Package com.anylogic.engine.markup
- java.lang.Object
-
- com.anylogic.engine.markup.AbstractMarkupSubunit<AreaNode>
-
- com.anylogic.engine.markup.Attractor
- All Implemented Interfaces:
java.io.Serializable
public class Attractor extends AbstractMarkupSubunit<AreaNode>
Attractor markup element: defines (x, y) location + orientation (rotation) of a point within some area / node markup.
- Author:
- AnyLogic North America, LLC https://anylogic.com
- See Also:
RectangularNode
,PolygonalNode
, Serialized Form
Attractor(double x,
double y,
double orientation) |
Creates new attractor object
|
Constructor | Description |
---|
double |
getOrientation() |
Returns the orientation.
|
Position |
getPosition(Position out) |
Returns the position associated with this attractor.
|
double |
getRelativeX() |
Returns the x coordinate relative to Area/Node
|
double |
getRelativeY() |
Returns the y coordinate relative to Area/Node
|
double |
getX() |
Returns the absolute x coordinate
|
double |
getY() |
Returns the absolute y coordinate
|
double |
getZ() |
Returns the absolute z coordinate (which is defined by container node/area)
|
Modifier and Type | Method | Description |
---|
getName, getOwner
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public Attractor(double x, double y, double orientation)
Creates new attractor object
- Parameters:
x
- the x coordinate relative to Area/Node, measured in pixelsy
- the y coordinate relative to Area/Node, measured in pixelsorientation
- the orientation in radians, clockwise, see alsoMath.toRadians(double)
- See Also:
AreaNode.addAttractor(Attractor)
public double getRelativeX()
Returns the x coordinate relative to Area/Node
- Returns:
- the x coordinate relative to Area/Node
public double getRelativeY()
Returns the y coordinate relative to Area/Node
- Returns:
- the y coordinate relative to Area/Node
public double getX()
Returns the absolute x coordinate
- Returns:
- the absolute x coordinate
public double getY()
Returns the absolute y coordinate
- Returns:
- the absolute y coordinate
public double getZ()
Returns the absolute z coordinate (which is defined by container node/area)
- Returns:
- the absolute z coordinate
public double getOrientation()
Returns the orientation.
- Returns:
- the orientation in radians, clockwise
- See Also:
Math.toDegrees(double)
public Position getPosition(Position out)
Returns the position associated with this attractor.
The vertical rotation is set to
NaN
- Parameters:
out
- the Position object to write to, may benull
- Returns:
- the given
out
object, if was notnull
, or new instance otherwise
-
How can we improve this article?
-