.. role:: ts-api-decorator

####################
QueryBulkCalculation
####################

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

.. container:: ts-api-section

   .. js:class:: QueryBulkCalculation

      Calculation of bulk values from cutting planes and visible surfaces of parts.

      The following values are computed on the cutting plane/part surface:

      - Scalar value: Min/Max/Average/Resultant(sum of Area*EltResult for all surface elements).
      - Geometry:     Area, surface (triangle) count, node count, surface centroid.

      For scalar results, a per element result (maybe interpolated) is used for the calculations.

      For vector results, a dot product between the per element vector result (maybe interpolated) and the 
      surface normal is used to compute the scalar value for the element. This is then used to compute
      min/max/avg/resultant. This will enable computation of flux/flow through the surface.
 
      Note that bulk calculations can be performed on any result, not only the ones currently
      mapped on the model/cutting plane. 

      For cutting planes, bulk values will be calculated per region, causing one cutting plane to 
      provide more than one region if it consists of two separate spacial regions.



.. container:: api-index-section

   .. rubric:: Constructors

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

   * :js:meth:`~cee.ug.QueryBulkCalculation.constructor`



.. container:: api-index-section

   .. rubric:: Accessors

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

   * :js:attr:`~cee.ug.QueryBulkCalculation.includeRegionTriangles`



.. container:: api-index-section

   .. rubric:: Methods

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

   * :js:meth:`~cee.ug.QueryBulkCalculation.executeCuttingPlaneQuery`
   * :js:meth:`~cee.ug.QueryBulkCalculation.executePartQuery`





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

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

.. container:: ts-api-section

   .. js:function:: QueryBulkCalculation.constructor( model)

      :param model: None
      :type model: RemoteModel


      :rtype: QueryBulkCalculation



Accessors
=========

.. container:: ts-api-section

   .. js:function:: QueryBulkCalculation.includeRegionTriangles()



      Specify if the cutting plane queries should include triangle tessellation for each reg


      :rtype: boolean

   .. js:function:: QueryBulkCalculation.includeRegionTriangles( includeTriangles)

      :param includeTriangles: None
      :type includeTriangles: boolean


      :rtype: void



Methods
=======

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

executeCuttingPlaneQuery
------------------------

.. js:method:: QueryBulkCalculation.executeCuttingPlaneQuery( frameIndex, cuttingPlaneId, resultType, resultId, callback)

   :param frameIndex: None
   :type frameIndex: number
   :param cuttingPlaneId: None
   :type cuttingPlaneId: number
   :param resultType: None
   :type resultType: ResultType
   :param resultId: None
   :type resultId: number
   :param callback: None
   :type callback: QueryBulkCalculationCallback


   Executes the query for the given cutting plane.

   The query will return bulk values for each region of the cutting plane. The cutting plane will
   be split into one region for each part, and also further split if the cutting plane for one part
   consists of two or more spatially separate regions.

   Supported result types are: ResultType.SCALAR and ResultType.VECTOR


   :rtype: void

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

executePartQuery
----------------

.. js:method:: QueryBulkCalculation.executePartQuery( frameIndex, geometryIndex, partId, resultType, resultId, callback)

   :param frameIndex: None
   :type frameIndex: number
   :param geometryIndex: None
   :type geometryIndex: number
   :param partId: None
   :type partId: number
   :param resultType: None
   :type resultType: ResultType
   :param resultId: None
   :type resultId: number
   :param callback: None
   :type callback: QueryBulkCalculationCallback


   Executes the query for the given part.

   The bulk values are computed based on the elements referenced by the visible surfaces of the part.
 
   This query will provide one QueryBulkCalculationValues object with the bulk  values for this part.

   Supported result types are: ResultType.SCALAR and ResultType.VECTOR


   :rtype: void

