AnyLogic
Expand
Font size
All Implemented Interfaces:
com.anylogic.engine.internal.Child, Locatable2D, AggregatableAnimationElement, HasLevel, LevelElement, SVGElement, java.io.Serializable, java.lang.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

Fields 
static Navigation3DType NAVIGATION_FULL
Navigation is fully allowed
static Navigation3DType NAVIGATION_LIMITED_TO_Z_ABOVE_ZERO
Navigation is only allowed above Z=0 plane
static Navigation3DType NAVIGATION_NONE
Navigation is prohibited.
Default when window is linked with camera.
static Navigation3DType NAVIGATION_ROTATION_ONLY
Navigation mode where user is able to rotate view only.
Can be used when window is linked with camera.
Modifier and Type Field Description

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

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

Method Summary

All Methods Instance Methods Concrete Methods 
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​(Camera3D camera)
Sets the 3D Window to the given camera (and doesn't follow the camera)
void setCamera​(Camera3D camera, boolean follow)
Sets the 3D Window to the given camera and optionally starts following it.
void setCamera​(Camera3D camera, boolean follow, long transitionTimeout)
Sets the 3D Window to the given camera and optionally starts following it.
void setNavigationMode​(Navigation3DType mode)
Sets the navigation mode (the freedom level of camera manipulation using mouse).
Modifier and Type Method Description

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

action, clone, contains, getHeight, getPresentable, getWidth, isEnabled, postSVGShapeSpecificAttributes, randomPointInside, restoreOwner, setEnabled, setHeight, setValueToDefault, setWidth

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

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, 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

Field Detail

public static final Navigation3DType NAVIGATION_NONE
Navigation is prohibited.
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.

Constructor Detail

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 Detail

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