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

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

Field Summary

Fields 
static java.lang.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
Modifier and Type Field Description

Constructor Summary

Constructors 
Shape3D()  
Constructor Description

Method Summary

All Methods Instance Methods Concrete Methods 
boolean canHandleClick​(boolean publicOnly)
Checks if the shape can handle mouse clicks in its current condition, namely with current public and visibility settings.
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).
double getScaleZ()
Returns the scale of the shape along z axis
double getZ()
Returns the z coordinate of the shape (relative to the Shape.getLevel(), if any).
double getZOffset()
Returns the offset from z coordinate of the location base.
This e.g.
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.
void setPos​(double x, double y)
Sets both coordinates of the shape
void setPos​(double x, double y, double z)
Sets coordinates of the shape
void setPos​(Point p)
Sets all the coordinates of the shape
void setRotation​(double r)
Sets the rotation of the shape.
void setScale​(double s)
Sets the same scale of the shape along all the axes
void setScale​(double sx, double sy, double sz)
Sets the scales of the shape along both axes
void setScaleZ​(double sz)
Sets the scale of the shape along z axis
void setZ​(double z)
Sets the z coordinate of the figure
Modifier and Type Method Description

Methods inherited from class com.anylogic.engine.presentation.Shape

clone, contains, executeUserAction, findSVGElement, getGroup, getLevel, getName, getPresentable, getRotation, getScaleX, getScaleY, getSVGId, getX, getY, isJava2DSwingPresentation, isPublic_xjal, isSVGPresentation, isVisible, onAggregatorVisibilityChanged, onClick, postSVGShapeSpecificAttributes, randomPointInside, randomPointInside, removeSVGFromOwner, removeSVGImage, resetSVGState, restoreOwner, setLevel, setPublic_xjal, setScale, setScaleX, setScaleY, setVisible, setX, setY, updateDynamicProperties, updateDynamicPropertiesStructural, updateSVGProperties

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 Detail

UNKNOWN_NAME

public static final java.lang.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 Detail

Shape3D

public Shape3D()

Method Detail

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
How can we improve this article?