Package com.anylogic.engine.markup
- Field Summary
- Constructor Summary
- Method Summary
- Methods inherited from class com.anylogic.engine.markup.AbstractWall
- Methods inherited from class com.anylogic.engine.markup.AbstractLevelMarkup
- Methods inherited from class com.anylogic.engine.markup.MarkupShape
- Methods inherited from class com.anylogic.engine.markup.AbstractMarkup
- Methods inherited from class java.lang.Object
- Methods inherited from interface com.anylogic.engine.markup.AggregatableAnimationElement
- Constructor Details
- Method Details
- All Implemented Interfaces:
AggregatableAnimationElement,HasBoundingRectangle,HasLevel,LevelElement,LevelMarkup,SVGElement,UsdElement,Serializable
public class Wall extends AbstractWall implements HasBoundingRectangle
- See Also:
- Serialized Form
| Constructor | Description |
|---|---|
Wall() | |
Wall | |
Wall |
Deprecated.
deprecated in version 8.4, will be removed in the future releases
|
| Modifier and Type | Method | Description |
|---|---|---|
void | addSegment |
Adds segment to this markup element
|
void | arcTo |
Adds arc segment with two circular arcs (available for markup elements created with no-argument constructor)
|
boolean | contains |
Tests if a specified point lies on the wall.
|
boolean | contains |
Tests if a specified point lies on the wall with a given distance tolerance.
|
boolean | containsSq |
Tests if a specified point lies on the wall with a given distance tolerance.
|
BoundingRectangle | getBoundingRectangle() | |
double | getNearestPoint |
Calculates (using the
output object) the point in this space markup element
nearest to the given (x, y, z) point. |
double | getNearestPoint |
Calculates (using the
output object) the point in this space markup element
nearest to the given (x, y) point. |
MarkupSegment | getSegment |
Returns the segment by its index
|
int | getSegmentCount() |
Returns the number of segments
|
boolean | isClosed() |
Returns the wall's
closed state. |
Iterator<MarkupSegment> | iterator() |
Creates and returns read-only iterator over segments
|
final double | length() |
Returns the length of the markup element, calculated in 3D space.
|
void | lineTo |
Adds line segment (available for markup elements created with no-argument constructor)
|
void | setClosed |
Sets the wall's
closed state. |
void | startDrawing |
Starts drawing (available for markup elements created with no-argument constructor)
|
Path3D | toPath3D() |
Converts this markup element to
Path3D interface |
getColor, getFillingType, getLineWidth, getTexture, getZHeight, setColor, setColor, setFillingType, setLineWidth, setZHeighterror, getFullName, getOutsideLevelZ, getPresentable, getSpace, initialize, isClickHandled, isOnly3D, isPublic, onClick, remove, setDrawMode, setOwnerdiscardOwner, executeUserAction, findSVGElement, getGroupOrOwner, getInspect, getInspectionWindowString, getName, getOrGenerateUSDId, getSVGComponent, getSVGId, initializeInternal, isVisible, onAggregatorInitialized, onAggregatorVisibilityChanged, removeSVGFromOwner, resetSVGComponent, resetSVGState, setInspect, setVisible, updateDynamicProperties, updateDynamicPropertiesStructural, updateSVGPropertiespublic Wall()
@AnyLogicInternalCodegenAPI public Wall(Agent owner, ShapeDrawMode drawMode, boolean isPublic, WallFillingType fillingType, Paint color, double lineWidth, double zHeight, boolean isClosed, MarkupSegment... segments)
@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-
public boolean contains(double px, double py)
Tests if a specified point lies on the wall.
For a closed wall also tests if a specified point is inside the area, surrounded by wall.
- Overrides:
containsin classAbstractWall- Parameters:
px- the x coordinate of pointpy- the y coordinate of point- Returns:
trueif the shape contains the point with the given coordinates
public boolean contains(double px, double py, double distance)
Tests if a specified point lies on the wall with a given distance tolerance.
For a closed wall also tests if a specified point is inside the area, surrounded by wall.
- Parameters:
px- the x coordinate relative to this shape's containerpy- the y coordinate relative to this shape's containerdistance- tolerance to determine whether the given point lies on the markup element line or not- Returns:
trueif the shape contains the point with the given coordinates
public boolean containsSq(double px, double py, double squareDistance)
Tests if a specified point lies on the wall with a given distance tolerance.
For a closed wall also tests if a specified point is inside the area, surrounded by wall.
- Parameters:
px- the x coordinate relative to this shape's containerpy- the y coordinate relative to this shape's containersquareDistance- the square of distance tolerance to determine whether the given point lies on the markup element line or not- Returns:
trueif the shape contains the point with the given coordinates
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 pointy- the y coordinate of the first pointz- the z coordinate of the first point
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 pointy- the y coordinate of the segment end pointz- the z coordinate of the segment end point
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 pointy- the y coordinate of the segment end pointz- the z coordinate of the segment end pointstartAngle- orientation of segment line startendAngle- orientation of segment line endratioStartToEnd- ratio between two circular arcs
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
public int getSegmentCount()
Returns the number of segments
- Returns:
- the number of segments
public MarkupSegment getSegment(int index)
Returns the segment by its index
- Parameters:
index- the segment index, [0 ..getSegmentCount()- 1]- Returns:
- the segment
public Iterator<MarkupSegment> iterator()
Creates and returns read-only iterator over segments
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
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 pointy- y coordinate of the pointoutput- the output point to write result to. Note thatoutput.zis left unchanged.- Returns:
- the square of distance to the nearest point in the horizontal (XY) projection
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 pointy- y coordinate of the pointz- z coordinate of the pointoutput- the output point to write result to.- Returns:
- the square of distance to the nearest point
public Path3D toPath3D()
Converts this markup element to
Path3D interface@AnyLogicInternalAPI public BoundingRectangle getBoundingRectangle()
- Specified by:
getBoundingRectanglein interfaceHasBoundingRectangle
public boolean isClosed()
Returns the wall's
closed state.public void setClosed(boolean isClosed)
Sets the wall's
closed state. May be called only before initialization.
It is not necessary to add last closing segment: during the initialization process
a non-closed wall with closed flag set into true will be appended with a linear closing segment.- Parameters:
isClosed- the desired state