.. role:: ts-api-decorator

################
MeshInstanceData
################

.. container:: ts-api-section

   .. js:class:: MeshInstanceData

      Object representing a Mesh instance that will be created by the client at run time.
      This class allows for the specification of instance specific properties of a mesh.



.. container:: api-index-section

   .. rubric:: Constructors

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

   * :js:meth:`~MeshInstanceData.constructor`



.. container:: api-index-section

   .. rubric:: Properties

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

   * :js:attr:`~MeshInstanceData.overlayId`



.. container:: api-index-section

   .. rubric:: Methods

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

   * :js:meth:`~MeshInstanceData.clear`
   * :js:meth:`~MeshInstanceData.copy`
   * :js:meth:`~MeshInstanceData.getCreationFlags`
   * :js:meth:`~MeshInstanceData.getFaceColor`
   * :js:meth:`~MeshInstanceData.getInstanceName`
   * :js:meth:`~MeshInstanceData.getLineColor`
   * :js:meth:`~MeshInstanceData.getLineOpacity`
   * :js:meth:`~MeshInstanceData.getMatrix`
   * :js:meth:`~MeshInstanceData.getMeshId`
   * :js:meth:`~MeshInstanceData.getOpacity`
   * :js:meth:`~MeshInstanceData.getOverlayIndex`
   * :js:meth:`~MeshInstanceData.getPointColor`
   * :js:meth:`~MeshInstanceData.getPointOpacity`
   * :js:meth:`~MeshInstanceData.setCreationFlags`
   * :js:meth:`~MeshInstanceData.setFaceColor`
   * :js:meth:`~MeshInstanceData.setInstanceName`
   * :js:meth:`~MeshInstanceData.setLineColor`
   * :js:meth:`~MeshInstanceData.setLineOpacity`
   * :js:meth:`~MeshInstanceData.setMatrix`
   * :js:meth:`~MeshInstanceData.setMeshId`
   * :js:meth:`~MeshInstanceData.setOpacity`
   * :js:meth:`~MeshInstanceData.setOverlayIndex`
   * :js:meth:`~MeshInstanceData.setPointColor`
   * :js:meth:`~MeshInstanceData.setPointOpacity`





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

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

.. container:: ts-api-section

   .. js:function:: MeshInstanceData.constructor([ meshId[, matrix[, instanceName[, faceColor[, lineColor[, pointColor[, creationFlags]]]]]]])

      :param meshId: :ts-api-decorator:`optional` the [[MeshId]] of the mesh to instantiate
      :type meshId: null | MeshId
      :param matrix: :ts-api-decorator:`optional` a matrix that will be applied to this instance
      :type matrix: null | Matrix
      :param instanceName: :ts-api-decorator:`optional` a name that will be visible when querying the model hierarchy
      :type instanceName: null | string
      :param faceColor: :ts-api-decorator:`optional` the color for faces of this instance
      :type faceColor: null | Color
      :param lineColor: :ts-api-decorator:`optional` the color for lines of this instance
      :type lineColor: null | Color
      :param pointColor: :ts-api-decorator:`optional` the color for points of this instance
      :type pointColor: null | Color
      :param creationFlags: :ts-api-decorator:`optional` additional options that can be used to alter the behavior of this instance
      :type creationFlags: null | MeshInstanceCreationFlags


      Creates a new MeshInstanceData object.


      :rtype: MeshInstanceData



Properties
==========

.. container:: ts-api-section

   .. js:attribute:: MeshInstanceData.overlayId

      :type: OverlayId

      The overlay for this instance.



Methods
=======

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

clear
-----

.. js:method:: MeshInstanceData.clear()



   Resets all fields of this object.


   :rtype: void

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

copy
----

.. js:method:: MeshInstanceData.copy()



   Creates a copy of this MeshInstanceData.

   :returns: Copy of this MeshInstanceData object.


   :rtype: MeshInstanceData

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

getCreationFlags
----------------

.. js:method:: MeshInstanceData.getCreationFlags()



   Gets the mesh instance creation flags (SuppressCameraScale, DoNotExplode, DoNotLight...)

   :returns: the mesh instance creation flags (null if none set)


   :rtype: MeshInstanceCreationFlags

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

getFaceColor
------------

.. js:method:: MeshInstanceData.getFaceColor()



   Gets the color for face elements in this instance.

   :returns: the color for face elements.


   :rtype: null | Color

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

getInstanceName
---------------

.. js:method:: MeshInstanceData.getInstanceName()



   Gets the name that will be applied to the instance.

   :returns: the instance name.


   :rtype: null | string

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

getLineColor
------------

.. js:method:: MeshInstanceData.getLineColor()



   Gets the color for line elements in this instance.

   :returns: the color for line elements.


   :rtype: null | Color

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

getLineOpacity
--------------

.. js:method:: MeshInstanceData.getLineOpacity()



   Gets the line opacity value for this instance.

   :returns: the line opacity value for this instance.


   :rtype: number

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

getMatrix
---------

.. js:method:: MeshInstanceData.getMatrix()



   Gets the matrix to apply to this instance.

   :returns: the current matrix that will be applied to this instance upon creation.


   :rtype: null | Matrix

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

getMeshId
---------

.. js:method:: MeshInstanceData.getMeshId()



   Gets the [[MeshId]] of the mesh to use for this instance.
   [[MeshId]]s are created with [[Model.createMesh]] or retrieved with [[Model.getMeshIds]].

   :returns: the mesh ID to use for this instance.


   :rtype: null | MeshId

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

getOpacity
----------

.. js:method:: MeshInstanceData.getOpacity()



   Gets the face opacity value for this instance.

   :returns: the face opacity value for this instance.


   :rtype: number

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

getOverlayIndex
---------------

.. js:method:: MeshInstanceData.getOverlayIndex()



   Gets the overlay index for this instance.

   :returns: the overlay index for this instance, but not the associated view.
   :deprecated: use [[overlayId]] instead.


   :rtype: number

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

getPointColor
-------------

.. js:method:: MeshInstanceData.getPointColor()



   Gets the color for point elements in this instance.

   :returns: the color for point elements.


   :rtype: null | Color

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

getPointOpacity
---------------

.. js:method:: MeshInstanceData.getPointOpacity()



   Gets the point opacity value for this instance.

   :returns: the point opacity value for this instance.


   :rtype: number

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

setCreationFlags
----------------

.. js:method:: MeshInstanceData.setCreationFlags( flags)

   :param flags: creation flags
   :type flags: MeshInstanceCreationFlags


   Sets the mesh instance creation flags (SuppressCameraScale, DoNotExplode, DoNotLight...)


   :rtype: void

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

setFaceColor
------------

.. js:method:: MeshInstanceData.setFaceColor( faceColor)

   :param faceColor: the color to apply to face elements.
   :type faceColor: Color


   Sets the color for face elements in this instance.


   :rtype: void

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

setInstanceName
---------------

.. js:method:: MeshInstanceData.setInstanceName( instanceName)

   :param instanceName: the name to assign to this instance.
   :type instanceName: string


   Sets the name that will be assigned to this instance. This name will be visible when querying the model hierarchy.


   :rtype: void

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

setLineColor
------------

.. js:method:: MeshInstanceData.setLineColor( lineColor)

   :param lineColor: the color to apply to line elements.
   :type lineColor: Color


   Sets the color for line elements in this instance.


   :rtype: void

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

setLineOpacity
--------------

.. js:method:: MeshInstanceData.setLineOpacity( lineOpacity)

   :param lineOpacity: opacity value to set.
   :type lineOpacity: number


   Sets the line opacity for this instance.


   :rtype: void

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

setMatrix
---------

.. js:method:: MeshInstanceData.setMatrix( matrix)

   :param matrix: the matrix to apply.
   :type matrix: Matrix


   Sets the matrix that will be applied to this instance.


   :rtype: void

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

setMeshId
---------

.. js:method:: MeshInstanceData.setMeshId( meshId)

   :param meshId: the [[MeshId]] to use.
   :type meshId: MeshId


   Sets the [[MeshId]] of the mesh to use for the instance.
   [[MeshId]]s are created with [[Model.createMesh]] or retrieved with [[Model.getMeshIds]].


   :rtype: void

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

setOpacity
----------

.. js:method:: MeshInstanceData.setOpacity( faceOpacity)

   :param faceOpacity: opacity value to set.
   :type faceOpacity: number


   Sets the face opacity for this instance.


   :rtype: void

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

setOverlayIndex
---------------

.. js:method:: MeshInstanceData.setOverlayIndex( overlayIndex)

   :param overlayIndex: overlay index to set.
   :type overlayIndex: number


   Sets the overlay index for this instance but doesn't change the associated view.

   :deprecated: use [[overlayId]] instead.


   :rtype: void

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

setPointColor
-------------

.. js:method:: MeshInstanceData.setPointColor( pointColor)

   :param pointColor: the color to apply to point elements.
   :type pointColor: Color


   Sets the color for point elements in this instance.


   :rtype: void

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

setPointOpacity
---------------

.. js:method:: MeshInstanceData.setPointOpacity( pointOpacity)

   :param pointOpacity: opacity value to set.
   :type pointOpacity: number


   Sets the point opacity for this instance.


   :rtype: void

