Package com.anylogic.engine.presentation
- java.lang.Object
- com.anylogic.engine.presentation.Shape
- com.anylogic.engine.presentation.ShapeControl
- com.anylogic.engine.presentation.ShapeWindow3D
- All Implemented Interfaces:
com.anylogic.engine.internal.Child
,Locatable2D
,AggregatableAnimationElement
,HasLevel
,LevelElement
,SVGElement
,Serializable
,Cloneable
public class ShapeWindow3D extends ShapeControl
The window showing 3D world on the model animation.
This is a shape like any control which is located on the model animation canvas. It draws the 3D scene from the field of view of selected camera.
3D window has custom context popup menu with additional items:
Window has several navigation modes:
This is a shape like any control which is located on the model animation canvas. It draws the 3D scene from the field of view of selected camera.
3D window has custom context popup menu with additional items:
- "Copy camera" - copies current view as camera setting to be pasted in the AnyLogic (at design-time) in the "General" properties page of any 3D camera of the model.
- "Camera" submenu - allows navigation to any camera defined on the current agent.
Window has several navigation modes:
NAVIGATION_FULL
- works only when the window isn't linked with cameraNAVIGATION_LIMITED_TO_Z_ABOVE_ZERO
- works only when the window isn't linked with cameraNAVIGATION_ROTATION_ONLY
NAVIGATION_NONE
- Author:
- AnyLogic North America, LLC https://anylogic.com
- See Also:
- Serialized Form
Modifier and Type | Field | Description |
---|---|---|
static final Navigation3DType | NAVIGATION_FULL |
Navigation is fully allowed
|
static final Navigation3DType | NAVIGATION_LIMITED_TO_Z_ABOVE_ZERO |
Navigation is only allowed above Z=0 plane
|
static final Navigation3DType | NAVIGATION_NONE |
Navigation is prohibited.
Default when window is linked with camera. |
static final Navigation3DType | NAVIGATION_ROTATION_ONLY |
Navigation mode where user is able to rotate view only.
Can be used when window is linked with camera. |
Constructor | Description |
---|---|
ShapeWindow3D |
Creates a (persistent) 3d scene window control.
|
Modifier and Type | Method | Description |
---|---|---|
Camera3D | createCamera() |
Returns new instance of
Camera3D having the most recent camera parameters set in setCamera functions.Due to technical reasons, this function doesn't reflect current position of the animation GUI navigation. |
void | executeAction() |
This method is internal and shouldn't be called by user.
it may be removed/renamed in future. |
double | getFarClippingDistance() |
Returns the "far-clipping" distance, which controls how much of the scene is shown (how far in depth is it visible)
|
void | setCamera |
Sets the 3D Window to the given camera (and doesn't follow
the camera)
|
void | setCamera |
Sets the 3D Window to the given camera and optionally starts following it.
|
void | setCamera |
Sets the 3D Window to the given camera and optionally starts following it.
|
void | setNavigationMode |
Sets the navigation mode (the freedom level of camera manipulation
using mouse).
|
SVGElement | updateSVGProperties |
This method is internal and shouldn't be called by user.
it may be removed/renamed in future. Updates SVG properties of the element that are then sent to the rendering client. |
action, clone, contains, getHeight, getPresentable, getWidth, isEnabled, postSVGShapeSpecificAttributes, randomPointInside, restoreOwner, setEnabled, setHeight, setValueToDefault, setWidth
canHandleClick, executeUserAction, findSVGElement, getDrawMode, getGroup, getLevel, getName, getRotation, getScaleX, getScaleY, getSVGId, getX, getY, isJava2DSwingPresentation, isPublic_xjal, isSVGPresentation, isVisible, onAggregatorVisibilityChanged, onClick, randomPointInside, removeSVGFromOwner, removeSVGImage, resetSVGState, setLevel, setPos, setPos, setPublic_xjal, setRotation, setScale, setScale, setScaleX, setScaleY, setVisible, setX, setY, updateDynamicProperties, updateDynamicPropertiesStructural
public static final Navigation3DType NAVIGATION_NONE
Navigation is prohibited.
Default when window is linked with camera.
Default when window is linked with camera.
public static final Navigation3DType NAVIGATION_FULL
Navigation is fully allowed
public static final Navigation3DType NAVIGATION_LIMITED_TO_Z_ABOVE_ZERO
Navigation is only allowed above Z=0 plane
public static final Navigation3DType NAVIGATION_ROTATION_ONLY
Navigation mode where user is able to rotate view only.
Can be used when window is linked with camera.
Can be used when window is linked with camera.
@AnyLogicInternalAPI public double getFarClippingDistance()
Returns the "far-clipping" distance, which controls how much of the scene is shown (how far in depth is it visible)
public void setCamera(Camera3D camera)
Sets the 3D Window to the given camera (and doesn't follow
the camera)
- Parameters:
camera
- the camera for the 3D Window
public void setCamera(Camera3D camera, boolean follow)
Sets the 3D Window to the given camera and optionally starts following it.
- Parameters:
camera
- the camera for the 3D Windowfollow
- iftrue
this window will track camera movements. 'Follow' mode supports only 2 navigation modes:NAVIGATION_NONE
andNAVIGATION_ROTATION_ONLY
. If navigation mode is not supported, it will be set toNAVIGATION_NONE
public void setCamera(Camera3D camera, boolean follow, long transitionTimeout)
Sets the 3D Window to the given camera and optionally starts following it.
- Parameters:
camera
- the camera for the 3D Windowfollow
- iftrue
this window will track camera movements. 'Follow' mode supports only 2 navigation modes:NAVIGATION_NONE
andNAVIGATION_ROTATION_ONLY
. If navigation mode is not supported, it will be set toNAVIGATION_NONE
transitionTimeout
- if non-zero, then the current camera position and orientation will evolve to the givencamera
during the given timeout of real milliseconds (i.e. not model-time units)
@AnyLogicInternalAPI public SVGElement updateSVGProperties(List<SVGCommand> output, ShapeDrawMode drawMode, boolean publicOnly, SVGElement owner, SVGElement elbehind)
Description copied from interface:
SVGElement
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
Updates SVG properties of the element that are then sent to the rendering client. If the element is not yet in the SVG scene, generates "C" command, if it is there, but some properties are out of date, generates "U" command. If SVG drawing of this element is not needed because of public only settings, or permanently not needed, or not supported yet, returns false and does nothing.
it may be removed/renamed in future.
Updates SVG properties of the element that are then sent to the rendering client. If the element is not yet in the SVG scene, generates "C" command, if it is there, but some properties are out of date, generates "U" command. If SVG drawing of this element is not needed because of public only settings, or permanently not needed, or not supported yet, returns false and does nothing.
- Specified by:
updateSVGProperties
in interfaceSVGElement
- Overrides:
updateSVGProperties
in classShape
- Parameters:
output
- the list of commands to add todrawMode
- TODOpublicOnly
- drawing context: if true, only shapes that are marked as public only are updatedowner
- the SVG element that serves as a container for this elementelbehind
- the SVG element behind this one, or null if none or if order is irrelevant- Returns:
- the actual owner this element has been added to or
null
if element is not drawn (e.g. drawing of this element is not needed because of public only settings, permanently not needed or not supported - hence SVG id is not set). The actual owner may differ from the givenowner
when the svg element is added to a different place (e.g. GIS map).
@AnyLogicLegacyAPI public Camera3D createCamera()
Returns new instance of
Due to technical reasons, this function doesn't reflect current position of the animation GUI navigation.
Camera3D
having the most recent camera parameters set in setCamera functions.Due to technical reasons, this function doesn't reflect current position of the animation GUI navigation.
- Returns:
- new instance on each call
@AnyLogicInternalAPI public void executeAction()
Description copied from class:
ShapeControl
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.
- Overrides:
executeAction
in classShapeControl