AnyLogic
Expand
Font size
All Implemented Interfaces:
AggregatableAnimationElement, HasLevel, LevelElement, LevelMarkup, SVGElement, Serializable

public class Wall
extends AbstractWall
See Also:
Serialized Form

Constructor Summary

ConstructorDescription
Wall() 
Wall(Agent owner, ShapeDrawMode drawMode, boolean isPublic, WallFillingType fillingType, Paint color, double lineWidth, double zHeight, MarkupSegment... segments)
Deprecated.
deprecated in version 8.4, will be removed in the future releases

Method Summary

Modifier and TypeMethodDescription
voidaddSegment(MarkupSegment segment)
Adds segment to this markup element
voidarcTo(double x, double y, double z, double startAngle, double endAngle, double ratioStartToEnd)
Adds arc segment with two circular arcs (available for markup elements created with no-argument constructor)
booleancontains(double px, double py)
Test if the shape contains the point with the given coordinates (relative to this shape's container, i.e.
booleancontains(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.
booleancontainsSq(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.
BoundingRectanglegetBoundingRectangle() 
doublegetNearestPoint(double x, double y, double z, Point out)
Calculates (using the output object) the point in this space markup element nearest to the given (x, y, z) point.
doublegetNearestPoint(double x, double y, Point out)
Calculates (using the output object) the point in this space markup element nearest to the given (x, y) point.
MarkupSegmentgetSegment(int index)
Returns the segment by its index
intgetSegmentCount()
Returns the number of segments
Iterator<MarkupSegment>iterator()
Creates and returns read-only iterator over segments
final doublelength()
Returns the length of the markup element, calculated in 3D space.
voidlineTo(double x, double y, double z)
Adds line segment (available for markup elements created with no-argument constructor)
voidstartDrawing(double x, double y, double z)
Starts drawing (available for markup elements created with no-argument constructor)
Path3DtoPath3D()
Converts this markup element to Path3D interface

Methods inherited from class com.anylogic.engine.markup.AbstractWall

getColor, getFillingType, getLineWidth, getTexture, getZHeight, setColor, setColor, setFillingType, setLineWidth, setZHeight

Methods inherited from class com.anylogic.engine.markup.AbstractLevelMarkup

getDrawMode, getLevel, setLevel

Methods inherited from class com.anylogic.engine.markup.MarkupShape

error, getFullName, getOutsideLevelZ, getPresentable, getSpace, initialize, isClickHandled, isPublic, onClick, remove, setDrawMode, setOwner

Methods inherited from class java.lang.Object

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

Methods inherited from interface com.anylogic.engine.markup.AggregatableAnimationElement

initializeInternal, onAggregatorVisibilityChanged, postInitialize

Constructor Details

Wall

public Wall()

Wall

@Deprecated
public Wall(Agent owner,
 ShapeDrawMode drawMode,
 boolean isPublic,
 WallFillingType fillingType,
 Paint color,
 double lineWidth,
 double zHeight,
 MarkupSegment... segments)
Deprecated.
deprecated in version 8.4, will be removed in the future releases
Parameters:
owner -
drawMode -
isPublic -
fillingType -
color -
lineWidth -
zHeight -
segments -

Method Details

contains

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)
Overrides:
contains in class AbstractWall
Parameters:
px - the x coordinate relative to this shape's container
py - the y coordinate relative to this shape's container
Returns:
true if the shape contains the point with the given coordinates

contains

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 container
py - the y coordinate relative to this shape's container
squareDistance - the square of distance tolerance to determine whether the given point lies on the markup element line or not
Returns:
true if the shape contains the point with the given coordinates

containsSq

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 container
py - the y coordinate relative to this shape's container
squareDistance - the square of distance tolerance to determine whether the given point lies on the markup element line or not
Returns:
true if the shape contains the point with the given coordinates

startDrawing

public void startDrawing(double x,
 double y,
 double z)
Starts drawing (available for markup elements created with no-argument constructor)
Parameters:
x - the x coordinate of the first point
y - the y coordinate of the first point
z - the z coordinate of the first point

lineTo

public void lineTo(double x,
 double y,
 double z)
Adds line segment (available for markup elements created with no-argument constructor)
Parameters:
x - the x coordinate of the segment end point
y - the y coordinate of the segment end point
z - the z coordinate of the segment end point

arcTo

public void arcTo(double x,
 double y,
 double z,
 double startAngle,
 double endAngle,
 double ratioStartToEnd)
Adds arc segment with two circular arcs (available for markup elements created with no-argument constructor)
Parameters:
x - the x coordinate of the segment end point
y - the y coordinate of the segment end point
z - the z coordinate of the segment end point
startAngle - orientation of segment line start
endAngle - orientation of segment line end
ratioStartToEnd - ratio between two circular arcs

addSegment

public void addSegment(MarkupSegment segment)
Adds segment to this markup element
Parameters:
segment - the segment, should be initialized if was created using no-argument constructor

getSegmentCount

public int getSegmentCount()
Returns the number of segments
Returns:
the number of segments

getSegment

public MarkupSegment getSegment(int index)
Returns the segment by its index
Parameters:
index - the segment index, [0 .. getSegmentCount() - 1]
Returns:
the segment

iterator

public Iterator<MarkupSegment> iterator()
Creates and returns read-only iterator over segments

length

public final double length()
Returns the length of the markup element, calculated in 3D space.
Returns:
the length of the markup element (measured in pixels), a positive number

getNearestPoint

public double getNearestPoint(double x,
 double y,
 Point out)
Calculates (using the output object) the point in this space markup element nearest to the given (x, y) point. Returns the square of distance to the point (in the XY-projection). All the calculations are performed in the horizontal projection (z-coordinates aren't used, as if all of the z coordinates were zero).
Parameters:
x - x coordinate of the point
y - y coordinate of the point
output - the output point to write result to. Note that output.z is left unchanged.
Returns:
the square of distance to the nearest point in the horizontal (XY) projection

getNearestPoint

public double getNearestPoint(double x,
 double y,
 double z,
 Point out)
Calculates (using the output object) the point in this space markup element nearest to the given (x, y, z) point. Returns the square of distance to the point.
Parameters:
x - x coordinate of the point
y - y coordinate of the point
z - z coordinate of the point
output - the output point to write result to.
Returns:
the square of distance to the nearest point

toPath3D

public Path3D toPath3D()
Converts this markup element to Path3D interface

getBoundingRectangle

@AnyLogicInternalAPI
public BoundingRectangle getBoundingRectangle()