API / geotoolkit3d / Plot / Plot

Namespace: Plot

geotoolkit3d.Plot.Plot

Table of contents

Type Aliases

Contents

Type Aliases

AdvancedRenderingOptions

Ƭ AdvancedRenderingOptions: BaseRenderPassOptions & MainRenderPassOptions & SSAARenderOptions & DepthPeelingPassOptions & OutlinePassOptions & { antialias?: AntialiasOptions ; enabled?: boolean ; highlight?: { highlightedges?: boolean ; mode?: HighlightType } ; performancemetrics?: { targetcpuframetime?: number ; targetgpuframetime?: number ; updateframeperiod?: number } ; qualityrenderpass?: { enable?: boolean ; timeout?: number } }


AmbientLightingOptions

Ƭ AmbientLightingOptions: Object

Type declaration

NameTypeDescription
color?ColorRepresentationThe color of the ambient light.
enabled?booleanDetermines if the ambient light is enabled

CameraLightingOptions

Ƭ CameraLightingOptions: Object

Type declaration

NameTypeDescription
color?stringThe color of the camera light.
enabled?booleanSet to true to enable camera lighting.
intensity?numberThe intensity of the camera light.
Default value is Math.PI.

CameraOptions

Ƭ CameraOptions: Object

Type declaration

NameTypeDescription
autofar?booleanTrue if let the plot compute the ideal far plane that fit the current modellimits and provide the best accuracy.
The actual far plane value will be returned in 'far' when getOptions.
Default value is true.
When 'autofar' is set to false, please define 'far'. Otherwise, Plot will automatically set default value 100000 for 'far'.
When 'far' and 'autofar' are both defined, 'autofar' will have priority.
autonear?booleanTrue if let the plot compute the ideal near plane that fit the current modellimits and provide the best accuracy.
Default value is true.
When 'autonear' is set to false, please define 'near'. Otherwise, Plot will automatically set default value 1 for 'near'.
When 'near' and 'autonear' are both defined, 'autonear' will have priority.
controller?ControllerOptionsThe camera controller configuration
far?numberThe frustum far clipping plane. (By default is computed automatically)
Define the distance in front of the camera before objects stops rendering (visible objects are rendered between the near and far planes).
Generally, users want the near and far planes to be as close to each other as possible to ensure Z-buffer accuracy, while maintaining all objects on screen visible.
The toolkit will automatically compute this far value based on the objects on screen, but it can be set manually with this option.
Setting this option, or setting the option 'autofar' to false, will both disable automatic far calculation (for advanced users).
For more information about near/far planes, see this OpenGL tutorial.
fov?numberThe field-of-view angle in degrees (applies only to perspective camera)
lookat?Vector3The coordinates of the point the camera will look at
minfar?numberwhen set to Auto clipping planes (autofar is true or far is 'auto'), this is the minimum value that will be set on the far plane.
Default value is 2.
minnear?numberwhen set to auto clipping planes (autonear is true or near is 'auto'), this is the minimum value that will be set on the near plane.
Default value is 1, minimum valid value is 0.001 (0 will cause rendering issues).
near?numberThe frustum near clipping plane. (By default is computed automatically)
Define the distance in front of the camera before objects start rendering (visible objects are rendered between the near and far planes).
Generally, users want the near and far planes to be as close to each other as possible to ensure Z-buffer accuracy, while maintaining all objects on screen visible.
The toolkit will automatically compute this near value based on the objects on screen, but it can be set manually with this option.
Setting this option, or setting the option 'autonear' to false, will both disable automatic near calculation (for advanced users).
For more information about near/far planes, see this OpenGL tutorial.
nearfarscale?numberThis option can be used to maintain a minimum near/far ratio, to help with depth accuracy.
Because of how floats variables handle precision, there can be a loss of accuracy (Z-fighting, clipping artifacts) when the near plane is very close and the far plane is very far to the camera. For this reason, the near distance can be automatically adjusted to enforce a minimum ratio.
Example, if near=0.01 and far=200000, the ratio is 0.01 / 200 000 = 20 000 000, this is too high and could lead to accuracy issues.)
By setting a nearfarscale ratio of 10000 (a recommended value), the above example near would be increased from 0.01 to 20.0, and would ensure accurate depth in the scene.
This adjustment can be disabled by setting the nearfarscale to 0.
Default value is 10000. If using linear depth buffer, the default value is 1000.
orthoresize?OrthographicResizeModeThe way a plot handles resize when in Orthographic mode
position?Vector3The location of the camera in the scene
type?CameraTypeThe camera type
up?Vector3The camera 'up' direction (or camera roll). When moving the camera, this control where the camera 'up' is relative to the scene axes. This do not affect the camera orientation, but define the "roll" axis.
Default is +Z (0, 0, +1).

CompassOptions

Ƭ CompassOptions: Object

Type declaration

NameTypeDescription
canvas?HTMLElementAn optional canvas to render the compass to
container?HTMLElementAn optional container for the default compass, if not specified one will be created. Note that in order to be correctly positioned, this container requires the given container to have a 'position' set.
enabled?booleanflag to create the compass canvas.
renderer?{ parameters?: WebGLRendererParameters }renderer options for the compass
renderer.parameters?WebGLRendererParametersrenderer parameters for the compass

ControllerClass

Ƭ ControllerClass: (options: { camera?: PerspectiveCamera | OrthographicCamera ; lookat?: Vector3 ; plot?: Plot ; position?: Vector3 }) => AbstractController

Type declaration

new ControllerClass(options): AbstractController

Parameters
Name Type
optionsObject
Optional options.cameraPerspectiveCamera | OrthographicCamera
Optional options.lookatVector3
Optional options.plotPlot
Optional options.positionVector3
Returns

AbstractController


ControllerOptions

Ƭ ControllerOptions: Object

Type declaration

NameTypeDescription
autorotate?booleanSet to true to automatically rotate around object. (only supports OrbitController)
If the controller is changed, autorotate will be set to false (unless specified otherwise).
options?OptionsThe controller options. Please refer to the related Controller implementation for the complete list of options. For TypeScript compliance, this field might need a type cast, ex:
Example ts 'options': { 'pointerlock': true // Not an AbstractController option } as FirstPersonController.Options
type?CameraControllerType | ControllerClassThe controller to be used to change the camera location.

EventArgs

Ƭ EventArgs<T>: Object

Type parameters

Name
T

Type declaration

NameType
argsT
sourceSource

EventMap

Ƭ EventMap: EventMap & { afterrender: void ; animation: void ; beforerender: void ; camera: void ; duringrender: void ; fastrendering: void ; invalidate: void ; modellimits: void ; qualityrendering: void ; remove: EventArgs<ThreeObject3D | ThreeObject3D[]> ; rendererror: void }


FilterCallback

Ƭ FilterCallback: (o: ThreeObject3D) => boolean

Type declaration

▸ (o): boolean

Parameters
Name Type
oThreeObject3D
Returns

boolean


Options

Ƭ Options: OptionsBase & { applyorigintranslation?: boolean ; autoupdate?: boolean ; autoupdateinterval?: number ; autoupdatemodellimits?: boolean ; container?: HTMLElement }

The Plot constructor options.


OptionsBase

Ƭ OptionsBase: Object

Options accepted by Plot.setOptions

Type declaration

NameTypeDescription
advancedrendering?AdvancedRenderingOptionsThe advanced rendering options.
ambientlighting?AmbientLightingOptionsAmbient lighting options
camera?CameraOptionsThe camera options
cameralighting?CameraLightingOptionsThe camera lighting options
compass?CompassOptionsThe default compass options.
debug?{ enforcematerialdepthwrite?: boolean ; objectboundaries?: { excludegrid?: boolean ; filter?: FilterCallback ; showobjectbboxes?: boolean ; showobjectsphere?: boolean } }Options for debugging
debug.enforcematerialdepthwrite?booleanFlag for enforcing materials' depthWrite to be enabled Materials usually should write to the depthBuffer when rendering. Some 3D engines can use transparent materials which doesn't write to the depthBuffer, but the Toolkit does not work this way.
This check make sure all materials are writing to the depthBuffer, for correct rendering. Default is true.
debug.objectboundaries?{ excludegrid?: boolean ; filter?: FilterCallback ; showobjectbboxes?: boolean ; showobjectsphere?: boolean }Debug options related to the visualization of the scene objects boundaries (bounding boxes and spheres).
debug.objectboundaries.excludegrid?booleanIf true, the debug visualisation of the bounding boxes and spheres for graduated grids in the scene (IndexGrid, Grid, PolarGrid) will not be drawn.
Default is true.
debug.objectboundaries.filter?FilterCallbackA filter function to ignore some nodes if callback returns false.
Default is null.
debug.objectboundaries.showobjectbboxes?booleanShow the world bounding boxes of the objects in the plot scene. Default is false.
debug.objectboundaries.showobjectsphere?booleanShow the world bounding sphere of the objects in the plot scene. Default is false.
modellimits?Box3The modellimits, necessary if autoupdatemodellimits is not enabled. Should be the boundingbox of the scene.
picking?PickingOptionsPicking cache settings.
postprocessing?PostProcessingOptionsThe advanced rendering options. Deprecated since 4.1, please use advancedrendering instead. These options have been reworked in 4.1 to be cleaner and more consistent. Because of the amount of change, it is advised to verify your Plot options match the API.
renderer?RendererOptions & { devicepixelratio?: number ; parameters?: WebGLRendererParameters & { logarithmicDepthBuffer?: boolean ; reverseDepthBuffer?: boolean } }The renderer configuration
scale?Vector3The global scale to be applied to the scene graph. This change the relation between user coordinates and world coordinates
stats?booleanFlag for performance tools (frame rate and memory), default false.
When stats is enabled, the plot will perform continuous rendering, otherwise, the plot will perform default lazy rendering.
statspanels?StatsPanelOptionsFlag for displaying stats panels when stats is enabled. By default, when stats enabled, all panels will be displayed.
translation?Vector3This position becomes the effective origin for the scene for scaling purposes.

PerformanceMetrics

Ƭ PerformanceMetrics: Object

Performance metrics:
We measure performance information by looking at both the CPU and the GPU rendering/update time.
To maintain a target framerate, the corresponding time spend on each frame (the frametime) must be kept within limits.
Example: On standard monitors, maximum refresh rate is 60 FPS (frame per seconds), this is (1/60) ~16.6ms per frame. If the frametime is <16.6ms it will be very fluid.
If the frametime is >50ms (~20 FPS) it will start to feel very sluggish.

In most cases, CPU and GPU times are asynchronous, meaning while the GPU renders, the CPU can continue working on other tasks and even prepare the next frame.
This means, for example, to maintain a steady 60 FPS, the time spent in each frame in GPU render must be <16.6ms AND the time spend in CPU update must be <16.6ms too.
If one of them is too slow, the framerate will be affected. For this reason, a balance between CPU and GPU cost must be achieved when the scene is complex or when the hardware is not powerful enough.

Type declaration

NameTypeDescription
averagecpuframetimenumberThe average CPU frametime (the time the CPU spend to render a frame) over the period since the last performance metric update.
averagegpuframetimenumber | nullThe average GPU frametime (the time the GPU spend to render a frame) over the period since the last performance metric update.
Will not be available on devices not support EXT_disjoint_timer_query_webgl2.
User can check if GPU performance metrics is supported by Plot.isGPUPerformanceSupported
cpuframetimesnumber[]The array of individual CPU frametimes (the time the CPU spend to render a frame).
The number of frames to log can be defined by Plot option performancemetrics.updateframeperiod.
gpuframetimesnumber[] | nullThe array of individual GPU frametimes (the time the GPU spend to render a frame).
The number of frames to log can be defined by Plot option performancemetrics.updateframeperiod.
Will not be available on devices not support EXT_disjoint_timer_query_webgl2.
User can check if GPU performance metrics is supported by Plot.isGPUPerformanceSupported
targetcpuframetimenumberCurrent target CPU frametime set by Plot option performancemetrics.targetcpuframetime.
targetgpuframetimenumberCurrent target GPU frametime set by Plot option performancemetrics.targetgpuframetime.

PickingOptions

Ƭ PickingOptions: Object

Type declaration

NameTypeDescription
cachetimelimit?numberThe lifespan of the picking cache in milliseconds, after which the picking result is automatically invalidated.
Default is 33ms (the duration of a frame when rendering at 30FPS).
usecache?booleanTrue to enable the picking cache system. Default is true.
Picking cache can save costly picking calculations by returning the cached picking result when conditions are met:
  • -two or more consecutive picking are done in very short timespan, configured by 'cachetimelimit'.
  • -consecutive picking settings are identical to cached picking result: pick origin (caller), pick diameter, cursor position.
Use cases:
On view with multiple tools, or with high refresh rate, multiple pickings can be requested in a very short amount of time. Because picking is a costly process, involving offscreen-rendering all objects several time for each picking, this can dramatically increase power consumption or induce performance loss when unnecessary picking are requested.

PostProcessingOptions

Ƭ PostProcessingOptions: AdvancedRenderingOptions


RendererOptions

Ƭ RendererOptions: Object

Type declaration

NameTypeDescription
clearcolor?ColorRepresentationThe renderer clearcolor color
clearcoloralpha?numberThe renderer clearcolor alpha value (0,1)

SceneBoundingBoxOptions

Ƭ SceneBoundingBoxOptions: Object

Options for Plot.getSceneBoundingBox

Type declaration

NameTypeDescription
coordinate?CoordinateThe coordinate space of the return bounding box.
Default value is Coordinate.Business.
filter?FilterCallbackA filter function to ignore some nodes if callback returns false.
Default is null.
traversechildren?booleangets the bounding box that includes grid sprites and children of objects

StatsPanelOptions

Ƭ StatsPanelOptions: Object

Stats Panel Options
When Plot option.stats is enabled, user can further configure the visibility of each performance metric panel.

Type declaration

NameTypeDescription
positionoffset?{ left?: number ; top?: number }Optional offset to manually position the panel using absolute positioning.
Values represent pixel offsets from the top-left corner of the canvas.
positionoffset.left?numberDistance in pixels from the left edge.
Default is 0.
positionoffset.top?numberDistance in pixels from the top edge.
Default is 0.
showcputime?booleanShow CPU Frametime panel, default true.
showframepersecond?booleanShow FPS panel, default true.
showgputime?booleanShow GPU Frametime panel, default true.
showheapmemory?booleanShow heap memory panel, default true.