.. role:: ts-api-decorator

#################
QueryResultMinMax
#################

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

.. container:: ts-api-section

   .. js:class:: QueryResultMinMax

      Query min/max items for a result based on the currently loaded states or a single state. Optionally
      you can also query global min/max values for all states in the CAE model.

      You can query scalar, vector and displacement results, and the query supports all four result mappings: 
      Per node, per element, per element node and per element surface.

      The query for minimumItem and maximumItem applies default to the currently loaded states 
      (as specified in the ModelSpec.stateIdArray). It can however query results that are not currently 
      loaded on the server (not already mapped on the model). The results will be loaded if needed on the 
      server, but no new states will be loaded. If limitMinMaxItemsToFrameIndex is >= 0, the query will 
      compute the minimumItem and maximumItem only from the state at the specified frame index, and not 
      from the currently loaded states.

      The query for minimumItem and maximumItem can be limited to the currently visible parts by using the 
      executeQueryVisibleParts() method, or to a specific part by using the executeQueryForPart() method.

      In addition to queries for minimumItem and maximumItem, you can also get global min/max results 
      for all states (perStateGlobalMinMax, globalMinimumValue, globalMaximumValue). If 
      includeResultMinMaxForAllStates is set to true, you will in addition to whatever was specified for 
      the min/max items get global min/max for all states. Note these results are global and do not take 
      any filtering, visibility or specific part or frame index into consideration).

      The callback for ``executeQuery``, ``executeQueryVisibleParts`` and ``executeQuerySinglePart`` 
      will return the data in an ``QueryResultMinMaxData`` object.



.. container:: api-index-section

   .. rubric:: Constructors

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

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



.. container:: api-index-section

   .. rubric:: Accessors

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

   * :js:attr:`~cee.ug.QueryResultMinMax.includeResultMinMaxForAllStates`
   * :js:attr:`~cee.ug.QueryResultMinMax.limitMinMaxItemsToFrameIndex`



.. container:: api-index-section

   .. rubric:: Methods

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

   * :js:meth:`~cee.ug.QueryResultMinMax.executeQuery`
   * :js:meth:`~cee.ug.QueryResultMinMax.executeQuerySinglePart`
   * :js:meth:`~cee.ug.QueryResultMinMax.executeQueryVisibleParts`





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

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

.. container:: ts-api-section

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

      :param model: None
      :type model: RemoteModel


      :rtype: QueryResultMinMax



Accessors
=========

.. container:: ts-api-section

   .. js:function:: QueryResultMinMax.includeResultMinMaxForAllStates()



      Include global minimum and maximum values for all states.

      If set to true, the query will return an array with the per state global min/max for all states 
      in the database. For this the server will query the result file reader, and the min/max will be 
      the global min/max for each state, not taking any filtering (e.g. sets) into account. 
      The computeFromVisibleParts and query executeQueryForPart will also be ignored for the 
      global min/max and per state info.


      :rtype: boolean

   .. js:function:: QueryResultMinMax.includeResultMinMaxForAllStates( includeGlobalMinMaxForAllStates)

      :param includeGlobalMinMaxForAllStates: None
      :type includeGlobalMinMaxForAllStates: boolean


      :rtype: void



.. container:: ts-api-section

   .. js:function:: QueryResultMinMax.limitMinMaxItemsToFrameIndex()



      Optionally limit the returned QueryResultMinMaxDataItem.minimumItem and maximumItem to be computed
      from only the state in the frame with the given frame index.

      If set to a value >= 0, the query will only consider the state with the given frame index when 
      computing the minimumItem and maximumItem. 

      Default value is -1, which means that all frames will be queried.


      :rtype: number

   .. js:function:: QueryResultMinMax.limitMinMaxItemsToFrameIndex( frameIndex)

      :param frameIndex: None
      :type frameIndex: number


      :rtype: void



Methods
=======

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

executeQuery
------------

.. js:method:: QueryResultMinMax.executeQuery( resultId, resultType, callback)

   :param resultId: None
   :type resultId: number
   :param resultType: None
   :type resultType: ResultType
   :param callback: None
   :type callback: QueryResultMinMaxCallback


   Executes the query for the given result

   The minimumItem/maximumItem will contain min/max for all the parts in the loaded state(s).

   Note: If includeResultMinMaxForAllStates is set to true, the data in QueryResultMinMaxData.perStateGlobalMinMax 
   and globalMinimumValue/globalMaximumValue will contain data for all states in the model, not only the loaded ones.


   :rtype: void

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

executeQuerySinglePart
----------------------

.. js:method:: QueryResultMinMax.executeQuerySinglePart( resultId, resultType, geometryIndex, partId, callback)

   :param resultId: None
   :type resultId: number
   :param resultType: None
   :type resultType: ResultType
   :param geometryIndex: None
   :type geometryIndex: number
   :param partId: None
   :type partId: number
   :param callback: None
   :type callback: QueryResultMinMaxCallback


   Executes the query for only one part

   The minimumItem/maximumItem will contain min/max for the specified part in the loaded state(s).

   Note: If includeResultMinMaxForAllStates is set to true, the data in QueryResultMinMaxData.perStateGlobalMinMax 
   and globalMinimumValue/globalMaximumValue will still be for the whole model.


   :rtype: void

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

executeQueryVisibleParts
------------------------

.. js:method:: QueryResultMinMax.executeQueryVisibleParts( resultId, resultType, callback)

   :param resultId: None
   :type resultId: number
   :param resultType: None
   :type resultType: ResultType
   :param callback: None
   :type callback: QueryResultMinMaxCallback


   Executes the query for for all visible items in the scene

   The minimumItem/maximumItem will contain min/max for the visible parts and element sets in the loaded state(s).

   Note: If includeResultMinMaxForAllStates is set to true, the data in QueryResultMinMaxData.perStateGlobalMinMax 
   and globalMinimumValue/globalMaximumValue will still be for the whole model.


   :rtype: void

