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
addModelfunction and remove it with theremoveModelfunction.You can access the
Camerafrom the View with thecameraproperty. 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
MultipleViewsexample project shows how you can create, manage, and synchronize multiple views.You can manage overlay items (legends, text boxes, navigation cube, etc) with the
overlayobject.Index
Accessors
ambientOcclusionbackgroundcameraclippinghaloHighlightColormodelCountnamenavigationnonHighlightedDimFactoroperatorsoverlayownerViewer
Methods
Accessors
-
cee.View.ambientOcclusion() - get ambientOcclusion():
AmbientOcclusionThe ambient occlusion configuration object for the view
Returns:
AmbientOcclusion
-
cee.View.background() - get background():
BackgroundThe background config of the view
Returns:
Background
-
cee.View.camera() - get camera():
CameraThe
Cameraused 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.
Returns:
Camera
-
cee.View.clipping() - get clipping():
ClippingThe clipping controller for the view
Returns:
Clipping
-
cee.View.haloHighlightColor() - get haloHighlightColor():
Color3LikeThe color used to draw the halo around highlighted parts in the view.
Returns:
Color3Likeset haloHighlightColor(highlightColor:Color3Like): voidParameters
highlightColor:Color3LikeReturns: void
-
cee.View.modelCount() - get modelCount(): number
The number of models in the view.
Returns: number
-
cee.View.name() - get name(): string
The name of the view (used for debugging)
Returns: string
set name(name: string): voidParameters
name: stringReturns: void
- get navigation():
NavigationDeprecated
Returns:
Navigation
-
cee.View.nonHighlightedDimFactor() - get nonHighlightedDimFactor(): number
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.
Returns: number
set nonHighlightedDimFactor(factor: number): voidParameters
factor: numberReturns: void
-
cee.View.operators() - get operators():
OperatorStackThe operator stack for the view.
Returns:
OperatorStack
-
cee.View.ownerViewer() - get ownerViewer():
ViewerThe owner
Viewer.A View can only be in one Viewer. The Viewer creates and manages the View.
Returns:
Viewer
Methods
-
cee.View.addModel() - addModel(model:
Model): voidAdds 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.
Parameters
model:ModelReturns: void
-
cee.View.getBoundingBox() - getBoundingBox(modelBoundingBoxOptions:
ModelBoundingBoxOptions):BoundingBoxReturns the combined bounding box of all models in the view
See
Model.getBoundingBoxandModelBoundingBoxOptionsfor more information on how the bounding box is calculated and what options are available.Parameters
modelBoundingBoxOptions:ModelBoundingBoxOptionsReturns:
BoundingBox
-
cee.View.getIndexOfModel() - getIndexOfModel(model:
Model): numberReturns the zero-based index of the given model
Parameters
model:ModelReturns: number
-
cee.View.getModelArray() - getModelArray(): readonly
Model[]Returns a read only array with all models in the view
Returns: readonly
Model[]
-
cee.View.getModelAt() - getModelAt(index: number):
ModelReturns the model at the given zero-based index
Parameters
index: numberReturns:
Model
-
cee.View.getRayThroughPoint() -
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.
Parameters
point:Vec3Returns:
Ray
-
cee.View.rayIntersect() -
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
Parameters
ray:
RayignoreLabels: boolean = false
Returns:
Vec3
-
cee.View.removeAllModels() - removeAllModels(): void
Removes all models from the view.
Returns: void
-
cee.View.removeModel() - removeModel(model:
Model): voidRemoves the given model from the view.
Parameters
model:ModelReturns: void
-
cee.View.removeModelAt() - removeModelAt(modelIndex: number): void
Removes the model at the given index from the view.
The index must be zero-based and between 0 and modelCount - 1
Parameters
modelIndex: numberReturns: void
-
cee.View.requestRedraw() - requestRedraw(): void
Requests a redraw of the viewer. This will force a redraw on the next
CloudSession.handleAnimationFrameCallbackevent.Returns: void
-
cee.View.setViewport() - setViewport(x: number, y: number, width: number, height: number): void
Sets the viewport to the given position and size in OpenGL window coordinates.
This method cannot be called when
ownerViewer.viewLayoutModeis set toViewLayoutMode.Auto.Parameters
x: number
y: number
width: number
height: number
Returns: void