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 theremoveModel
function.You can access the
Camera
from the View with thecamera
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 syncronized 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
Methods
Accessors
- cee.View.ambientOcclusion
The ambient occlusion configuration object for the view
- cee.View.background
The background config of the view
- cee.View.backgroundColor
The background color of the view.
Deprecated! Use view.background.setSingleColor()
- cee.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.
- cee.View.clipping
The clipping controller for the view
- cee.View.haloHighlightColor
The color used to draw the halo around highlighted parts in the view.
- cee.View.modelCount
The number of models in the view.
- cee.View.name
The name of the view (used for debugging)
The navigation controller for the view.
- cee.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.
- cee.View.overlay
The 2d overlay controller for the view.
- cee.View.ownerViewer
The owner
Viewer
A View can only be in one Viewer. The Viewer creates and manages the View.
Methods
addModel
getBoundingBox
- cee.View.getBoundingBox()
Returns the combined bounding box of all models in the view
- Return type
cee.BoundingBox
getBoundingBoxVisibleParts
- cee.View.getBoundingBoxVisibleParts()
Returns the combined bounding box of all models in the view
- Return type
cee.BoundingBox
getIndexOfModel
getModelArray
- cee.View.getModelArray()
Returns a read only array with all models in the view
- Return type
ReadonlyArray[cee.Model]
getModelAt
- cee.View.getModelAt(index)
Returns the model at the given zero-based index
- Arguments
index (
number
) –
- Return type
cee.Model
getRayThroughPoint
rayIntersect
- cee.View.rayIntersect(ray, ignoreLabels)
Do a ray intersect with all the models in the view.
- Arguments
ray (
cee.Ray
) –ignoreLabels (
boolean
) –
- Return type
cee.Vec3
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
removeAllModels
- cee.View.removeAllModels()
Removes all models from the view.
- Return type
void
removeModel
removeModelAt
- cee.View.removeModelAt(modelIndex)
Removes the model at the given index from the view.
- Arguments
modelIndex (
number
) –
- Return type
void
The index must be zero-based and between 0 and modelCount - 1
requestRedraw
- cee.View.requestRedraw()
Requests a redraw of the viewer. This will force a redraw on the next
CloudSession.handleAnimationFrameCallback
event.- Return type
void
setViewport
- cee.View.setViewport(x, y, width, height)
Sets the viewport to the given position and size in OpenGL window coordinates.
- Arguments
x (
number
) –y (
number
) –width (
number
) –height (
number
) –
- Return type
void
This method cannot be called when
OwnerViewer.viewLayoutMode
is set toViewLayoutMode.Auto