.. role:: ts-api-decorator

############
PartSettings
############

.. js:module:: cee.ug
   :noindex:

.. container:: ts-api-section

   .. js:class:: PartSettings

      Specification of the visual appearance of a part in a RemoteModel

      Use this object to control how the part will be rendered in the 3D viewer. You can set whether the part is ``visible``, 
      the ``drawStyle``, ``color``, ``opacity``, and if the part should be ``smooth`` or flat shaded. You can also
      set ``showFringes`` to specify if the part should show the current scalar result (if a scalar result is specified in the ``ModelSpec``) 
      and set ``showVectors`` to specify if vector arrows should be drawn for the surface of this part (if a vector result is specified in the 
      ``ModelSpec``).

      You can access PartSettings objects with ``RemoteModel.getPartSettingsAt``.

      **Example:** Show all parts as transparent


      .. code-block:: javascript

         for (var i = 0; i < myModel.partCount; ++i) {
             var partSettings = myModel.getPartSettingsAt(i);
             partSettings.drawStyle = cee.ug.DrawStyle.SURFACE;
             partSettings.opacity = 0.5;
         }



      or


      .. code-block:: javascript

         for (var ps of myModel.getPartSettingsArray()) {
             ps.drawStyle = cee.ug.DrawStyle.SURFACE;
             ps.opacity = 0.5;
         }




.. container:: api-index-section

   .. rubric:: Accessors

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

   * :js:attr:`~cee.ug.PartSettings.color`
   * :js:attr:`~cee.ug.PartSettings.disableElementSetFiltering`
   * :js:attr:`~cee.ug.PartSettings.disableExpandElements`
   * :js:attr:`~cee.ug.PartSettings.disableFeatureExtraction`
   * :js:attr:`~cee.ug.PartSettings.disableMirroring`
   * :js:attr:`~cee.ug.PartSettings.drawStyle`
   * :js:attr:`~cee.ug.PartSettings.eyeLift`
   * :js:attr:`~cee.ug.PartSettings.geometryIndex`
   * :js:attr:`~cee.ug.PartSettings.highlight`
   * :js:attr:`~cee.ug.PartSettings.opacity`
   * :js:attr:`~cee.ug.PartSettings.partId`
   * :js:attr:`~cee.ug.PartSettings.showFringes`
   * :js:attr:`~cee.ug.PartSettings.showVectors`
   * :js:attr:`~cee.ug.PartSettings.smooth`
   * :js:attr:`~cee.ug.PartSettings.visible`



.. container:: api-index-section

   .. rubric:: Methods

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

   * :js:meth:`~cee.ug.PartSettings.getAsProperties`
   * :js:meth:`~cee.ug.PartSettings.setFromProperties`





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

Accessors
=========

.. container:: ts-api-section

   .. js:function:: PartSettings.color()



      The color of the part.


      :rtype: Color3Like

   .. js:function:: PartSettings.color( clr)

      :param clr: None
      :type clr: Color3Like


      :rtype: void



.. container:: ts-api-section

   .. js:function:: PartSettings.disableElementSetFiltering()



      Disables element set filtering for this part. See ``ModelSpec.visibleSetIdArray``


      :rtype: boolean

   .. js:function:: PartSettings.disableElementSetFiltering( disable)

      :param disable: None
      :type disable: boolean


      :rtype: void



.. container:: ts-api-section

   .. js:function:: PartSettings.disableExpandElements()



      Disables element expansion for this part. Beams will be shown as lines regardless of if they have
      cross section data defined or not.


      :rtype: boolean

   .. js:function:: PartSettings.disableExpandElements( disable)

      :param disable: None
      :type disable: boolean


      :rtype: void



.. container:: ts-api-section

   .. js:function:: PartSettings.disableFeatureExtraction()



      Disables feature extraction for this part. It will be excluded when computing e.g. isosurfaces.


      :rtype: boolean

   .. js:function:: PartSettings.disableFeatureExtraction( disable)

      :param disable: None
      :type disable: boolean


      :rtype: void



.. container:: ts-api-section

   .. js:function:: PartSettings.disableMirroring()



      Disable mirroring for this part.

      If set to true, this part will not be included in the mirroring of the model.


      :rtype: boolean

   .. js:function:: PartSettings.disableMirroring( disable)

      :param disable: None
      :type disable: boolean


      :rtype: void



.. container:: ts-api-section

   .. js:function:: PartSettings.drawStyle()



      The specification of how to render the part (surface, lines, points, mesh, etc).


      :rtype: DrawStyle

   .. js:function:: PartSettings.drawStyle( drawStyle)

      :param drawStyle: None
      :type drawStyle: DrawStyle


      :rtype: void



.. container:: ts-api-section

   .. js:function:: PartSettings.eyeLift()



      The eye lift mode to use for this part.

      Eye lift can be used when facing z fighting issues (triangles rendered in the same plane). 
      By applying eye lift to one part, it will be moved slightly towards the eye, resolving the 
      z fighting issues. The current version offers 3 eye lift factors to choose from.


      :rtype: EyeLift

   .. js:function:: PartSettings.eyeLift( mode)

      :param mode: None
      :type mode: EyeLift


      :rtype: void



.. container:: ts-api-section

   .. js:function:: PartSettings.geometryIndex()



      The zero-based geometryIndex of the part. A RemoteModel might have more than one geometry, but in most cases there is only one. 
      The combination of geometryIndex and partId uniquely identifies the part.


      :rtype: number



.. container:: ts-api-section

   .. js:function:: PartSettings.highlight()



      Whether the part should be highlighted.


      :rtype: boolean

   .. js:function:: PartSettings.highlight( highlight)

      :param highlight: None
      :type highlight: boolean


      :rtype: void



.. container:: ts-api-section

   .. js:function:: PartSettings.opacity()



      The opacity of the part. 1.0 is fully opaque, 0.0 if fully transparent (invisible).


      :rtype: number

   .. js:function:: PartSettings.opacity( opacity)

      :param opacity: None
      :type opacity: number


      :rtype: void



.. container:: ts-api-section

   .. js:function:: PartSettings.partId()



      The id of the part. The id is >=0 and unique within the part's geometry. 
      The combination of geometryIndex and partId uniquely identifies the part.


      :rtype: number



.. container:: ts-api-section

   .. js:function:: PartSettings.showFringes()



      Whether scalar fringes (filled contours) should be shown on this part. This
      flag only applies if the ``ModelSpec.fringesResultId`` is set to a valid scalar result id.


      :rtype: boolean

   .. js:function:: PartSettings.showFringes( show)

      :param show: None
      :type show: boolean


      :rtype: void



.. container:: ts-api-section

   .. js:function:: PartSettings.showVectors()



      Whether vector arrows should be rendered on the surface of this part. This
      flag only applies if the ``ModelSpec.vectorResultIdArray`` is set to valid vector result id(s).


      :rtype: boolean

   .. js:function:: PartSettings.showVectors( show)

      :param show: None
      :type show: boolean


      :rtype: void



.. container:: ts-api-section

   .. js:function:: PartSettings.smooth()



      Flag controlling the shading model of the part. 

      If true, smooth shading will be used for the part, where it is rendered with a smoothed out surface with 
      a per pixel lighting. If false, a flat shading rendering will be applied where the surface of an element 
      is rendered with the same color.


      :rtype: boolean

   .. js:function:: PartSettings.smooth( smooth)

      :param smooth: None
      :type smooth: boolean


      :rtype: void



.. container:: ts-api-section

   .. js:function:: PartSettings.visible()



      Visibility of the part. Use this to show or hide a part in the 3D Viewer.


      :rtype: boolean

   .. js:function:: PartSettings.visible( visible)

      :param visible: None
      :type visible: boolean


      :rtype: void



Methods
=======

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

getAsProperties
---------------

.. js:method:: PartSettings.getAsProperties()



   Gets the settings for this part as a Plain Old JavaScript Object (POJO).


   :rtype: PartSettingsProperties

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

setFromProperties
-----------------

.. js:method:: PartSettings.setFromProperties( props)

   :param props: None
   :type props: Partial <PartSettingsProperties>


   Applies the settings in the given properties object to this part


   :rtype: void

