
##########
Isosurface
##########

.. js:class:: cee.ug.Isosurface

   Specification of an isosurface (both parameters and attributes) in a :js:class:`RemoteModel <cee.ug.RemoteModel>`\ .
   
   Use this object to control the settings and attributes of an isosurface. The isosurface is defined by specifying the scalar to compute from (with :js:func:`isoScalarResultId <cee.ug.Isosurface.isoScalarResultId>`\ ) and the value to compute the surface for (with :js:func:`isoValue <cee.ug.Isosurface.isoValue>`\ ). The result is a surface within the model containing all points where the scalar result has the given value.
   
   You can map any scalar result onto the isosurface with :js:func:`mapScalarResultId <cee.ug.Isosurface.mapScalarResultId>` and also map a vector result with :js:func:`mapVectorResultId <cee.ug.Isosurface.mapVectorResultId>`\ . The settings for the mapped results can be controlled with the :js:class:`ScalarSettings <cee.ug.ScalarSettings>` and :js:class:`VectorSettings <cee.ug.VectorSettings>` objects.
   
   To create an isosurface, use :js:meth:`RemoteModel.addIsosurface <cee.ug.RemoteModel.addIsosurface>`\ .
   
   **Example:** Show an isosurface
   
   .. code-block:: javascript
   
      var modelDir = myModel.modelDirectory;
      
      // Add iso surface if we have a scalar result
      if (modelDir.scalarResultArray.length > 0) {
          var iso = myModel.addIsosurface();
          iso.isoScalarResultId = modelDir.scalarResultArray[0].id;
          
          if (myModel.getScalarResultMinimumValue(iso.isoScalarResultId) != undefined) {
              iso.isoValue = (myModel.getScalarResultMinimumValue(iso.isoScalarResultId) 
                    + myModel.getScalarResultMaximumValue(iso.isoScalarResultId))/2;
          } else {
              iso.isoValue = 0.5;
          }
          
          if (modelDir.scalarResultArray.length > 1) {
              iso.mapScalarResultId = modelDir.scalarResultArray[1].id;
          } else {
              iso.mapScalarResultId = modelDir.scalarResultArray[0].id;
          }
      }
      
      // Set model to outline to show the cutting planes
      myModel.setDrawStyleAllParts(cee.ug.DrawStyle.OUTLINE);
   
   This code sample produces the following image in the 3D Viewer:
   
   .. image:: /images/Isosurface.png
      :alt: None
   
   
   
   
   Index
   =====
   
   .. rubric:: Accessors
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:func:`~cee.ug.Isosurface.computeFromVisibleParts`
   * :js:func:`~cee.ug.Isosurface.highlight`
   * :js:func:`~cee.ug.Isosurface.id`
   * :js:func:`~cee.ug.Isosurface.isoScalarResultId`
   * :js:func:`~cee.ug.Isosurface.isoValue`
   * :js:func:`~cee.ug.Isosurface.isPrecomputed`
   * :js:func:`~cee.ug.Isosurface.mapContourLinesResultId`
   * :js:func:`~cee.ug.Isosurface.mapScalarResultId`
   * :js:func:`~cee.ug.Isosurface.mapVectorResultId`
   * :js:func:`~cee.ug.Isosurface.opacity`
   * :js:func:`~cee.ug.Isosurface.surfaceColor`
   * :js:func:`~cee.ug.Isosurface.visible`
   
   .. rubric:: Methods
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:meth:`~cee.ug.Isosurface.getAsProperties`
   * :js:meth:`~cee.ug.Isosurface.setFromProperties`
   
   



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

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


.. js:method:: cee.ug.Isosurface.computeFromVisibleParts

      .. rst-class:: sig-pretty-signature
      
         | *get* computeFromVisibleParts(): *boolean*
      
      If set to true, the isosurface will be computed from only the visible parts. Any part that is not visible will not contribute to the isosurface.
      
      **Returns**\ : *boolean*
      
      .. rst-class:: sig-pretty-signature
      
         | *set* computeFromVisibleParts(**visiblePartsOnly**\ : *boolean*\ ): *void*
      
      **Parameters**
      
      
         **visiblePartsOnly**\ : *boolean*
      
      
      **Returns**\ : *void*
      



.. js:method:: cee.ug.Isosurface.highlight

      .. rst-class:: sig-pretty-signature
      
         | *get* highlight(): *boolean*
      
      Whether the isosurface should be highlighted.
      
      **Returns**\ : *boolean*
      
      .. rst-class:: sig-pretty-signature
      
         | *set* highlight(**highlight**\ : *boolean*\ ): *void*
      
      **Parameters**
      
      
         **highlight**\ : *boolean*
      
      
      **Returns**\ : *void*
      



.. js:method:: cee.ug.Isosurface.id

      .. rst-class:: sig-pretty-signature
      
         | *get* id(): *number*
      
      The id of the isosurface. This is assigned by the system when you call :js:meth:`RemoteModel.addIsosurface <cee.ug.RemoteModel.addIsosurface>` and is used to identify the isosurface.
      
      **Returns**\ : *number*
      



.. js:method:: cee.ug.Isosurface.isoScalarResultId

      .. rst-class:: sig-pretty-signature
      
         | *get* isoScalarResultId(): *number*
      
      The scalar result to compute the isosurface from. This property is mandatory and must refer to one of the scalar results in :js:data:`ModelDirectory.scalarResultArray <cee.ug.ModelDirectory.scalarResultArray>`\ .
      
      **Returns**\ : *number*
      
      .. rst-class:: sig-pretty-signature
      
         | *set* isoScalarResultId(**isoScalarResultId**\ : *number*\ ): *void*
      
      **Parameters**
      
      
         **isoScalarResultId**\ : *number*
      
      
      **Returns**\ : *void*
      



.. js:method:: cee.ug.Isosurface.isoValue

      .. rst-class:: sig-pretty-signature
      
         | *get* isoValue(): *number*
      
      The value to compute the isosurface from. The value of the scalar result with id :js:func:`isoScalarResultId <cee.ug.Isosurface.isoScalarResultId>` will be equal to this value at all points on the isosurface.
      
      **Returns**\ : *number*
      
      .. rst-class:: sig-pretty-signature
      
         | *set* isoValue(**isoValue**\ : *number*\ ): *void*
      
      **Parameters**
      
      
         **isoValue**\ : *number*
      
      
      **Returns**\ : *void*
      



.. js:method:: cee.ug.Isosurface.isPrecomputed

      .. rst-class:: sig-pretty-signature
      
         | *get* isPrecomputed(): *boolean*
      
      Is true if the isosurface is precomputed and cannot be changed
      
      **Returns**\ : *boolean*
      



.. js:method:: cee.ug.Isosurface.mapContourLinesResultId

      .. rst-class:: sig-pretty-signature
      
         | *get* mapContourLinesResultId(): *number*
      
      The id of the contour lines result to show on the isosurface.
      
      This id must refer to one of the scalar results in ``ModelDirectory.scalarLinesResultArray``\ .
      
      Set to -1 to show no contour lines on the isosurface.
      
      **Returns**\ : *number*
      
      .. rst-class:: sig-pretty-signature
      
         | *set* mapContourLinesResultId(**mapContourLinesResultId**\ : *number*\ ): *void*
      
      **Parameters**
      
      
         **mapContourLinesResultId**\ : *number*
      
      
      **Returns**\ : *void*
      



.. js:method:: cee.ug.Isosurface.mapScalarResultId

      .. rst-class:: sig-pretty-signature
      
         | *get* mapScalarResultId(): *number*
      
      The id of the scalar result to show on the isosurface.
      
      This id must refer to one of the scalar results in :js:data:`ModelDirectory.scalarResultArray <cee.ug.ModelDirectory.scalarResultArray>`\ . You can change the settings for the scalar with the :js:class:`ScalarSettings <cee.ug.ScalarSettings>` object.
      
      Set to -1 to show no scalars on the isosurface.
      
      **Returns**\ : *number*
      
      .. rst-class:: sig-pretty-signature
      
         | *set* mapScalarResultId(**mapScalarResultId**\ : *number*\ ): *void*
      
      **Parameters**
      
      
         **mapScalarResultId**\ : *number*
      
      
      **Returns**\ : *void*
      



.. js:method:: cee.ug.Isosurface.mapVectorResultId

      .. rst-class:: sig-pretty-signature
      
         | *get* mapVectorResultId(): *number*
      
      The id of the vector result to show on the isosurface. One vector will be shown in each node of the surface.
      
      This id must refer to one of the vector results in :js:data:`ModelDirectory.vectorResultArray <cee.ug.ModelDirectory.vectorResultArray>`\ . The settings for the vector arrows can be changed with the :js:class:`VectorSettings <cee.ug.VectorSettings>` object.
      
      Set to -1 to show no vectors on the isosurface.
      
      **Returns**\ : *number*
      
      .. rst-class:: sig-pretty-signature
      
         | *set* mapVectorResultId(**mapVectorResultId**\ : *number*\ ): *void*
      
      **Parameters**
      
      
         **mapVectorResultId**\ : *number*
      
      
      **Returns**\ : *void*
      



.. js:method:: cee.ug.Isosurface.opacity

      .. rst-class:: sig-pretty-signature
      
         | *get* opacity(): *number*
      
      Opacity of the isosurface. 0.0 means fully transparent (invisible), 1.0 means fully opaque.
      
      **Returns**\ : *number*
      
      .. rst-class:: sig-pretty-signature
      
         | *set* opacity(**opacity**\ : *number*\ ): *void*
      
      **Parameters**
      
      
         **opacity**\ : *number*
      
      
      **Returns**\ : *void*
      



.. js:method:: cee.ug.Isosurface.surfaceColor

      .. rst-class:: sig-pretty-signature
      
         | *get* surfaceColor(): :js:class:`Color3Like <cee.Color3Like>`
      
      The color of the isosurface if not showing a result (mapScalarResultId = -1)
      
      **Returns**\ : :js:class:`Color3Like <cee.Color3Like>`
      
      .. rst-class:: sig-pretty-signature
      
         | *set* surfaceColor(**clr**\ : :js:class:`Color3Like <cee.Color3Like>`\ ): *void*
      
      **Parameters**
      
      
         **clr**\ : :js:class:`Color3Like <cee.Color3Like>`
      
      
      **Returns**\ : *void*
      



.. js:method:: cee.ug.Isosurface.visible

      .. rst-class:: sig-pretty-signature
      
         | *get* visible(): *boolean*
      
      Visibility of the isosurface. Use this to show or hide an isosurface in the 3D Viewer.
      
      **Returns**\ : *boolean*
      
      .. rst-class:: sig-pretty-signature
      
         | *set* visible(**visible**\ : *boolean*\ ): *void*
      
      **Parameters**
      
      
         **visible**\ : *boolean*
      
      
      **Returns**\ : *void*
      



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

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


.. js:method:: cee.ug.Isosurface.getAsProperties

      .. rst-class:: sig-pretty-signature
      
         | getAsProperties(): :js:class:`IsosurfaceProperties <cee.ug.IsosurfaceProperties>`
      
      Gets the settings for this isosurface as a Plain Old JavaScript Object (POJO).
      
      **Returns**\ : :js:class:`IsosurfaceProperties <cee.ug.IsosurfaceProperties>`
      



.. js:method:: cee.ug.Isosurface.setFromProperties

      .. rst-class:: sig-pretty-signature
      
         | setFromProperties(**props**\ : *Partial*\ ): *void*
      
      Applies the settings in the given properties object to this isosurface.
      
      **Parameters**
      
      
         **props**\ : *Partial*
      
      
      **Returns**\ : *void*
      




