ReadonlyboundaryBoundary of the canvas in absolute browser window coordinates.
Format is [xmin, ymin, xwidth, ywidth].
ReadonlycameraManages the Camera for this View.
ReadonlycolorizedMap of currently colorized ViewObjects in this View.
Each ViewObject is mapped here by ViewObject.id.
True if this View has been destroyed.
ReadonlyedgesConfigures the appearance of edges belonging to ViewObject in this View.
ReadonlyhighlightedMap of currently highlighted ViewObjects in this View.
A ViewObject is highlighted when ViewObject.highlighted is true.
Each ViewObject is mapped here by ViewObject.id.
ReadonlyhighlightConfigures the highlighted appearance of ViewObjects in this View.
The HTML canvas.
ReadonlyidID of this View, unique within the Viewer.
ReadonlylayersMap of the all ViewLayers in this View.
Each ViewLayer is mapped here by ViewLayer.id.
ReadonlylightsMap of light sources in this View.
ReadonlylightsList of light sources in this View.
ReadonlylinesConfigures the appearance of lines belonging to ViewObjects in this View.
ReadonlyobjectsMap of the all ViewObjects in this View.
Each ViewObject is mapped here by ViewObject.id.
The View automatically ensures that there is a ViewObject here for each ViewObject in the Viewer
ReadonlyopacityMap of ViewObjects in this View whose opacity has been updated.
Each ViewObject is mapped here by ViewObject.id.
ReadonlypointsConfigures the appearance of point primitives belonging to ViewObjects in this View .
ReadonlyresolutionConfigures resolution scaling for this View.
ReadonlysaoConfigures Scalable Ambient Obscurance (SAO) for this View.
ReadonlysectionMap of SectionPlanes in this View.
Each SectionPlane is mapped here by SectionPlane.id.
ReadonlysectionList of SectionPlanes in this View.
ReadonlyselectedConfigures the appearance of ViewObjects in this View.
ReadonlyselectedMap of currently selected ViewObjects in this View.
A ViewObject is selected when ViewObject.selected is true.
Each ViewObject is mapped here by ViewObject.id.
ReadonlytexturingConfigures when textures are rendered for this View.
ReadonlytransparentIndicates if this View is transparent.
ReadonlyviewerThe Viewer to which this View belongs.
InternalviewThe tileIndex of this View in Viewer.viewList.
ReadonlyvisibleMap of the currently visible ViewObjects in this View.
A ViewObject is visible when ViewObject.visible is true.
Each ViewObject is mapped here by ViewObject.id.
ReadonlyxrayedMap of currently x-rayed ViewObjects in this View.
A ViewObject is x-rayed when ViewObject.xrayed is true.
Each ViewObject is mapped here by ViewObject.id.
ReadonlyxrayConfigures the X-rayed appearance of ViewObjects in this View.
Gets whether this View will automatically create ViewLayers on-demand as ViewerObjects are created.
Sets whether this View will automatically create ViewLayers on-demand as ViewerObjects are created.
When true (default), the View will automatically create ViewLayers as needed for each new
ViewObject.layerId encountered, including a "default" ViewLayer for ViewerObjects that have no
layerId. This "default" ViewLayer 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
SceneObjects that have a scene!SceneObject.layerId that matches the ID of a
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.
Default value is `true``.
The new value for atuoLayers
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 which rendering mode this View is in.
Default value is QualityRender.
Sets which rendering mode this View is in.
Default value is QualityRender.
Setting a View's rendering mode will activate whatever effects (eg. SAO, edges, canas scaling) are configured to be active in that mode, while deactivating all other effects.
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.
Destroys the DirLights, PointLights and AmbientLights in this View.
Destroys the SectionPlanes in this View.
Creates a ViewLayer in this View.
The ViewLayer is then registered in View.layers.
Fires !ViewerEvents.onViewLayerCreated | ViewerEvents.onViewLayerCreated event.
Since the ViewLayer is created explicitly by this method, the ViewLayer will persist until ViewLayer.destroy is called, or the View itself is destroyed. If a ViewLayer with the given ID already exists, the method returns that existing ViewLayer. The method also ensures that the existing ViewLayer likewise persists.
const layerResult = view.createLayer({
id: "myLayer",
autoDestroy: true,
});
if (!layerResult.ok) {
console.error(layerResult.error);
} else {
const viewLayer = layerResult.value;
console.log("ViewLayer created:", viewLayer.id);
}
Configuration parameters for the new ViewLayer.
A result containing the created ViewLayer on success, or an error message on failure.
Creates a SectionPlane in this View.
The SectionPlane is then registered in View.sectionPlanes.
If a SectionPlane with the given ID already exists, the method returns an error.
const sectionPlaneResult = view.createSectionPlane({
id: "mySectionPlane",
pos: [0, 0, 0],
dir: [1, 0, 0],
});
if (!sectionPlaneResult.ok) {
console.error(sectionPlaneResult.error);
} else {
const sectionPlane = sectionPlaneResult.value;
console.log("SectionPlane created:", sectionPlane.id);
}
Configuration parameters for the new SectionPlane.
A result containing the created SectionPlane on success, or an error message on failure.
Destroys this View.
Causes Viewer to fire a "viewDestroyed" event.
Sets the clippability of the given ViewObjects in this View.
Array of 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 ViewObject.collidable on the Objects with the given IDs.
Array of 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 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 ViewObject.culled on the Objects with the given IDs.
Array of 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 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 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 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 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 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 ViewObject.id values.
Whether or not to xray.
True if any ViewObjects were updated, else false if all updates were redundant and not applied.
Gets this View as JSON.
Iterates with a callback over the given ViewObjects in this View.
One or more ViewObject.id values.
Callback to execute on each ViewObject.
True if any ViewObjects were updated, else false if all updates were redundant and not applied.
An independent view within a Viewer, with its own canvas, Camera and object visual states.
See @xeokit/sdk/viewer for usage.