# View

class `cee.``View`()

  A View represents a viewport where you can show models and overlay items.

  A view has a collection of models that are shown in the view. You add a model to a view with the `addModel` function and remove it with the `removeModel` function.

  You can access the `Camera` from the View with the `camera` property. The camera can be used to manually control the view point, projection and other view related settings.

  A viewer can have one or more views. The views can operate independently or be set up for synchronized viewing. Changes to a model object shared between multiple views will be reflected in all views. The `MultipleViews` example project shows how you can create, manage, and synchronize multiple views.

  You can manage overlay items (legends, text boxes, navigation cube, etc) with the `overlay` object.

Accessors

- `ambientOcclusion`
- `background`
- `camera`
- `clipping`
- `haloHighlightColor`
- `modelCount`
- `name`
- `navigation`
- `nonHighlightedDimFactor`
- `operators`
- `overlay`
- `ownerViewer`

Methods

- `addModel`
- `getBoundingBox`
- `getIndexOfModel`
- `getModelArray`
- `getModelAt`
- `getRayThroughPoint`
- `rayIntersect`
- `removeAllModels`
- `removeModel`
- `removeModelAt`
- `requestRedraw`
- `setViewport`

## Accessors

`View.``ambientOcclusion`()

  The ambient occlusion configuration object for the view

  Return type: | AmbientOcclusion

`View.``background`()

  The background config of the view

  Return type: | Background

`View.``camera`()

  The `Camera` used in the View.

  The camera can be used to specify the View’s viewpoint, orientation, direction, projection, clipping, and other viewport related properties.

  Note:

  This returns a reference to the real object, not a copy, so any changes to the returned object will be applied to the 3D view.

  Return type: | Camera

`View.``clipping`()

  The clipping controller for the view

  Return type: | Clipping

`View.``haloHighlightColor`()

  The color used to draw the halo around highlighted parts in the view.

  Return type: | Color3Like

`View.``haloHighlightColor`(highlightColor)

  Arguments: | highlightColor (`Color3Like`) – None
  Return type: | void

`View.``modelCount`()

  The number of models in the view.

  Return type: | number

`View.``name`()

  The name of the view (used for debugging)

  Return type: | string

`View.``name`(name)

  Arguments: | name (`string`) – None
  Return type: | void

`View.``navigation`()

  Deprecated: |
  Return type: | Navigation

`View.``nonHighlightedDimFactor`()

  The amount to dim the areas of the screen that does not contain highlighted parts. Default value is 0.5. Setting a value of 0 disables dimming.

  Return type: | number

`View.``nonHighlightedDimFactor`(factor)

  Arguments: | factor (`number`) – None
  Return type: | void

`View.``operators`()

  The operator stack for the view.

  Return type: | OperatorStack

`View.``overlay`()

  The 2d overlay controller for the view.

  Return type: | Overlay

`View.``ownerViewer`()

  The owner `Viewer`.

  A View can only be in one Viewer. The Viewer creates and manages the View.

  Return type: | Viewer

## Methods

### addModel

`View.``addModel`(model)

  Arguments: | model (`Model`) – None

  Adds a model to the view.

  While a model can be shown in any number of views, it can only be added to a particular view once.

  Return type: | void

### getBoundingBox

`View.``getBoundingBox`([modelBoundingBoxOptions])

  Arguments: | modelBoundingBoxOptions (`ModelBoundingBoxOptions`) – optional None

  Returns the combined bounding box of all models in the view

  See `Model.getBoundingBox` and `ModelBoundingBoxOptions` for more information on how the bounding box is calculated and what options are available.

  Return type: | BoundingBox

### getIndexOfModel

`View.``getIndexOfModel`(model)

  Arguments: | model (`Model`) – None

  Returns the zero-based index of the given model

  Return type: | number

### getModelArray

`View.``getModelArray`()

  Returns a read only array with all models in the view

  Return type: | unknown

### getModelAt

`View.``getModelAt`(index)

  Arguments: | index (`number`) – None

  Returns the model at the given zero-based index

  Return type: | Model

### getRayThroughPoint

`View.``getRayThroughPoint`(point)

  Arguments: | point (`Vec3`) – None

  Returns a ray that intersects the given point (in world coordinates) and starts at the point’s projection onto the screen.

  Returns null if no ray can be found.

  Return type: | Ray

### rayIntersect

`View.``rayIntersect`(ray, ignoreLabels)

  Arguments: | ray (`Ray`) – None ignoreLabels (`boolean`) – None

  Do a ray intersect with all the models in the view.

  Returns the intersection point if there was a hit, and null if there was not a hit.

  Labels have a “special treatment” ray intersect where hitting the label will cause a hit on the label attachment point. This is not always what is intended, e.g. when doing zoom to cursor. Set ignoreLabels to true to skip labels when doing ray intersect. This only applies to PartLabels in the MarkupModel

  Return type: | Vec3

### removeAllModels

`View.``removeAllModels`()

  Removes all models from the view.

  Return type: | void

### removeModel

`View.``removeModel`(model)

  Arguments: | model (`Model`) – None

  Removes the given model from the view.

  Return type: | void

### removeModelAt

`View.``removeModelAt`(modelIndex)

  Arguments: | modelIndex (`number`) – None

  Removes the model at the given index from the view.

  The index must be zero-based and between 0 and modelCount - 1

  Return type: | void

### requestRedraw

`View.``requestRedraw`()

  Requests a redraw of the viewer. This will force a redraw on the next `CloudSession.handleAnimationFrameCallback` event.

  Return type: | void

### setViewport

`View.``setViewport`(x, y, width, height)

  Arguments: | x (`number`) – None y (`number`) – None width (`number`) – None height (`number`) – None

  Sets the viewport to the given position and size in OpenGL window coordinates.

  This method cannot be called when `ownerViewer`.``viewLayoutMode`` is set to `ViewLayoutMode.Auto`.

  Return type: | void

Conversation saved
HOOPSY BETA

### Hello! I'm HOOPSY

Your Docs generative AI assistant. Ask me anything about HOOPS Envision for Web or choose a sample question below to start a conversation:

What is HOOPS Envision for Web?
What are the latest release notes for HOOPS Envision for Web?
How do I start evaluating HOOPS Envision for Web?
How do I write my first sample application?
How can I get assistance?

HOOPSY may store conversations according to OpenAI's policy. Responses may not always be accurate.

HOOPSY is thinking...