.. role:: ts-api-decorator

#######
HitItem
#######

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

.. container:: ts-api-section

   .. js:class:: HitItem

      Interface for an object describing the result of a picking action on a ``RemoteModel``.

      This object is provided to the ``RayIntersectCallback``.



.. container:: api-index-section

   .. rubric:: Properties

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

   * :js:attr:`~cee.ug.HitItem.anythingHit`
   * :js:attr:`~cee.ug.HitItem.elementArea`
   * :js:attr:`~cee.ug.HitItem.elementEdgeIndex`
   * :js:attr:`~cee.ug.HitItem.elementFaceIndex`
   * :js:attr:`~cee.ug.HitItem.elementId`
   * :js:attr:`~cee.ug.HitItem.elementIndex`
   * :js:attr:`~cee.ug.HitItem.elementNodeIndex`
   * :js:attr:`~cee.ug.HitItem.elementNodeResult`
   * :js:attr:`~cee.ug.HitItem.elementResult`
   * :js:attr:`~cee.ug.HitItem.elementResultIsInterpolated`
   * :js:attr:`~cee.ug.HitItem.elementTriangleVertices`
   * :js:attr:`~cee.ug.HitItem.elementType`
   * :js:attr:`~cee.ug.HitItem.elementVolume`
   * :js:attr:`~cee.ug.HitItem.frameIndex`
   * :js:attr:`~cee.ug.HitItem.geometryIndex`
   * :js:attr:`~cee.ug.HitItem.intersectionPoint`
   * :js:attr:`~cee.ug.HitItem.intersectionPointNormal`
   * :js:attr:`~cee.ug.HitItem.intersectionPointResult`
   * :js:attr:`~cee.ug.HitItem.nodeId`
   * :js:attr:`~cee.ug.HitItem.nodeIndex`
   * :js:attr:`~cee.ug.HitItem.nodePosition`
   * :js:attr:`~cee.ug.HitItem.nodeResult`
   * :js:attr:`~cee.ug.HitItem.nodeResultIsInterpolated`
   * :js:attr:`~cee.ug.HitItem.objectId`
   * :js:attr:`~cee.ug.HitItem.objectIndex`
   * :js:attr:`~cee.ug.HitItem.objectName`
   * :js:attr:`~cee.ug.HitItem.objectType`
   * :js:attr:`~cee.ug.HitItem.scalarResultName`





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

Properties
==========

.. container:: ts-api-section

   .. js:attribute:: HitItem.anythingHit

      :type: boolean

      Whether anything was hit during the action. If false, the other properties in this object will be undefined.



.. container:: ts-api-section

   .. js:attribute:: HitItem.elementArea

      :type: number

      The area of the element (if applicable)



.. container:: ts-api-section

   .. js:attribute:: HitItem.elementEdgeIndex

      :type: number

      The local index (zero based) of the closest element edge to the actual intersection point in the data model on the server that was hit



.. container:: ts-api-section

   .. js:attribute:: HitItem.elementFaceIndex

      :type: number

      The local index (zero based) of the element face that was hit



.. container:: ts-api-section

   .. js:attribute:: HitItem.elementId

      :type: number

      The id of the element in the data model on the server that was hit



.. container:: ts-api-section

   .. js:attribute:: HitItem.elementIndex

      :type: number

      The index (zero based) of the element in the data model on the server that was hit



.. container:: ts-api-section

   .. js:attribute:: HitItem.elementNodeIndex

      :type: number

      The local index (zero based) of the closest element node to the actual intersection point in the data model on the server that was hit



.. container:: ts-api-section

   .. js:attribute:: HitItem.elementNodeResult

      :type: number

      The scalar result in the closest element node. Only defined if the current result is per element node



.. container:: ts-api-section

   .. js:attribute:: HitItem.elementResult

      :type: number

      The scalar result in the element that was hit.



.. container:: ts-api-section

   .. js:attribute:: HitItem.elementResultIsInterpolated

      :type: boolean

      Whether the element result is interpolated (e.g. from a nodal result). False if the result is an actual per element result.



.. container:: ts-api-section

   .. js:attribute:: HitItem.elementTriangleVertices

      :type: [number]

      A tessellation of triangles of the element that was hit. 

      This array contains x,y,z values for each triangle vertex. So there will be 9 values (3 vertices * (x,y,z)) per triangle.
      This can be used to highlight the selected element using the geometry or the markup model.



.. container:: ts-api-section

   .. js:attribute:: HitItem.elementType

      :type: string

      The type of the element in the data model on the server that was hit, for example 'Quad', 'Tetrahedron', 'Hexahedron'



.. container:: ts-api-section

   .. js:attribute:: HitItem.elementVolume

      :type: number

      The volume of the element (if applicable)



.. container:: ts-api-section

   .. js:attribute:: HitItem.frameIndex

      :type: number

      The index of the frame in which the picking occurred. This is 0 unless there is an animation.



.. container:: ts-api-section

   .. js:attribute:: HitItem.geometryIndex

      :type: number

      The index of the CAE geometry.

      In almost all cases this will be 0. If using a partially adaptive model with remeshing only on parts of the model (e.g. in a Forging process) 
      the concept of multiple geometries might be relevant.



.. container:: ts-api-section

   .. js:attribute:: HitItem.intersectionPoint

      :type: Vec3

      The 3d point (in world coordinates) on the surface that was hit. 

      This is the actual point that was hit



.. container:: ts-api-section

   .. js:attribute:: HitItem.intersectionPointNormal

      :type: Vec3

      The normal of the surface at the point where the surface was hit.



.. container:: ts-api-section

   .. js:attribute:: HitItem.intersectionPointResult

      :type: number

      The interpolated scalar result in the ``intersectionPoint``.



.. container:: ts-api-section

   .. js:attribute:: HitItem.nodeId

      :type: number

      The id of the closest node to the actual intersection point in the data model on the server that was hit



.. container:: ts-api-section

   .. js:attribute:: HitItem.nodeIndex

      :type: number

      The index (zero based) of the closest node to the actual intersection point in the data model on the server that was hit



.. container:: ts-api-section

   .. js:attribute:: HitItem.nodePosition

      :type: Vec3

      The 3d point (in world coordinates) of the closest node as identified by nodeId/nodeIndex

      Use intersectionPoint for the actual point on the model that was hit



.. container:: ts-api-section

   .. js:attribute:: HitItem.nodeResult

      :type: number

      The scalar result in the closest node as indicated by ``nodeId``/``nodeIndex``.



.. container:: ts-api-section

   .. js:attribute:: HitItem.nodeResultIsInterpolated

      :type: boolean

      Whether the node result is interpolated (e.g. from a per element result). False if the result is an actual per node result.



.. container:: ts-api-section

   .. js:attribute:: HitItem.objectId

      :type: number

      The id of the object (part/iso/cut/isovol) that was hit



.. container:: ts-api-section

   .. js:attribute:: HitItem.objectIndex

      :type: number

      The index of the object (part/iso/cut/isovol) that was hit



.. container:: ts-api-section

   .. js:attribute:: HitItem.objectName

      :type: string

      The name of the object (part/iso/cut/isovol) that was hit



.. container:: ts-api-section

   .. js:attribute:: HitItem.objectType

      :type: ObjectType

      The type of object (part/iso/cut/isovol) that was hit



.. container:: ts-api-section

   .. js:attribute:: HitItem.scalarResultName

      :type: string

      The name of the scalar that the results ``elementResult`` and ``nodeResult`` apply to.



