Readonly
autoWhether the View will automatically create ViewLayers on-demand as RendererObject | ViewerObjects are created.
When true
(default), the View will automatically create ViewLayers as needed for each new
RendererObject.layerId encountered, including a "default" ViewLayer for ViewerObjects that have no
layerId. This default setting therefore ensures that a ViewObject is created in the View for every SceneObject that is created.
If you set this false
, however, then the View will only create ViewObjects for RendererObject | ViewerObjects that have
a RendererObject.layerId that matches the ID of a @xeokit/viewer!ViewLayer that you have explicitly created previously with View.createLayer.
Setting this parameter false enables Views to contain only the ViewObjects that they actually need to show, i.e. to represent only ViewerObjects that they need to view. This enables a View to avoid wastefully creating and maintaining ViewObjects for ViewerObjects that it never needs to show.
Readonly
boundaryBoundary of the canvas in absolute browser window coordinates.
Format is [xmin, ymin, xwidth, ywidth]
.
Readonly
cameraManages the Camera for this View.
Readonly
colorizedMap of currently colorized ViewObjects in this View.
Each @xeokit/viewer!ViewObject is mapped here by @xeokit/viewer!ViewObject.id.
True once this Component has been destroyed.
Don't use this Component if this is true
.
Protected
dirtyReadonly
edgesConfigures the appearance of edges belonging to @xeokit/viewer!ViewObject in this View.
Readonly
highlightConfigures the highlighted appearance of ViewObjects in this View.
Readonly
highlightedMap of currently highlighted ViewObjects in this View.
A ViewObject is highlighted when @xeokit/viewer!ViewObject.highlighted is true.
Each @xeokit/viewer!ViewObject is mapped here by @xeokit/viewer!ViewObject.id.
The HTML canvas.
Unique ID of this Component.
Readonly
layersMap of the all @xeokit/viewer!ViewLayers in this View.
Each @xeokit/viewer!ViewLayer is mapped here by @xeokit/viewer!ViewLayer.id.
Readonly
lightsMap of light sources in this View.
Readonly
lightsList of light sources in this View.
Readonly
linesConfigures the appearance of lines belonging to ViewObjects in this View.
Readonly
metricsManages measurement units, origin and scale for this View.
Readonly
objectsMap of the all ViewObjects in this View.
Each @xeokit/viewer!ViewObject is mapped here by @xeokit/viewer!ViewObject.id.
The View automatically ensures that there is a @xeokit/viewer!ViewObject here for each RendererObject in the Viewer
Readonly
opacityMap of ViewObjects in this View whose opacity has been updated.
Each @xeokit/viewer!ViewObject is mapped here by @xeokit/viewer!ViewObject.id.
Readonly
pointsConfigures the appearance of point primitives belonging to ViewObjects in this View .
Readonly
resolutionConfigures resolution scaling for this View.
Readonly
saoConfigures Scalable Ambient Obscurance (SAO) for this View.
Readonly
sectionMap of SectionPlanes in this View.
Each SectionPlane is mapped here by SectionPlane.id.
Readonly
sectionList of SectionPlanes in this View.
Readonly
selectedConfigures the appearance of ViewObjects in this View.
Readonly
selectedMap of currently selected ViewObjects in this View.
A ViewObject is selected when @xeokit/viewer!ViewObject.selected is true.
Each @xeokit/viewer!ViewObject is mapped here by @xeokit/viewer!ViewObject.id.
Readonly
texturingConfigures when textures are rendered for this View.
Readonly
transparentIndicates if this View is transparent.
ID of this View, unique within the Viewer.
Readonly
viewerThe Viewer to which this View belongs.
Readonly
visibleMap of the currently visible ViewObjects in this View.
A ViewObject is visible when @xeokit/viewer!ViewObject.visible is true.
Each @xeokit/viewer!ViewObject is mapped here by @xeokit/viewer!ViewObject.id.
Readonly
xrayConfigures the X-rayed appearance of ViewObjects in this View.
Readonly
xrayedMap of currently x-rayed ViewObjects in this View.
A ViewObject is x-rayed when @xeokit/viewer!ViewObject.xrayed is true.
Each @xeokit/viewer!ViewObject is mapped here by @xeokit/viewer!ViewObject.id.
Gets the canvas clear color.
Default value is [1, 1, 1]
.
Sets the canvas clear color.
Default value is [1, 1, 1]
.
Gets whether the canvas clear color will be derived from AmbientLight or View#backgroundColor
when View#transparent is true
.
When View#transparent is true
and this is true
, then the canvas clear color will
be taken from the ambient light color.
When View#transparent is true
and this is false
, then the canvas clear color will
be taken from View#backgroundColor.
Default value is true
.
Sets if the canvas background color is derived from an AmbientLight.
This only has effect when the canvas is not transparent. When not enabled, the background color will be the canvas element's HTML/CSS background color.
Default value is true
.
Gets the IDs of the colorized ViewObjects in this View.
Gets the gamma factor.
Gets the IDs of the highlighted ViewObjects in this View.
Gets the number of colorized ViewObjects in this View.
Gets the number of highlighted ViewObjects in this View.
Gets the number of ViewObjects in this View.
Gets the number of ViewObjects in this View that have updated opacities.
Gets the number of selected ViewObjects in this View.
Gets the number of visible ViewObjects in this View.
Gets the number of X-rayed ViewObjects in this View.
Gets the IDs of the ViewObjects in this View.
Gets the IDs of the ViewObjects in this View that have updated opacities.
Gets whether quality rendering is enabled for this View.
Default is false
.
Sets whether quality rendering is enabled for this View.
Default is false
.
Gets which rendering mode this View is in.
Supported rendering modes are:
Default value is QualityRender.
Gets the IDs of the selected ViewObjects in this View.
Gets the IDs of the visible ViewObjects in this View.
Gets the IDs of the X-rayed ViewObjects in this View.
Protected
cleanProtected
cleanDestroys the SectionPlanes in this View.
Creates a @xeokit/viewer!ViewLayer in this View.
The ViewLayer is then registered in View.layers.
Since the ViewLayer is created explicitly by this method, the ViewLayer will persist until @xeokit/viewer!ViewLayer.destroy is called, or the @xeokit/viewer!View itself is destroyed. If a ViewLayer with the given ID already exists, then the method returns that existing ViewLayer. The method will also ensure that the existing ViewLayer likewise persists.
The new ViewLayer
Creates a SectionPlane in this View.
Destroys this View.
Causes Viewer to fire a "viewDestroyed" event.
Protected
errorCaptures a snapshot image of this View.
Optional
snapshotResult: SnapshotResultProtected
logAttempts to pick a ViewObject in this View.
Picking parameters.
Optional
pickResult: PickResultPicking results, when caller wants to manage them externally.
Protected
setSets the clippability of the given ViewObjects in this View.
Array of @xeokit/viewer!ViewObject.id values.
Whether or not to set clippable.
True if any ViewObjects were updated, else false if all updates were redundant and not applied.
Updates the collidability of the given ViewObjects in this View.
Updates @xeokit/viewer!ViewObject.collidable on the Objects with the given IDs.
Array of @xeokit/viewer!ViewObject.id values.
Whether or not to cull.
True if any ViewObjects were updated, else false if all updates were redundant and not applied.
Colorizes the given ViewObjects in this View.
One or more @xeokit/viewer!ViewObject.id values.
RGB colorize factors in range [0..1,0..1,0..1]
.
True if any ViewObjects changed opacity, else false if all updates were redundant and not applied.
Updates the culled status of the given ViewObjects in this View.
Updates @xeokit/viewer!ViewObject.culled on the Objects with the given IDs.
Array of @xeokit/viewer!ViewObject.id values.
Whether or not to cull.
True if any ViewObjects were updated, else false if all updates were redundant and not applied.
Highlights or un-highlights the given ViewObjects in this View.
One or more @xeokit/viewer!ViewObject.id values.
Whether or not to highlight.
True if any ViewObjects were updated, else false if all updates were redundant and not applied.
Sets the opacity of the given ViewObjects in this View.
One or more @xeokit/viewer!ViewObject.id values.
Opacity factor in range [0..1]
.
True if any ViewObjects changed opacity, else false if all updates were redundant and not applied.
Sets the pickability of the given ViewObjects in this View.
Array of @xeokit/viewer!ViewObject.id values.
Whether or not to set pickable.
True if any ViewObjects were updated, else false if all updates were redundant and not applied.
Selects or deselects the given ViewObjects in this View.
One or more @xeokit/viewer!ViewObject.id values.
Whether or not to select.
True if any ViewObjects were updated, else false if all updates were redundant and not applied.
Updates the visibility of the given ViewObjects in this View.
Array of @xeokit/viewer!ViewObject.id values.
Whether or not to cull.
True if any ViewObjects were updated, else false if all updates were redundant and not applied.
Applies or removes X-ray rendering for the given ViewObjects in this View.
One or more @xeokit/viewer!ViewObject.id values.
Whether or not to xray.
True if any ViewObjects were updated, else false if all updates were redundant and not applied.
Sets which rendering mode this View is in.
Supported rendering modes are:
Default value is QualityRender.
The rendering mode
Protected
warnIterates with a callback over the given ViewObjects in this View.
One or more @xeokit/viewer!ViewObject.id values.
Callback to execute on each @xeokit/viewer!ViewObject.
True if any ViewObjects were updated, else false if all updates were redundant and not applied.
Readonly
onEmits an event each time the canvas boundary changes.
Emits an event when the Component has been destroyed.
Readonly
onEmits an event each time a @xeokit/viewer!ViewLayer is created in this View.
Layers are created explicitly with View.createLayer, or implicitly with View.createModel and CreateModelParams.layerId.
Readonly
onEmits an event each time a @xeokit/viewer!ViewLayer in this View is destroyed.
ViewLayers are destroyed explicitly with @xeokit/viewer!ViewLayer.destroy, or implicitly when they become empty and View.autoLayers is false.
Readonly
onEmits an event each time a @xeokit/viewer!ViewObject is created in this View.
Readonly
onEmits an event each time a @xeokit/viewer!ViewObject is destroyed in this View.
Readonly
onEmits an event each time the visibility of a @xeokit/viewer!ViewObject changes in this View.
ViewObjects are shown and hidden with View.setObjectsVisible, @xeokit/viewer!ViewLayer.setObjectsVisible or @xeokit/viewer!ViewObject.visible.
Readonly
onEmits an event each time the X-ray state of a @xeokit/viewer!ViewObject changes in this View.
ViewObjects are X-rayed with View.setObjectsXRayed, @xeokit/viewer!ViewLayer.setObjectsXRayed or @xeokit/viewer!ViewObject.xrayed.
Readonly
onEmits an event each time a SectionPlane is created in this View.
Readonly
onEmits an event each time a SectionPlane in this View is destroyed.
Readonly
onEmits an event each time a snapshot is completed with View.getSnapshot.
Readonly
onEmits an event each time a snapshot is initiated with View.getSnapshot.
An independent view within a Viewer, with its own Canvas, Camera and object visual states.
See @xeokit/viewer for usage.
Overview
A View is an independently-configurable view of the objects in a Viewer, with its own HTML canvas, camera, light sources, object states, slicing planes etc.
A View automatically contains a ViewObject for each SceneObject in the Viewer's Scene. Each ViewObject functions as a sort of proxy through which we control the appearance of its SceneObject in the View. (show/hide/highlight etc.) within the View.
Using Views, we can essentially have multiple canvases viewing the same model, each canvas perhaps showing a different subset of the objects, with different visual effects, camera position etc.
Quickstart
Examples
Create a view in a given canvas, with three objects visible and a couple of object X-rayed (rendered translucent):
Create a second view, using a different canvas, that shows two objects visible, with one of them highlighted: