Class: RenderManagerBase
Class: RenderManagerBase
Base class for all rendering managers.
Hierarchy
EventTarget
↳
RenderManagerBase
Implements
ViewpointState
Constructors
constructor
• new RenderManagerBase(name
, sceneManager
, metaManager?
): RenderManagerBase
Parameters
Name | Type | Description |
---|---|---|
name | string | Name of the renderer. Must be unique. |
sceneManager | SceneManager | SceneManager for renderer. |
metaManager? | MetaManager | Optional MetaManager. Used for possible additional operations with metadata. |
Returns
Overrides
EventTarget.constructor
Properties
ac
• ac: AbortController
Abort controller. Use to control external event listeners by render manager.
camera
• camera: PerspectiveCamera
| OrthographicCamera
Main renderer camera
cameraTarget
• cameraTarget: Vector3
Target point for viewer camera. Need for various transformation actions like orbit.
cubeControl
• cubeControl: CubeControl
CubeControl instance.
defaultPixelRatio
• defaultPixelRatio: number
Default device pixel ratio.
extMan
• Readonly
extMan: ExtensionsManager
ExtensionsManager instance for renderer.
helpersScene
• helpersScene: Scene
Scene for additional 3D graphic. Always draw above main scene without Z sorting. Can be used by extensions.
hoveredElNum
• hoveredElNum: number
Hovered element number.
inactiveColor
• inactiveColor: ColorRepresentation
Color for inactive elements.
inactiveContrast
• inactiveContrast: number
Inactive layer contrast coefficient (more is high contrast). Must be greater than zero.
inactiveDarkness
• inactiveDarkness: number
Inactive layer darkness coefficient (more is high darkness).
inactiveFrontOpacity
• inactiveFrontOpacity: number
Inactive layer front opacity coefficient (more is high opacity`).
interactivePixelRatio
• interactivePixelRatio: number
Pixel ratio for interactive render mode (with navigation).
isInteractive
• isInteractive: boolean
Is interactive mode (with simple graphic) in progress.
isMultiselectClick
• isMultiselectClick: boolean
If enabled then each click action on the element adds it to selection set.
isMultiselectTouch
• isMultiselectTouch: boolean
If enabled then each touch action on the element adds it to selection set.
isNavigation
• isNavigation: boolean
Is navigation in progress.
keymapTools
• keymapTools: KeymapTools
Tools for generate and restore viewpoint state.
labelTools
• labelTools: LabelTools
Tools for creating and displaying labels in 3d space.
metaManager
• metaManager: MetaManager
MetaManager instance.
mouse
• mouse: Vector2
Mouse coordinates with center origin and boundary range from -1 to 1.
mousePointer
• mousePointer: Vector2
Mouse coordinates with screen origin and screen boundary.
name
• Readonly
name: string
Unique name of the manager.
picker
• picker: Picker
Points on faces and vertices visual picker.
renderer
• renderer: WebGLRenderer
WebGLRenderer instance.
sceneManager
• sceneManager: SceneManager
SceneManager instance for renderer.
selectionColor
• selectionColor: ColorRepresentation
Color for selection layer.
selectionOpacity
• selectionOpacity: number
Opacity for selection layer.
state
• Abstract
state: RenderManagerBaseState
State with settings for RenderManagerBase.
stateMat
• Protected
stateMat: ShaderMaterial
Shader for highlighting hovered and selected elements.
staticPixelRatio
• staticPixelRatio: number
Pixel ratio for static render mode (without navigation).
subScene
• subScene: Scene
Scene for additional 3D graphic. Can be used by extensions.
viewerElement
• viewerElement: HTMLElement
DOM Element with attached viewer.
viewpointTools
• viewpointTools: ViewpointTools
Tools for generate and restore viewpoint state.
Methods
addAutoEventListener
▸ addAutoEventListener(eventType
, eventListener
): void
Add event listener with automatic dispose.
Parameters
Name | Type | Description |
---|---|---|
eventType | RenderEvents | event type. |
eventListener | EventListenerOrEventListenerObject | event listener. |
Returns
void
getBackgroundColor
▸ getBackgroundColor(): ColorRepresentation
Get background color on renderer area.
Returns
ColorRepresentation
getCameraZoomBySceneBounds
▸ getCameraZoomBySceneBounds(boundsCoef?
): number
Get zoom value for scene bounds with given bounds Coefficient.
Parameters
Name | Type | Description |
---|---|---|
boundsCoef? | number | scale coefficient for scene bounds. |
Returns
number
getContinuesUpdate
▸ getContinuesUpdate(): boolean
Get the continuous update mode.
Returns
boolean
init
▸ init(domElementId?
, createToolbar?
): void
Init renderer for chosen DOM element id.
Parameters
Name | Type | Description |
---|---|---|
domElementId? | string | DOM element id for attaching renderer. |
createToolbar? | boolean | create toolbar UI or not. |
Returns
void
requestUpdate
▸ requestUpdate(forceUpdateRender
): void
Make request for new animation iteration or/and render new frame.
Parameters
Name | Type | Description |
---|---|---|
forceUpdateRender | boolean | is we need to render new frame. |
Returns
void
setBackgroundColor
▸ setBackgroundColor(color
): void
Set background color on renderer area.
Parameters
Name | Type |
---|---|
color | ColorRepresentation |
Returns
void
setCameraFov
▸ setCameraFov(fov
): void
Sets camera field of view.
Parameters
Name | Type | Description |
---|---|---|
fov | number | field of view. |
Returns
void
setCameraMode
▸ setCameraMode(perspective
): boolean
Sets camera mode (perspective or orthogonal).
Parameters
Name | Type | Description |
---|---|---|
perspective | boolean | perspective mode enabled or not. |
Returns
boolean
Actual camera mode after applying.
setContinuesUpdate
▸ setContinuesUpdate(continuesUpdate
): void
Set the continuous update mode. Used for any animation that requires continuous frame refresh, such as flying.
Parameters
Name | Type | Description |
---|---|---|
continuesUpdate | boolean | continues update mode flag. |
Returns
void
setManualNavigation
▸ setManualNavigation(manualNavigation
): void
Set navigation hooks state (if manual navigation is on then call of "updated" navigation hook will be ignored).
Parameters
Name | Type |
---|---|
manualNavigation | boolean |
Returns
void
setSelectionLock
▸ setSelectionLock(selectionLocked
): void
Set selection and hover lock mode.
Parameters
Name | Type | Description |
---|---|---|
selectionLocked | boolean | selection lock flag. |
Returns
void
updateHover
▸ updateHover(elNum?
): void
Updates hover state visual on render canvas.
Parameters
Name | Type | Description |
---|---|---|
elNum? | number | Element number for setting hover state. |
Returns
void
zoomCameraToBox
▸ zoomCameraToBox(box
, fitRatio?
): void
Zoom camera to given boundary box.
Parameters
Name | Type | Description |
---|---|---|
box | Box3 | boundary box. |
fitRatio? | number | scale coefficient for zoom. |
Returns
void
zoomCameraToElements
▸ zoomCameraToElements(elNums
, fitRatio?
): void
Zoom camera to boundaries by given element numbers.
Parameters
Name | Type | Description |
---|---|---|
elNums | number [] | element numbers. |
fitRatio? | number | scale coefficient for zoom. |
Returns
void
zoomCameraToSelection
▸ zoomCameraToSelection(fitRatio?
): void
Zoom camera to scene boundaries if no elements selected or zoom to selected elements boundaries.
Parameters
Name | Type | Description |
---|---|---|
fitRatio? | number | scale coefficient for zoom. |
Returns
void
Hooks
navigationChanged
▸ navigationChanged(): void
Hook for changing controller navigation. Called by current controller extensions "updated" hook. Also dispatch "navchange" viewer event
Returns
void
navigationEnded
▸ navigationEnded(): void
Hook for ending controller navigation. Called by current controller extension. Also dispatch "navstart" viewer event
Returns
void
navigationStarted
▸ navigationStarted(): void
Hook for starting controller navigation. Called by current controller extension. Also dispatch "navstart" viewer event.
Returns
void