Package com.anylogic.engine.presentation
- Field Summary
- Constructor Summary
- Method Summary
- Methods inherited from class com.anylogic.engine.presentation.Shape3D
- Methods inherited from class com.anylogic.engine.presentation.Shape
- Methods inherited from class java.lang.Object
- Methods inherited from interface com.anylogic.engine.markup.AggregatableAnimationElement
- Methods inherited from interface com.anylogic.engine.Locatable2D
- Field Details
- Constructor Details
- Method Details
- java.lang.Object
- com.anylogic.engine.presentation.Shape
- com.anylogic.engine.presentation.Shape3D
- com.anylogic.engine.presentation.Shape3DObject
- All Implemented Interfaces:
com.anylogic.engine.internal.Child
,Locatable2D
,Locatable3D
,AggregatableAnimationElement
,HasLevel
,LevelElement
,SVGElement
,UsdElement
,Serializable
,Cloneable
public class Shape3DObject extends Shape3D implements com.anylogic.engine.internal.Child
3D object shape loaded from COLLADA (.dae) file. Also visible on 2D animation (in the form of top-view).
This shape enables AnyLogic users to import ready-to-use 3D objects created in some third-party 3D graphics packets into their models.
COLLADA format is the XML-based file format for representing 3D computer graphics.
This shape enables AnyLogic users to import ready-to-use 3D objects created in some third-party 3D graphics packets into their models.
COLLADA format is the XML-based file format for representing 3D computer graphics.
- Author:
- AnyLogic North America, LLC https://anylogic.com
- See Also:
- Serialized Form
Modifier and Type | Field | Description |
---|---|---|
static final Object3DAxisOrder | XYZ_AXIS_ORDER |
Deprecated.
|
static final Object3DAxisOrder | YZX_AXIS_ORDER |
Deprecated.
|
static final Object3DAxisOrder | ZXY_AXIS_ORDER |
Deprecated.
|
Constructor | Description |
---|---|
Shape3DObject |
Deprecated.
this constructor is deprecated and will be removed in future releases
|
Shape3DObject |
Deprecated.
this constructor is deprecated and will be removed in future releases
|
Shape3DObject |
Deprecated.
this constructor is deprecated and will be deleted in future releases
|
Shape3DObject |
Constructs a 3D shape with specific attributes.
|
Shape3DObject |
Constructs a 3D shape with specific attributes.
|
Modifier and Type | Method | Description |
---|---|---|
final Shape3DObject | clone() |
Creates and returns a copy of this shape (i.e.
|
boolean | contains |
Test if the shape contains the point with the given coordinates
(relative to this shape's container, i.e.
|
void | dispose() |
Releases resources allocated by this object,
should be called on agent destroy.
|
double | getAgentScalingFactor() |
Returns additional scaling factor for sizing accordingly to the Scale element on the Agent.
|
Object3DAxisOrder | getAxisOrder() | |
String | getFilename() |
Returns the name of 3D object file
|
String | getFilePath_xjal() |
This method is internal and shouldn't be called by user.
it may be removed/renamed in future. |
Presentable | getPresentable() |
Returns the Presentable object (
Agent or Experiment ) where
this shape belongs to, or null. |
void | postSVGShapeSpecificAttributes |
Posts general properties specific to a particular shape class.
|
void | restoreOwner |
Deprecated.
|
void | setColor |
Changes custom color for the shape material with the given name.
Current implementation updates object on the 3D scene only, it doesn't update the 2D picture - this will be implemented in future releases. |
canHandleClick, getDrawMode, getScaleZ, getZ, getZOffset, setDrawMode, setPos, setPos, setPos, setRotation, setScale, setScale, setScaleZ, setZ
executeUserAction, findSVGElement, getGroup, getLevel, getName, getOrGenerateUSDId, getRotation, getScaleX, getScaleY, getSVGId, getUsdVersion, getX, getY, isJava2DSwingPresentation, isPublic_xjal, isSVGPresentation, isVisible, isVisibleCurrently, onAggregatorVisibilityChanged, onClick, randomPointInside, randomPointInside, removeSVGFromOwner, removeSVGImage, resetSVGState, setChangedUsdVersion, setLevel, setNextChangedUsdVersion, setPublic_xjal, setScale, setScaleX, setScaleY, setVisible, setX, setY, updateDynamicProperties, updateDynamicPropertiesStructural, updateSVGProperties
@Deprecated public static final Object3DAxisOrder XYZ_AXIS_ORDER
Deprecated.
@Deprecated public static final Object3DAxisOrder YZX_AXIS_ORDER
Deprecated.
@Deprecated public static final Object3DAxisOrder ZXY_AXIS_ORDER
Deprecated.
@Deprecated public Shape3DObject(Presentable presentable, boolean ispublic, double x, double y, double z, double rotation, double scale, String packagePrefix, String fileName, Object3DAxisOrder axisOrder, boolean applyShading, double topLeftX, double topLeftY, double width, double height)
Deprecated.
this constructor is deprecated and will be removed in future releases
@Deprecated public Shape3DObject(Presentable presentable, ShapeDrawMode drawMode, boolean ispublic, double x, double y, double z, double rotation, double scale, boolean autoScale, String packagePrefix, String fileName, Object3DAxisOrder axisOrder, boolean applyShading, double topLeftX, double topLeftY, double width, double height)
Deprecated.
this constructor is deprecated and will be removed in future releases
public Shape3DObject(Presentable presentable, ShapeDrawMode drawMode, boolean ispublic, double x, double y, double z, double rotation, double scale, boolean autoScale, String packagePrefix, String fileName, Object3DAxisOrder axisOrder, double topLeftX, double topLeftY, double width, double height)
Constructs a 3D shape with specific attributes.
- Parameters:
presentable
- the presentable object owning this objectdrawMode
- where to draw this shape: 2D, 3D or 2D+3Dispublic
- iftrue
, the shape is visible on container's presentationx
- the x coordinate of the objecty
- the y coordinate of the objectz
- the z coordinate of the objectrotation
- the rotation of the object in radiansscale
- the scale of the objectautoScale
- iftrue
, shape will be additionally resized to match the scale of the agent this shape is located on. Please note that in this case generated 2D image file should be rendered using the final, multiplied scalepackagePrefix
- the package name of original agent where this object is defined, formatted using '/' characters; with '/' character at the beginning and at the endfileName
- the name of the 3D object fileaxisOrder
- axis order of this figure, may be used for orientation correction for objects obtained from different 3D editorstopLeftX
- the x coordinate of the top-left corner of XY-projection of object in local object coordinatestopLeftY
- the y coordinate of the top-left corner of XY-projection of object in local object coordinateswidth
- the width of the XY-projection of object in local object coordinatesheight
- the height of the XY-projection of object in local object coordinatesimageFileId
- internal id used to find generated png imagecustomColors
- array of pairs: material name, color
@SafeVarargs @Deprecated public Shape3DObject(Presentable presentable, ShapeDrawMode drawMode, boolean ispublic, double x, double y, double z, double rotation, double scale, boolean autoScale, String packagePrefix, String fileName, Object3DAxisOrder axisOrder, boolean applyShading, double topLeftX, double topLeftY, double width, double height, Long imageFileId, Pair<String, Color>... customColors)
Deprecated.
this constructor is deprecated and will be deleted in future releases
@SafeVarargs public Shape3DObject(Presentable presentable, ShapeDrawMode drawMode, boolean ispublic, double x, double y, double z, double rotation, double scale, boolean autoScale, String packagePrefix, String fileName, Object3DAxisOrder axisOrder, Object3DInternalLighting internalLighting, boolean ignoreSceneLights, double topLeftX, double topLeftY, double width, double height, Long imageFileId, boolean visible, Pair<String, Color>... customColors)
Constructs a 3D shape with specific attributes.
- Parameters:
presentable
- the presentable object owning this objectdrawMode
- where to draw this shape: 2D, 3D or 2D+3Dispublic
- iftrue
, the shape is visible on container's presentationx
- the x coordinate of the objecty
- the y coordinate of the objectz
- the z coordinate of the objectrotation
- the rotation of the object in radiansscale
- the scale of the objectautoScale
- iftrue
, shape will be additionally resized to match the scale of the agent this shape is located on. Please note that in this case generated 2D image file should be rendered using the final, multiplied scalepackagePrefix
- the package name of original agent where this object is defined, formatted using '/' characters; with '/' character at the beginning and at the endfileName
- the name of the 3D object fileaxisOrder
- axis order of this figure, may be used for orientation correction for objects obtained from different 3D editorsinternalLighting
- defines how the internal lights (which this 3D object may contain) will operate on the scene: turned off, lighting this 3D object only (self lighting), or lighting on the global level (like headlamp of the car).ignoreSceneLights
- allows to disable lighting of this 3D object by other lights located on the model scene - useful when 3D object contains internal lights and shouldn't be double-lighted.topLeftX
- the x coordinate of the top-left corner of XY-projection of object in local object coordinatestopLeftY
- the y coordinate of the top-left corner of XY-projection of object in local object coordinateswidth
- the width of the XY-projection of object in local object coordinatesheight
- the height of the XY-projection of object in local object coordinatesimageFileId
- internal id used to find generated png imagecustomColors
- array of pairs: material name, color
public String getFilename()
Returns the name of 3D object file
- Returns:
- the name of 3D object file
public void setColor(String materialName, Color color)
Changes custom color for the shape material with the given name.
Current implementation updates object on the 3D scene only, it doesn't update the 2D picture - this will be implemented in future releases.
Current implementation updates object on the 3D scene only, it doesn't update the 2D picture - this will be implemented in future releases.
- Parameters:
materialName
- the name of the material. Please refer to Properties View of this 3D object in AnyLogic.color
- new color, ornull
to reset the color to default value- Since:
- 8.3
@AnyLogicInternalAPI public String getFilePath_xjal()
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
it may be removed/renamed in future.
public double getAgentScalingFactor()
Returns additional scaling factor for sizing accordingly to the Scale element on the Agent.
public Object3DAxisOrder getAxisOrder()
public boolean contains(double px, double py)
Description copied from class:
Shape
public Presentable getPresentable()
Description copied from class:
Shape
Returns the Presentable object (
Agent
or Experiment
) where
this shape belongs to, or null.- Overrides:
getPresentable
in classShape
- Returns:
- the Presentable that owns this shape, or null
@AnyLogicInternalCodegenAPI @Deprecated public void restoreOwner(Object owner)
Deprecated.
Description copied from class:
Shape
This method normally should not be called by user
This method restores owner of this object
The method is used in snapshot saving/loading
This method restores owner of this object
The method is used in snapshot saving/loading
- Specified by:
restoreOwner
in interfacecom.anylogic.engine.internal.Child
- Overrides:
restoreOwner
in classShape
- Parameters:
owner
- owner of this object, usuallyAgent
,Experiment
orShapeGroup
public final Shape3DObject clone()
Description copied from class:
Shape
Creates and returns a copy of this shape (i.e. new shape instance).
The returned shape is the object of the same class
The returned copy isn't automatically added to the group this shape belongs to.
The clone is created in the context of the same experiment or agent
Note that cloning of GIS shape, controls and charts is not supported
The returned shape is the object of the same class
The returned copy isn't automatically added to the group this shape belongs to.
The clone is created in the context of the same experiment or agent
Note that cloning of GIS shape, controls and charts is not supported
public void postSVGShapeSpecificAttributes(List<String> att, List<String> val, boolean publicOnly)
Description copied from class:
Shape
Posts general properties specific to a particular shape class.
Is triggered by SVG_DIRTY_SHAPE flag.
Made public for occasional posting of additional SVG properties from outside engine
(e.g. from libraries)
- Overrides:
postSVGShapeSpecificAttributes
in classShape
- Parameters:
att
- attribute namesval
- attribute valuespublicOnly
- TODO
@AnyLogicInternalCodegenAPI public void dispose()
Releases resources allocated by this object,
should be called on agent destroy.