AnyLogic
Expand
Font size
All Implemented Interfaces:
com.anylogic.engine.internal.Child, Locatable2D, Locatable3D, AggregatableAnimationElement, HasLevel, LevelElement, SVGElement, Serializable, Cloneable
Direct Known Subclasses:
AbstractShapeGISMap, ElevatorShaft, Shape3DObject, ShapeEmbeddedObjectPresentation, ShapeGroup, ShapeImage, ShapeLine, ShapeLineFill, ShapeText

public abstract class Shape3D
extends Shape
implements Locatable3D
See Also:
Serialized Form

Field Summary

Modifier and TypeFieldDescription
static final StringUNKNOWN_NAME
This string is returned by Shape.getName() for shapes with unknown names.
The value of this constant depends on the selected Engine language locale

Constructor Summary

ConstructorDescription
Shape3D() 

Method Summary

Modifier and TypeMethodDescription
booleancanHandleClick(boolean publicOnly)
Checks if the shape can handle mouse clicks in its current condition, namely with current public and visibility settings.
ShapeDrawModegetDrawMode()
Returns the drawing mode of the shape (where to draw this shape: 2D, 3D or 2D+3D).
If the shape has been created with no-argument constructor, and has no specific limitations (like 2D-only), and drawing mode hasn't yet been set, then it is initialized to default (2D + 3D).
doublegetScaleZ()
Returns the scale of the shape along z axis
doublegetZ()
Returns the z coordinate of the shape (relative to the Shape.getLevel(), if any).
doublegetZOffset()
Returns the offset from z coordinate of the location base.
This e.g.
voidsetDrawMode(ShapeDrawMode drawMode)
Sets the drawing mode of the shape (where to draw this shape: 2D, 3D or 2D+3D).
This method may be called only for shapes created using no-argument constructor (which have no limitations like 2D-only) and only once.
voidsetPos(double x, double y)
Sets both coordinates of the shape
voidsetPos(double x, double y, double z)
Sets coordinates of the shape
voidsetPos(Point p)
Sets all the coordinates of the shape
voidsetRotation(double r)
Sets the rotation of the shape.
voidsetScale(double s)
Sets the same scale of the shape along all the axes
voidsetScale(double sx, double sy, double sz)
Sets the scales of the shape along both axes
voidsetScaleZ(double sz)
Sets the scale of the shape along z axis
voidsetZ(double z)
Sets the z coordinate of the figure

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, postInitialize

Methods inherited from interface com.anylogic.engine.Locatable2D

getX, getY

Field Details

UNKNOWN_NAME

public static final String UNKNOWN_NAME
This string is returned by Shape.getName() for shapes with unknown names.
The value of this constant depends on the selected Engine language locale
See Also:
Shape.getName()Light3D.getName()

Constructor Details

Shape3D

public Shape3D()

Method Details

setDrawMode

public void setDrawMode(ShapeDrawMode drawMode)
Sets the drawing mode of the shape (where to draw this shape: 2D, 3D or 2D+3D).
This method may be called only for shapes created using no-argument constructor (which have no limitations like 2D-only) and only once. Any subsequent call for a shape having drawing mode already set, will throw error.
Parameters:
drawMode - where to draw this shape: 2D, 3D or 2D+3D

getDrawMode

public ShapeDrawMode getDrawMode()
Returns the drawing mode of the shape (where to draw this shape: 2D, 3D or 2D+3D).
If the shape has been created with no-argument constructor, and has no specific limitations (like 2D-only), and drawing mode hasn't yet been set, then it is initialized to default (2D + 3D).
Overrides:
getDrawMode in class Shape
Returns:
the draw mode for this shape

setZ

public void setZ(double z)
Sets the z coordinate of the figure
Parameters:
z - the new value of z coordinate

getZ

public double getZ()
Returns the z coordinate of the shape (relative to the Shape.getLevel(), if any).
Specified by:
getZ in interface Locatable3D
Returns:
the z coordinate of the shape

getZOffset

public double getZOffset()
Description copied from interface: Locatable3D
Returns the offset from z coordinate of the location base.
This e.g. returns getZHeight() for some 3D shapes
Specified by:
getZOffset in interface Locatable3D
Returns:
the offset from z coordinate of the location

setPos

public void setPos(double x,
 double y)
Description copied from class: Shape
Sets both coordinates of the shape
Overrides:
setPos in class Shape
Parameters:
x - the new value of x coordinate
y - the new value of y coordinate

setPos

public void setPos(double x,
 double y,
 double z)
Sets coordinates of the shape
Parameters:
x - the new value of x coordinate
y - the new value of y coordinate
z - the new value of z coordinate

setPos

public void setPos(Point p)
Sets all the coordinates of the shape
Overrides:
setPos in class Shape
Parameters:
p - the Point object containing coordinates

setRotation

public void setRotation(double r)
Description copied from class: Shape
Sets the rotation of the shape.
Overrides:
setRotation in class Shape
Parameters:
r - the new value of rotation in radians

setScaleZ

public void setScaleZ(double sz)
Sets the scale of the shape along z axis
Parameters:
sz - the new value of scale along z axis, 1 = keep original size

getScaleZ

public double getScaleZ()
Returns the scale of the shape along z axis
Returns:
the scale of the shape along z axis, 1 = keep original size

setScale

public void setScale(double sx,
 double sy,
 double sz)
Sets the scales of the shape along both axes
Parameters:
sx - the new value of scale along x axis, 1 = keep original size
sy - the new value of scale along y axis, 1 = keep original size
sz - the new value of scale along z axis, 1 = keep original size

setScale

public void setScale(double s)
Description copied from class: Shape
Sets the same scale of the shape along all the axes
Overrides:
setScale in class Shape
Parameters:
s - the new value of scale along all the axes, 1 = keep original size

canHandleClick

@AnyLogicLegacyAPI
public boolean canHandleClick(boolean publicOnly)
Description copied from class: Shape
Checks if the shape can handle mouse clicks in its current condition, namely with current public and visibility settings.
Overrides:
canHandleClick in class Shape
Parameters:
publicOnly - if true, non public shape would not handle clicks
Returns:
true if a click can be handled, otherwise false