.. role:: ts-api-decorator

###################
ConstantRemoteModel
###################

.. js:module:: cee.cug
   :noindex:

.. container:: ts-api-section

   .. js:class:: ConstantRemoteModel

      A constant remote model designed for viewing CAE models with a stateless, scalable server.

      The ConstantRemoteModel supports an efficient and scalable streaming of pre-defined CAE model configurations. 
      The server is a stateless REST API based server that has very low resource usage on the server side and is easy to load balance. 
      The streaming also starts immediately when a model is opened, no matter the size of the model. 
      Similar to RemoteModel, it utilizes 3D Progressive Object Streaming to the client. The model needs to be converted 
      into a CUG database format before it can be streamed. This is done with the included CugComposer command line utility. 

      The ConstantRemoteModel is used in the viewer on Ceetron Cloud.

      See the example in Examples/BuildYourFirstApp/2-Viewer for how to use the ConstantRemoteModel.



.. container:: api-index-section

   .. rubric:: Constructors

   .. rst-class:: api-index-list-item api-kind-constructor api-parent-kind-class

   * :js:meth:`~cee.cug.ConstantRemoteModel.constructor`



.. container:: api-index-section

   .. rubric:: Accessors

   .. rst-class:: api-index-list-item api-kind-accessor api-parent-kind-class

   * :js:attr:`~cee.cug.ConstantRemoteModel.animation`
   * :js:attr:`~cee.cug.ConstantRemoteModel.currentFrameIndex`
   * :js:attr:`~cee.cug.ConstantRemoteModel.cuttingPlaneCount`
   * :js:attr:`~cee.cug.ConstantRemoteModel.frameCount`
   * :js:attr:`~cee.cug.ConstantRemoteModel.isosurfaceCount`
   * :js:attr:`~cee.cug.ConstantRemoteModel.isovolumeCount`
   * :js:attr:`~cee.cug.ConstantRemoteModel.meshColor`
   * :js:attr:`~cee.cug.ConstantRemoteModel.modelSpec`
   * :js:attr:`~cee.cug.ConstantRemoteModel.name`
   * :js:attr:`~cee.cug.ConstantRemoteModel.partCount`
   * :js:attr:`~cee.cug.ConstantRemoteModel.particleTraceGroup`
   * :js:attr:`~cee.cug.ConstantRemoteModel.simulationInfo`



.. container:: api-index-section

   .. rubric:: Methods

   .. rst-class:: api-index-list-item api-kind-method api-parent-kind-class

   * :js:meth:`~cee.cug.ConstantRemoteModel.closeModel`
   * :js:meth:`~cee.cug.ConstantRemoteModel.enablePreLoading`
   * :js:meth:`~cee.cug.ConstantRemoteModel.getBoundingBox`
   * :js:meth:`~cee.cug.ConstantRemoteModel.getBoundingBoxForPart`
   * :js:meth:`~cee.cug.ConstantRemoteModel.getCurrentParticleTraceTime`
   * :js:meth:`~cee.cug.ConstantRemoteModel.getCuttingPlaneArray`
   * :js:meth:`~cee.cug.ConstantRemoteModel.getCuttingPlaneAt`
   * :js:meth:`~cee.cug.ConstantRemoteModel.getDefaultCameraConfig`
   * :js:meth:`~cee.cug.ConstantRemoteModel.getFrameInfoArray`
   * :js:meth:`~cee.cug.ConstantRemoteModel.getFrameInfoAt`
   * :js:meth:`~cee.cug.ConstantRemoteModel.getIsosurfaceArray`
   * :js:meth:`~cee.cug.ConstantRemoteModel.getIsosurfaceAt`
   * :js:meth:`~cee.cug.ConstantRemoteModel.getIsovolumeArray`
   * :js:meth:`~cee.cug.ConstantRemoteModel.getIsovolumeAt`
   * :js:meth:`~cee.cug.ConstantRemoteModel.getPartArray`
   * :js:meth:`~cee.cug.ConstantRemoteModel.getPartAt`
   * :js:meth:`~cee.cug.ConstantRemoteModel.getParticleTraceGroupArray`
   * :js:meth:`~cee.cug.ConstantRemoteModel.getParticleTraceGroupAt`
   * :js:meth:`~cee.cug.ConstantRemoteModel.getResultInfo`
   * :js:meth:`~cee.cug.ConstantRemoteModel.getResultInfoArray`
   * :js:meth:`~cee.cug.ConstantRemoteModel.isFirstParticleTraceCycle`
   * :js:meth:`~cee.cug.ConstantRemoteModel.openLocalBundle`
   * :js:meth:`~cee.cug.ConstantRemoteModel.openModel`
   * :js:meth:`~cee.cug.ConstantRemoteModel.openRemoteBundle`
   * :js:meth:`~cee.cug.ConstantRemoteModel.rayIntersect`
   * :js:meth:`~cee.cug.ConstantRemoteModel.rayIntersectServerInfo`
   * :js:meth:`~cee.cug.ConstantRemoteModel.setColorLegendTitle`
   * :js:meth:`~cee.cug.ConstantRemoteModel.setCurrentParticleTraceTime`
   * :js:meth:`~cee.cug.ConstantRemoteModel.setGuidingCamera`
   * :js:meth:`~cee.cug.ConstantRemoteModel.setMasterModelForSyncAnimation`
   * :js:meth:`~cee.cug.ConstantRemoteModel.setOneShotDataStreamingCompleteCallback`
   * :js:meth:`~cee.cug.ConstantRemoteModel.setProgressHandler`





------------

Constructors
============

.. container:: ts-api-section

   .. js:function:: ConstantRemoteModel.constructor()



      Creates a ConstantRemoteModel.


      :rtype: ConstantRemoteModel



Accessors
=========

.. container:: ts-api-section

   .. js:function:: ConstantRemoteModel.animation()



      The animation control for this ConstantRemoteModel


      :rtype: Animation



.. container:: ts-api-section

   .. js:function:: ConstantRemoteModel.currentFrameIndex()



      The frame to show

      The given zero-based index must be between 0 and ``frameCount`` - 1.


      :rtype: number

   .. js:function:: ConstantRemoteModel.currentFrameIndex( frameIndex)

      :param frameIndex: None
      :type frameIndex: number


      :rtype: void



.. container:: ts-api-section

   .. js:function:: ConstantRemoteModel.cuttingPlaneCount()



      :rtype: number



.. container:: ts-api-section

   .. js:function:: ConstantRemoteModel.frameCount()



      :rtype: number



.. container:: ts-api-section

   .. js:function:: ConstantRemoteModel.isosurfaceCount()



      :rtype: number



.. container:: ts-api-section

   .. js:function:: ConstantRemoteModel.isovolumeCount()



      :rtype: number



.. container:: ts-api-section

   .. js:function:: ConstantRemoteModel.meshColor()



      The color of the element mesh on the surface of the part


      :rtype: Color3Like

   .. js:function:: ConstantRemoteModel.meshColor( color)

      :param color: None
      :type color: Color3Like


      :rtype: void



.. container:: ts-api-section

   .. js:function:: ConstantRemoteModel.modelSpec()



      Returns the ModelSpec describing the result used in this model

      Might return null if model is not streamed yet or the model does not have result info.


      :rtype: ModelSpec



.. container:: ts-api-section

   .. js:function:: ConstantRemoteModel.name()



      Name of the model. 

      Mainly used for debugging.


      :rtype: string

   .. js:function:: ConstantRemoteModel.name( name)

      :param name: None
      :type name: string


      Name of the model. 

      Mainly used for debugging.


      :rtype: void



.. container:: ts-api-section

   .. js:function:: ConstantRemoteModel.partCount()



      Returns the number of parts in this model


      :rtype: number



.. container:: ts-api-section

   .. js:function:: ConstantRemoteModel.particleTraceGroup()



      :rtype: number



.. container:: ts-api-section

   .. js:function:: ConstantRemoteModel.simulationInfo()



      Returns the SimulationInfo describing the simulation that is the source for this model.

      Might return null if model is not streamed yet or the model does not have simulation info


      :rtype: SimulationInfo



Methods
=======

.. rst-class:: ts-api-section

closeModel
----------

.. js:method:: ConstantRemoteModel.closeModel()



   :rtype: void

.. rst-class:: ts-api-section

enablePreLoading
----------------

.. js:method:: ConstantRemoteModel.enablePreLoading( enable)

   :param enable: None
   :type enable: boolean


   :rtype: void

.. rst-class:: ts-api-section

getBoundingBox
--------------

.. js:method:: ConstantRemoteModel.getBoundingBox([ _options])

   :param _options: :ts-api-decorator:`optional` None
   :type _options: ModelBoundingBoxOptions


   Returns the ``BoundingBox`` (in world coordinates) of the current contents of the model

   Note that currently this method does not support any ``ModelBoundingBoxOptions``


   :rtype: BoundingBox

.. rst-class:: ts-api-section

getBoundingBoxForPart
---------------------

.. js:method:: ConstantRemoteModel.getBoundingBoxForPart( partIndex)

   :param partIndex: None
   :type partIndex: number


   Returns the ``BoundingBox`` (in world coordinates) of the part at the given index.


   :rtype: BoundingBox

.. rst-class:: ts-api-section

getCurrentParticleTraceTime
---------------------------

.. js:method:: ConstantRemoteModel.getCurrentParticleTraceTime()



   :rtype: number

.. rst-class:: ts-api-section

getCuttingPlaneArray
--------------------

.. js:method:: ConstantRemoteModel.getCuttingPlaneArray()



   :rtype: unknown

.. rst-class:: ts-api-section

getCuttingPlaneAt
-----------------

.. js:method:: ConstantRemoteModel.getCuttingPlaneAt( index)

   :param index: None
   :type index: number


   :rtype: CuttingPlane

.. rst-class:: ts-api-section

getDefaultCameraConfig
----------------------

.. js:method:: ConstantRemoteModel.getDefaultCameraConfig()



   Returns default camera configuration for this model if there is one.


   :rtype: CameraConfig

.. rst-class:: ts-api-section

getFrameInfoArray
-----------------

.. js:method:: ConstantRemoteModel.getFrameInfoArray()



   :rtype: unknown

.. rst-class:: ts-api-section

getFrameInfoAt
--------------

.. js:method:: ConstantRemoteModel.getFrameInfoAt( index)

   :param index: None
   :type index: number


   :rtype: FrameInfo

.. rst-class:: ts-api-section

getIsosurfaceArray
------------------

.. js:method:: ConstantRemoteModel.getIsosurfaceArray()



   :rtype: unknown

.. rst-class:: ts-api-section

getIsosurfaceAt
---------------

.. js:method:: ConstantRemoteModel.getIsosurfaceAt( index)

   :param index: None
   :type index: number


   :rtype: Isosurface

.. rst-class:: ts-api-section

getIsovolumeArray
-----------------

.. js:method:: ConstantRemoteModel.getIsovolumeArray()



   :rtype: unknown

.. rst-class:: ts-api-section

getIsovolumeAt
--------------

.. js:method:: ConstantRemoteModel.getIsovolumeAt( index)

   :param index: None
   :type index: number


   :rtype: Isovolume

.. rst-class:: ts-api-section

getPartArray
------------

.. js:method:: ConstantRemoteModel.getPartArray()



   :rtype: unknown

.. rst-class:: ts-api-section

getPartAt
---------

.. js:method:: ConstantRemoteModel.getPartAt( index)

   :param index: None
   :type index: number


   :rtype: Part

.. rst-class:: ts-api-section

getParticleTraceGroupArray
--------------------------

.. js:method:: ConstantRemoteModel.getParticleTraceGroupArray()



   :rtype: unknown

.. rst-class:: ts-api-section

getParticleTraceGroupAt
-----------------------

.. js:method:: ConstantRemoteModel.getParticleTraceGroupAt( index)

   :param index: None
   :type index: number


   :rtype: ParticleTraceGroup

.. rst-class:: ts-api-section

getResultInfo
-------------

.. js:method:: ConstantRemoteModel.getResultInfo( resultType, resultId)

   :param resultType: None
   :type resultType: ResultType
   :param resultId: None
   :type resultId: number


   Get the information about the result with the given type and id.

   Returns null if the result was not found.


   :rtype: ResultInfo

.. rst-class:: ts-api-section

getResultInfoArray
------------------

.. js:method:: ConstantRemoteModel.getResultInfoArray()



   Get the array with all ResultInfos defined in this model


   :rtype: unknown

.. rst-class:: ts-api-section

isFirstParticleTraceCycle
-------------------------

.. js:method:: ConstantRemoteModel.isFirstParticleTraceCycle()



   :rtype: boolean

.. rst-class:: ts-api-section

openLocalBundle
---------------

.. js:method:: ConstantRemoteModel.openLocalBundle( modelBundle[, initializationCompleteCallback])

   :param modelBundle: None
   :type modelBundle: BinaryModelBundle
   :param initializationCompleteCallback: :ts-api-decorator:`optional` None
   :type initializationCompleteCallback: InitializationCompleteCallback


   :rtype: void

.. rst-class:: ts-api-section

openModel
---------

.. js:method:: ConstantRemoteModel.openModel( serverUrl, modelKey[, options[, initializationCompleteCallback]])

   :param serverUrl: None
   :type serverUrl: string
   :param modelKey: None
   :type modelKey: string
   :param options: :ts-api-decorator:`optional` None
   :type options: OpenModelOptions
   :param initializationCompleteCallback: :ts-api-decorator:`optional` None
   :type initializationCompleteCallback: InitializationCompleteCallback


   :rtype: void

.. rst-class:: ts-api-section

openRemoteBundle
----------------

.. js:method:: ConstantRemoteModel.openRemoteBundle( bundleUrl[, options[, initializationCompleteCallback]])

   :param bundleUrl: None
   :type bundleUrl: string
   :param options: :ts-api-decorator:`optional` None
   :type options: OpenRemoteBundleOptions
   :param initializationCompleteCallback: :ts-api-decorator:`optional` None
   :type initializationCompleteCallback: InitializationCompleteCallback


   :rtype: void

.. rst-class:: ts-api-section

rayIntersect
------------

.. js:method:: ConstantRemoteModel.rayIntersect( ray)

   :param ray: None
   :type ray: Ray


   Performs picking on the model using the current frame.

   If something was hit, returns a HitItem containing information about the object that was hit.
   Returns null if nothing was hit.


   :rtype: HitItem

.. rst-class:: ts-api-section

rayIntersectServerInfo
----------------------

.. js:method:: ConstantRemoteModel.rayIntersectServerInfo( ray, rayIntersectCallback)

   :param ray: None
   :type ray: Ray
   :param rayIntersectCallback: None
   :type rayIntersectCallback: RayIntersectCallback


   Performs picking on the model using the current frame, querying the server for additional info

   If something was hit, returns a HitItem containing information about the object that was hit.
   Returns null if nothing was hit.

   This method will query the CUG server for additional info on the selected item


   :rtype: void

.. rst-class:: ts-api-section

setColorLegendTitle
-------------------

.. js:method:: ConstantRemoteModel.setColorLegendTitle( resultId, title)

   :param resultId: None
   :type resultId: number
   :param title: None
   :type title: string


   Set the title of the color legend with the given result Id

   This will update any current legends, and also be used as the title whenever the legend is later
   created.


   :rtype: void

.. rst-class:: ts-api-section

setCurrentParticleTraceTime
---------------------------

.. js:method:: ConstantRemoteModel.setCurrentParticleTraceTime( time, isFirstParticleTraceCycle)

   :param time: None
   :type time: number
   :param isFirstParticleTraceCycle: None
   :type isFirstParticleTraceCycle: boolean


   :rtype: void

.. rst-class:: ts-api-section

setGuidingCamera
----------------

.. js:method:: ConstantRemoteModel.setGuidingCamera( camera)

   :param camera: None
   :type camera: Camera


   :rtype: void

.. rst-class:: ts-api-section

setMasterModelForSyncAnimation
------------------------------

.. js:method:: ConstantRemoteModel.setMasterModelForSyncAnimation( masterModel)

   :param masterModel: None
   :type masterModel: ConstantRemoteModel


   Set a master model to which animation in this model will be synchronized.

   Calling this function will make this model a slave of masterModel with regards to animations.
   This means that animations will be controlled via the master model's animation control and that 
   this model's animation control become invalid. 
   To set this model back to normal operation, pass null to this function.


   :rtype: void

.. rst-class:: ts-api-section

setOneShotDataStreamingCompleteCallback
---------------------------------------

.. js:method:: ConstantRemoteModel.setOneShotDataStreamingCompleteCallback( dataStreamingCompleteCallback)

   :param dataStreamingCompleteCallback: None
   :type dataStreamingCompleteCallback: DataStreamingCompleteCallback


   Sets a one- shot callback that will be called the next time we observe that data streaming is complete


   :rtype: void

.. rst-class:: ts-api-section

setProgressHandler
------------------

.. js:method:: ConstantRemoteModel.setProgressHandler( progressHandler)

   :param progressHandler: None
   :type progressHandler: ProgressHandler


   Sets a handler function that will be called whenever when new progress data is available


   :rtype: void

