
####
View
####

.. js: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 :js:meth:`addModel <cee.View.addModel>` function and remove it with the :js:meth:`removeModel <cee.View.removeModel>` function.
   
   You can access the :js:class:`Camera <cee.Camera>` from the View with the :js:func:`camera <cee.View.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 :js:func:`overlay <cee.View.overlay>` object.
   
   
   Index
   =====
   
   .. rubric:: Accessors
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:func:`~cee.View.ambientOcclusion`
   * :js:func:`~cee.View.background`
   * :js:func:`~cee.View.camera`
   * :js:func:`~cee.View.clipping`
   * :js:func:`~cee.View.haloHighlightColor`
   * :js:func:`~cee.View.modelCount`
   * :js:func:`~cee.View.name`
   * :js:func:`~cee.View.navigation`
   * :js:func:`~cee.View.nonHighlightedDimFactor`
   * :js:func:`~cee.View.operators`
   * :js:func:`~cee.View.overlay`
   * :js:func:`~cee.View.ownerViewer`
   
   .. rubric:: Methods
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:meth:`~cee.View.addModel`
   * :js:meth:`~cee.View.getBoundingBox`
   * :js:meth:`~cee.View.getIndexOfModel`
   * :js:meth:`~cee.View.getModelArray`
   * :js:meth:`~cee.View.getModelAt`
   * :js:meth:`~cee.View.getRayThroughPoint`
   * :js:meth:`~cee.View.rayIntersect`
   * :js:meth:`~cee.View.removeAllModels`
   * :js:meth:`~cee.View.removeModel`
   * :js:meth:`~cee.View.removeModelAt`
   * :js:meth:`~cee.View.requestRedraw`
   * :js:meth:`~cee.View.setViewport`
   
   



.. rst-class:: kind-group kind-accessors

.. rubric:: Accessors
   :class: kind-group-title


.. js:method:: cee.View.ambientOcclusion

      .. rst-class:: sig-pretty-signature
      
         | *get* ambientOcclusion(): :js:class:`AmbientOcclusion <cee.AmbientOcclusion>`
      
      The ambient occlusion configuration object for the view
      
      **Returns**\ : :js:class:`AmbientOcclusion <cee.AmbientOcclusion>`
      



.. js:method:: cee.View.background

      .. rst-class:: sig-pretty-signature
      
         | *get* background(): :js:class:`Background <cee.Background>`
      
      The background config of the view
      
      **Returns**\ : :js:class:`Background <cee.Background>`
      



.. js:method:: cee.View.camera

      .. rst-class:: sig-pretty-signature
      
         | *get* camera(): :js:class:`Camera <cee.Camera>`
      
      The :js:class:`Camera <cee.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.
      
      **Returns**\ : :js:class:`Camera <cee.Camera>`
      



.. js:method:: cee.View.clipping

      .. rst-class:: sig-pretty-signature
      
         | *get* clipping(): :js:class:`Clipping <cee.Clipping>`
      
      The clipping controller for the view
      
      **Returns**\ : :js:class:`Clipping <cee.Clipping>`
      



.. js:method:: cee.View.haloHighlightColor

      .. rst-class:: sig-pretty-signature
      
         | *get* haloHighlightColor(): :js:class:`Color3Like <cee.Color3Like>`
      
      The color used to draw the halo around highlighted parts in the view.
      
      **Returns**\ : :js:class:`Color3Like <cee.Color3Like>`
      
      .. rst-class:: sig-pretty-signature
      
         | *set* haloHighlightColor(**highlightColor**\ : :js:class:`Color3Like <cee.Color3Like>`\ ): *void*
      
      **Parameters**
      
      
         **highlightColor**\ : :js:class:`Color3Like <cee.Color3Like>`
      
      
      **Returns**\ : *void*
      



.. js:method:: cee.View.modelCount

      .. rst-class:: sig-pretty-signature
      
         | *get* modelCount(): *number*
      
      The number of models in the view.
      
      **Returns**\ : *number*
      



.. js:method:: cee.View.name

      .. rst-class:: sig-pretty-signature
      
         | *get* name(): *string*
      
      The name of the view (used for debugging)
      
      **Returns**\ : *string*
      
      .. rst-class:: sig-pretty-signature
      
         | *set* name(**name**\ : *string*\ ): *void*
      
      **Parameters**
      
      
         **name**\ : *string*
      
      
      **Returns**\ : *void*
      



.. js:method:: cee.View.navigation

      .. rst-class:: sig-pretty-signature
      
         | *get* navigation(): :js:class:`Navigation <cee.Navigation>`
      
      **Deprecated**
      
      
      
      **Returns**\ : :js:class:`Navigation <cee.Navigation>`
      



.. js:method:: cee.View.nonHighlightedDimFactor

      .. rst-class:: sig-pretty-signature
      
         | *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*
      
      .. rst-class:: sig-pretty-signature
      
         | *set* nonHighlightedDimFactor(**factor**\ : *number*\ ): *void*
      
      **Parameters**
      
      
         **factor**\ : *number*
      
      
      **Returns**\ : *void*
      



.. js:method:: cee.View.operators

      .. rst-class:: sig-pretty-signature
      
         | *get* operators(): :js:class:`OperatorStack <cee.OperatorStack>`
      
      The operator stack for the view.
      
      **Returns**\ : :js:class:`OperatorStack <cee.OperatorStack>`
      



.. js:method:: cee.View.overlay

      .. rst-class:: sig-pretty-signature
      
         | *get* overlay(): :js:class:`Overlay <cee.Overlay>`
      
      The 2d overlay controller for the view.
      
      **Returns**\ : :js:class:`Overlay <cee.Overlay>`
      



.. js:method:: cee.View.ownerViewer

      .. rst-class:: sig-pretty-signature
      
         | *get* ownerViewer(): :js:class:`Viewer <cee.Viewer>`
      
      The owner :js:class:`Viewer <cee.Viewer>`\ .
      
      A View can only be in one Viewer. The Viewer creates and manages the View.
      
      **Returns**\ : :js:class:`Viewer <cee.Viewer>`
      



.. rst-class:: kind-group kind-methods

.. rubric:: Methods
   :class: kind-group-title


.. js:method:: cee.View.addModel

      .. rst-class:: sig-pretty-signature
      
         | addModel(**model**\ : :js:class:`Model <cee.Model>`\ ): *void*
      
      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.
      
      **Parameters**
      
      
         **model**\ : :js:class:`Model <cee.Model>`
      
      
      **Returns**\ : *void*
      



.. js:method:: cee.View.getBoundingBox

      .. rst-class:: sig-pretty-signature
      
         | getBoundingBox(**modelBoundingBoxOptions**\ : :js:class:`ModelBoundingBoxOptions <cee.ModelBoundingBoxOptions>`\ ): :js:class:`BoundingBox <cee.BoundingBox>`
      
      Returns the combined bounding box of all models in the view
      
      See :js:meth:`Model.getBoundingBox <cee.Model.getBoundingBox>` and :js:class:`ModelBoundingBoxOptions <cee.ModelBoundingBoxOptions>` for more information on how the bounding box is calculated and what options are available.
      
      **Parameters**
      
      
         **modelBoundingBoxOptions**\ : :js:class:`ModelBoundingBoxOptions <cee.ModelBoundingBoxOptions>`
      
      
      **Returns**\ : :js:class:`BoundingBox <cee.BoundingBox>`
      



.. js:method:: cee.View.getIndexOfModel

      .. rst-class:: sig-pretty-signature
      
         | getIndexOfModel(**model**\ : :js:class:`Model <cee.Model>`\ ): *number*
      
      Returns the zero-based index of the given model
      
      **Parameters**
      
      
         **model**\ : :js:class:`Model <cee.Model>`
      
      
      **Returns**\ : *number*
      



.. js:method:: cee.View.getModelArray

      .. rst-class:: sig-pretty-signature
      
         | getModelArray(): readonly  :js:class:`Model <cee.Model>`\ []
      
      Returns a read only array with all models in the view
      
      **Returns**\ : readonly  :js:class:`Model <cee.Model>`\ []
      



.. js:method:: cee.View.getModelAt

      .. rst-class:: sig-pretty-signature
      
         | getModelAt(**index**\ : *number*\ ): :js:class:`Model <cee.Model>`
      
      Returns the model at the given zero-based index
      
      **Parameters**
      
      
         **index**\ : *number*
      
      
      **Returns**\ : :js:class:`Model <cee.Model>`
      



.. js:method:: cee.View.getRayThroughPoint

      .. rst-class:: sig-pretty-signature
      
         | getRayThroughPoint(**point**\ : :js:class:`Vec3 <cee.Vec3>`\ ): :js:class:`Ray <cee.Ray>`
      
      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**\ : :js:class:`Vec3 <cee.Vec3>`
      
      
      **Returns**\ : :js:class:`Ray <cee.Ray>`
      



.. js:method:: cee.View.rayIntersect

      .. rst-class:: sig-pretty-signature
      
         | rayIntersect(**ray**\ : :js:class:`Ray <cee.Ray>`\ , **ignoreLabels**\ : *boolean*\ ?): :js:class:`Vec3 <cee.Vec3>`
      
      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**\ : :js:class:`Ray <cee.Ray>`
      
         **ignoreLabels**\ : *boolean* = false
      
      
      **Returns**\ : :js:class:`Vec3 <cee.Vec3>`
      



.. js:method:: cee.View.removeAllModels

      .. rst-class:: sig-pretty-signature
      
         | removeAllModels(): *void*
      
      Removes all models from the view.
      
      **Returns**\ : *void*
      



.. js:method:: cee.View.removeModel

      .. rst-class:: sig-pretty-signature
      
         | removeModel(**model**\ : :js:class:`Model <cee.Model>`\ ): *void*
      
      Removes the given model from the view.
      
      **Parameters**
      
      
         **model**\ : :js:class:`Model <cee.Model>`
      
      
      **Returns**\ : *void*
      



.. js:method:: cee.View.removeModelAt

      .. rst-class:: sig-pretty-signature
      
         | 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**\ : *number*
      
      
      **Returns**\ : *void*
      



.. js:method:: cee.View.requestRedraw

      .. rst-class:: sig-pretty-signature
      
         | requestRedraw(): *void*
      
      Requests a redraw of the viewer. This will force a redraw on the next :js:meth:`CloudSession.handleAnimationFrameCallback <cee.CloudSession.handleAnimationFrameCallback>` event.
      
      **Returns**\ : *void*
      



.. js:method:: cee.View.setViewport

      .. rst-class:: sig-pretty-signature
      
         | 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 :js:func:`ownerViewer <cee.View.ownerViewer>`\ . :js:func:`viewLayoutMode <cee.Viewer.viewLayoutMode>` is set to :js:data:`ViewLayoutMode.Auto <cee.ViewLayoutMode.Auto>`\ .
      
      **Parameters**
      
      
         **x**\ : *number*
      
         **y**\ : *number*
      
         **width**\ : *number*
      
         **height**\ : *number*
      
      
      **Returns**\ : *void*
      




