AnyLogic
Expand
Font size
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:
  • "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 may be locked with the camera - in this case the point of window follows the camera changes.
Window has several navigation modes:
Author:
AnyLogic North America, LLC https://anylogic.com
See Also:
Serialized Form

Nested Class Summary

Nested classes/interfaces inherited from class com.anylogic.engine.presentation.ShapeControl

ShapeControl.ValueType

Field Summary

Modifier and TypeFieldDescription
static final Navigation3DTypeNAVIGATION_FULL
Navigation is fully allowed
static final Navigation3DTypeNAVIGATION_LIMITED_TO_Z_ABOVE_ZERO
Navigation is only allowed above Z=0 plane
static final Navigation3DTypeNAVIGATION_NONE
Navigation is prohibited.
Default when window is linked with camera.
static final Navigation3DTypeNAVIGATION_ROTATION_ONLY
Navigation mode where user is able to rotate view only.
Can be used when window is linked with camera.

Fields inherited from class com.anylogic.engine.presentation.ShapeControl

TYPE_DOUBLE, TYPE_INT, TYPE_STRING

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

UNKNOWN_NAME

Constructor Summary

ConstructorDescription
ShapeWindow3D(Presentable p, boolean ispublic, double x, double y, double width, double height, Navigation3DType navigationMode, double farClippingDistance)
Creates a (persistent) 3d scene window control.

Method Summary

Modifier and TypeMethodDescription
Camera3DcreateCamera()
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.
voidexecuteAction()
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
doublegetFarClippingDistance()
Returns the "far-clipping" distance, which controls how much of the scene is shown (how far in depth is it visible)
voidsetCamera(Camera3D camera)
Sets the 3D Window to the given camera (and doesn't follow the camera)
voidsetCamera(Camera3D camera, boolean follow)
Sets the 3D Window to the given camera and optionally starts following it.
voidsetCamera(Camera3D camera, boolean follow, long transitionTimeout)
Sets the 3D Window to the given camera and optionally starts following it.
voidsetNavigationMode(Navigation3DType mode)
Sets the navigation mode (the freedom level of camera manipulation using mouse).

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

Field Details

Constructor Details

ShapeWindow3D

public ShapeWindow3D(Presentable p,
 boolean ispublic,
 double x,
 double y,
 double width,
 double height,
 Navigation3DType navigationMode,
 double farClippingDistance)
Creates a (persistent) 3d scene window control.
Parameters:
p - the presentable object owning this control
ispublic - if true, the control is visible on container's presentation
x - the x coordinate
y - the y coordinate
width - the width
height - the height
navigationMode - the navigation mode (the freedom level of camera manipulation using mouse). Supported modes are:

Method Details

getFarClippingDistance

@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)

setNavigationMode

public void setNavigationMode(Navigation3DType mode)
Sets the navigation mode (the freedom level of camera manipulation using mouse). Supported modes are: If the window is linked with camera (see setCamera(Camera3D, boolean)) and navigation mode isn't supported, the latter will be set to NAVIGATION_NONE
Parameters:
mode - the navigation mode

setCamera

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

setCamera

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 Window
follow - if true this window will track camera movements. 'Follow' mode supports only 2 navigation modes: NAVIGATION_NONE and NAVIGATION_ROTATION_ONLY. If navigation mode is not supported, it will be set to NAVIGATION_NONE

setCamera

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 Window
follow - if true this window will track camera movements. 'Follow' mode supports only 2 navigation modes: NAVIGATION_NONE and NAVIGATION_ROTATION_ONLY. If navigation mode is not supported, it will be set to NAVIGATION_NONE
transitionTimeout - if non-zero, then the current camera position and orientation will evolve to the given camera during the given timeout of real milliseconds (i.e. not model-time units)

createCamera

@AnyLogicLegacyAPI
public 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.
Returns:
new instance on each call

executeAction

@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.
Overrides:
executeAction in class ShapeControl