.. role:: ts-api-decorator

####################
DisplacementSettings
####################

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

.. container:: ts-api-section

   .. js:class:: DisplacementSettings

      Specification of how to render parts with the given displacement result.

      With this object you can control the (absolute) scaling of displacements.



.. container:: api-index-section

   .. rubric:: Accessors

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

   * :js:attr:`~cee.ug.DisplacementSettings.resultId`
   * :js:attr:`~cee.ug.DisplacementSettings.scaleFactor`
   * :js:attr:`~cee.ug.DisplacementSettings.scaleMode`



.. container:: api-index-section

   .. rubric:: Methods

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

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





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

Accessors
=========

.. container:: ts-api-section

   .. js:function:: DisplacementSettings.resultId()



      The id (>=0) of the displacement result. 
      This id must refer to one of the displacement results in ``ModelDirectory.displacementResultArray``.


      :rtype: number



.. container:: ts-api-section

   .. js:function:: DisplacementSettings.scaleFactor()



      The scale factor to use for the displacement result. 

      The behavior depends on the chosen ``scaleMode``. For absolute displacements, they will be simply multiplied by this factor.

      For relative displacements, this will scale them in a way that the largest displacement will have its length equal to 
      the length of the model bounding box's diagonal multiplied by this factor. Typical usable values for relative displacements are in the range 0 to 0.5.


      :rtype: number

   .. js:function:: DisplacementSettings.scaleFactor( scaleFactor)

      :param scaleFactor: None
      :type scaleFactor: number


      :rtype: void



.. container:: ts-api-section

   .. js:function:: DisplacementSettings.scaleMode()



      The scaling mode to use for displacement results (absolute or relative). The default is absolute.


      :rtype: DisplacementScaleMode

   .. js:function:: DisplacementSettings.scaleMode( scaleMode)

      :param scaleMode: None
      :type scaleMode: DisplacementScaleMode


      <nbsp>


      :rtype: void



Methods
=======

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

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

.. js:method:: DisplacementSettings.getAsProperties()



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


   :rtype: DisplacementSettingsProperties

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

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

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

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


   Applies the settings in the given properties object to this displacement settings.


   :rtype: void

