Package com.anylogic.engine.presentation
- java.lang.Object
- com.anylogic.engine.presentation.Shape
- com.anylogic.engine.presentation.Shape3D
- All Implemented Interfaces:
com.anylogic.engine.internal.Child
,Locatable2D
,Locatable3D
,AggregatableAnimationElement
,HasLevel
,LevelElement
,SVGElement
,UsdElement
,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
Modifier and Type | Field | Description |
---|---|---|
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 |
Constructor | Description |
---|---|
Shape3D() |
Modifier and Type | Method | Description |
---|---|---|
boolean | canHandleClick |
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 |
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 |
Sets both coordinates of the shape
|
void | setPos |
Sets coordinates of the shape
|
void | setPos |
Sets all the coordinates of the shape
|
void | setRotation |
Sets the rotation of the shape.
|
void | setScale |
Sets the same scale of the shape along all the axes
|
void | setScale |
Sets the scales of the shape along both axes
|
void | setScaleZ |
Sets the scale of the shape along z axis
|
void | setZ |
Sets the z coordinate of the figure
|
clone, contains, executeUserAction, findSVGElement, getGroup, getLevel, getName, getOrGenerateUSDId, getPresentable, getRotation, getScaleX, getScaleY, getSVGId, getUsdVersion, getX, getY, isJava2DSwingPresentation, isPublic_xjal, isSVGPresentation, isVisible, isVisibleCurrently, onAggregatorVisibilityChanged, onClick, postSVGShapeSpecificAttributes, randomPointInside, randomPointInside, removeSVGFromOwner, removeSVGImage, resetSVGState, restoreOwner, setChangedUsdVersion, setLevel, setNextChangedUsdVersion, setPublic_xjal, setScale, setScaleX, setScaleY, setVisible, setX, setY, updateDynamicProperties, updateDynamicPropertiesStructural, updateSVGProperties
public static final String UNKNOWN_NAME
This string is returned by
The value of this constant depends on the selected Engine language locale
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()
public Shape3D()
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.
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
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).
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 classShape
- Returns:
- the draw mode for this shape
public void setZ(double z)
Sets the z coordinate of the figure
- Parameters:
z
- the new value of z coordinate
public double getZ()
Returns the z coordinate of the shape (relative to the
Shape.getLevel()
, if any).- Specified by:
getZ
in interfaceLocatable3D
- Returns:
- the z coordinate of the shape
public double getZOffset()
Description copied from interface:
Locatable3D
Returns the offset from z coordinate of the location base.
This e.g. returns
This e.g. returns
getZHeight()
for
some 3D shapes- Specified by:
getZOffset
in interfaceLocatable3D
- Returns:
- the offset from z coordinate of the location
public void setPos(double x, double y)
Description copied from class:
Shape
Sets both coordinates of the shape
public void setPos(double x, double y, double z)
Sets coordinates of the shape
- Parameters:
x
- the new value of x coordinatey
- the new value of y coordinatez
- the new value of z coordinate
public void setPos(Point p)
Sets all the coordinates of the shape
public void setRotation(double r)
Description copied from class:
Shape
Sets the rotation of the shape.
- Overrides:
setRotation
in classShape
- Parameters:
r
- the new value of rotation in radians
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
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
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 sizesy
- the new value of scale along y axis, 1 = keep original sizesz
- the new value of scale along z axis, 1 = keep original size
public void setScale(double s)
Description copied from class:
Shape
Sets the same scale of the shape along all the axes
@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 classShape
- Parameters:
publicOnly
- iftrue
, non public shape would not handle clicks- Returns:
true
if a click can be handled, otherwisefalse