# cee::ug::ResultsQueryResultPosition

class `ResultsQueryResultPosition`

  A ResultsQueryResultPosition object contains the position and the ResultsQueryResult of a specific value.

  It holds the part id and the item id (node or element). If node/element don’t have ids, the index is used instead.

  For node results -> the position is the node coordinate For element, element node or element surface results -> the position is the element centroid

  For node result -> the reference value is the node result For element result -> the reference value is the element result For element node/element surface -> the reference value is the average in the element

  Example:

      ResultsQuery query(dataSource.get()); // the ResultsQuery object that will fetch the result values

      // Use the individual container to request and receive the data from the ResultsQuery.
      ResultsQueryResultPosition minScalar;
      ResultsQueryResultPosition maxScalar;

      int scalarId = 1;
      int stateId = 2;
      size_t geoIndex = 0;

      query.minimumAndMaximumScalar(scalarId, stateId, geoIndex, &minScalar, &maxScalar); // Request the position of the min/max result

      // the to access the data in the container
      Vec3d positionSmallestScalar = minScalar.position();
      const double* referenceValue = minScalar.result(); // pointer to double

      std::vector<ResultsQueryResultPosition> queryMinValues;
      std::vector<ResultsQueryResultPosition> queryMaxValues;

      int itemCount = 5; // get the 5 highest values and the 5 lowest values of the given result id
      query.minimumScalars(itemCount, scalarId, stateId, geoIndex, &queryMinValues);
      query.maximumScalars(itemCount, scalarId, stateId, geoIndex, &queryMaxValues);

  Public Functions

  `ResultsQueryResultPosition`()

    Constructs and empty results query result position.

  `ResultsQueryResultPosition`(const ResultsQueryResultPosition &other)

    Constructs a result position as a copy of other.

  ResultsQueryResultPosition &`operator=`(const ResultsQueryResultPosition &other)

    Assigns other to this position and returns a reference to this position.

  bool `operator==`(const ResultsQueryResultPosition &other) const

    Returns true if two result positions are equal.

  void `initialize`(Vec3d position, const double *resultData, size_t dimension, int partId, int itemId, ResultMapping mapping)

    Initializes this position with the given parameters.

  double `scalar`() const

    Returns the scalar value.

  Vec3d `vector`() const

    Returns the vector.

  SymmetricTensor `tensor`() const

    Returns the tensor.

  const double *`rawValuePointer`() const

    Returns a raw pointer to the result positions.

  void `setRawPointer`(const double *resultData, size_t dataSize)

    Sets the result data as a raw pointer.

  size_t `resultSize`() const

    Returns the size of the result.

  Vec3d `position`() const

    Returns the node coordinate position or element centroid depending on the result mapping type.

  void `setPosition`(const Vec3d &position)

    Sets the position.

  int `partId`() const

    Returns the part id.

    Returns index if part has no id

  void `setPartId`(int partId)

    Sets the part id.

  int `itemId`() const

    Returns the item id.

    Returns index if node/element has no ids

  void `setItemId`(int itemId)

    Sets the item id.

  ResultMapping `mapping`() const

    Returns the result mapping type.

  void `setMapping`(ResultMapping mapping) const

    Sets the results mapping type.

  ResultType `type`() const

    Returns the result type.

Conversation saved
HOOPSY BETA

### Hello! I'm HOOPSY

Your Docs generative AI assistant. Ask me anything about HOOPS Envision for Desktop or choose a sample question below to start a conversation:

What is HOOPS Envision for Desktop?
What are the latest release notes for HOOPS Envision for Desktop?
How do I start evaluating HOOPS Envision for Desktop?
How do I write my first sample application?
How can I get assistance?

HOOPSY may store conversations according to OpenAI's policy. Responses may not always be accurate.

HOOPSY is thinking...