# cee::ug::Isovolume

class `Isovolume` : public RefCountedObject

  Configuration of an isovolume.

  An isovolume is defined as the combined volume of the element model where the scalar field is between a given minimum and maximum value. The surface of the isovolume will be the hull of this volume. Any element on the border of the model (a surface with no neighbor) is also included in the volume if if the value of that surface is in the given range.

  See the tutorial: UnstructGrid: Create an Isovolume

  Isovolumes may be computed from any scalar result. In addition, another scalar result can be mapped as fringes onto the isovolume, showing for instance the variation of temperature over a volume of a given min and max pressure.

  The most common application of isovolumes are to show free surfaces or filling of CFD or molding application.

  Any number of isovolumes can be defined and displayed, and various display attributes can be set separately for each one.

  - Volume definition An isovolume is defined by a scalar result id (setIsoScalarResultId()) and a minimum and maximum iso scalar value (setMinimumIsoValue() and setMaximumIsoValue()).
  - Modes As for normal parts, isovolumes can also be set visible/invisible, be highlighted, apply draw styles, opacity and color.
  - Result mapping An additional scalar and vector result can be mapped on the isovolume.
    - Fringes

      Show scalar fringes on an isovolume using

      setMapScalarResultId() with the requested scalar result id.
    - Vectors

      Show a vector result mapped on the isovolume using

      setMapVectorResultId() with the requested vector result id.

  Example

  This example shown how to create an isovolume with scalar result mapped on the volume.

  Sets the fourth state as current in the model specification. (The displacement is zero in the first state.)

      std::vector<cee::ug::StateInfo> stateInfos = source->directory()->stateInfos();
      int stateId = stateInfos[3].id();
      ugModel->modelSpec().setStateId(stateId);

  Create the isovolume object. Remember that the object is reference counted and should not be created on the stack.

  The isovolume is defined by a scalar result id and a minimum and maximum iso scalar value.

  Specifies the result id and the result value to use for defining the isovolume. Use the scalar result with id = 7 (All displacements) and the iso scalar value = 6,5.

      cee::PtrRef<cee::ug::Isovolume> isoVolume = new cee::ug::Isovolume();
      int scalarId = resultInfos[0].id();
      isoVolume->setIsoScalarResultId(scalarId);
      isoVolume->setMinimumIsoValue(5.5);
      isoVolume->setMaximumIsoValue(7.5);

  Sets the scalar result to be shown as mapped fringes on the isovolume volume.

      isoVolume->setMapScalarResultId(scalarId);

  Adds the isovolume to the model.

      ugModel->addIsovolume(isoVolume.get());

  To get a better view of the cutting plane inside the model, set all normal parts draw style to LINES.

      cee::ug::PartSettingsIterator it(ugModel.get());
      while (it.hasNext())
      {
          cee::ug::PartSettings* partSettings = it.next();
          partSettings->setDrawStyle(cee::ug::PartSettings::OUTLINE);
      }

  See the complete source code at: UnstructGrid: Create an Isovolume

  Tutorials UnstructGrid: Create an Isovolume

  See also

  UnstructGridModel

  Public Types

  enum `DrawStyle`

    Isovolume surface draw styles

    Values:

    enumerator `SURFACE`

      Draw as surface.

    enumerator `SURFACE_MESH`

      Draw as surface mesh.

    enumerator `SURFACE_OUTLINE_MESH`

      Draw as outline mesh

    enumerator `LINE`

      Draw as lines.

    enumerator `OUTLINE`

      Draw as outline.

  Public Functions

  `Isovolume`()

    Constructs an empty isovolume object.

  bool `visible`() const

    Returns true if the isovolume (and optional mapped vectors) is drawn.

  void `setVisible`(bool visible)

    Specifies if the isovolume (and optional mapped vectors) should be drawn or not.

  bool `highlight`() const

    Returns true if current isovolume is highlighted.

  void `setHighlight`(bool showHighlighted)

    Toggles isovolume highlighting.

  bool `volumeGeometryVisible`() const

    Returns true if the isovolume itself should be drawn.

    Even if this returns false, the mapped vectors will still be drawn. To hide the isovolume and the vectors, use the setVisible() method.

  void `setVolumeGeometryVisible`(bool show)

    Specifies if the geometry of the isovolume should be drawn or not.

    Even if this is set to false, the mapped vectors will still be drawn. To hide the isovolume and the vectors, use the setVisible() method.

  DrawStyle `drawStyle`() const

    Returns the current draw style of the isovolume.

  void `setDrawStyle`(DrawStyle drawStyle)

    Sets the draw style of the isovolume.

  Color3f `volumeColor`() const

    Returns the color of the isovolume if no result is mapped onto the volume.

  void `setVolumeColor`(const Color3f &color)

    Sets the color of the volume.

  float `opacity`() const

    Returns the opacity of the isovolume.

    1.0 is opaque and 0.0 is fully transparent (invisible)

  void `setOpacity`(float opacity)

    Sets the opacity of the isovolume.

    1.0 is opaque and 0.0 is fully transparent (invisible)

  float `specularIntensity`() const

    Returns the specular intensity set for this isovolume.

  void `setSpecularIntensity`(float intensity)

    Sets the specular intensity to use for this isovolume.

    The specular intensity control the highlight and reflection of the light onto the part. The light is white, so this will cause the color of the part to get more white in the parts that reflect the light source.

    Default is 0.5. Legal range is 0.0 -> 1.0, where 0.0 turns off the specular highlight.

  double `minimumIsoValue`() const

    Returns the minimum iso scalar value of the volume.

  void `setMinimumIsoValue`(double value)

    Sets the minimum iso scalar value for the volume.

    An isovolume is defined by a minimum and a maximum scalar value and a scalar result.

    See also

    setIsoScalarResultId()

  double `maximumIsoValue`() const

    Returns the maximum iso scalar value of the volume.

  void `setMaximumIsoValue`(double value)

    Sets the maximum iso scalar value for the volume.

    An isovolume is defined by a minimum and a maximum scalar value and a scalar result.

    See also

    setIsoScalarResultId()

  int `isoScalarResultId`() const

    Returns the id of the current iso scalar result.

  void `setIsoScalarResultId`(int resultId)

    Sets the result defining the isovolume.

    An isovolume is defined by a scalar result, a minimum iso value and a maximum iso value.

  bool `computeFromVisibleParts`() const

    Returns true if the isovolume only will be computed from the currently visible parts.

  void `setComputeFromVisibleParts`(bool visiblePartsOnly)

    Sets if the isovolume should be computed from only the visible parts or not.

    If set to true, only the parts that are visible will contribute to the isovolume.

  int `mapScalarResultId`() const

    Returns the id of the scalar result currently mapped on the volume.

    Returns -1 if none.

  void `setMapScalarResultId`(int resultId)

    Sets the scalar result to be mapped on the volume.

    Set resultId to -1 to clear the mapped scalar result.

  int `mapVectorResultId`() const

    Returns the id of the vector result currently mapped on the volume.

    Returns -1 if none.

  void `setMapVectorResultId`(int resultId)

    Sets the vector result to be mapped on the volume.

    Set resultId to -1 to clear the mapped scalar result.

  Image *`textureImage`() const

    Returns the texture image mapped on the isovolume.

    NULL if no texture mapping is used.

    See also

    setTextureImage

  void `setTextureImage`(Image *image)

    Sets a texture to map on the isovolume surface.

    If not NULL, this image will be used as a texture mapped on the isovolume surface.

    To disable texturing, call with NULL as a parameter.

    See also

    setTextureEnvironmentMapping

  bool `textureEnvironmentMapping`() const

    Returns true if environment mapping is used for the current texture.

    See also

    setTextureEnvironmentMapping

  void `setTextureEnvironmentMapping`(bool useEnvironmentMapping)

    Enables/disables use of environment mapping for the texture on the isovolume surface.

  bool `isPrecomputed`() const

    Returns true if the isovolume is precomputed.

    Precomputed isovolumes cannot be altered or moved.

  double `sampleScalarValue`(int stateId, const Vec3d &samplePosition, size_t triangleIndex = cee::UNDEFINED_SIZE_T) const

    Returns the scalar value on the isovolume at the given coordinate in the given state.

    triangleIndex is optional and will speed up the lookup if provided. This corresponds to the cee::ug::HitItem::triangleIndex() value.

    Returns cee::UNDEFINED_DOUBLE if no value was found.

  Vec3d `sampleVector`(int stateId, const Vec3d &samplePosition, size_t triangleIndex = cee::UNDEFINED_SIZE_T) const

    Returns the vector value on the isovolume at the given coordinate in the given state.

    triangleIndex is optional and will speed up the lookup if provided. This corresponds to the cee::ug::HitItem::triangleIndex() value.

    Returns a Vec3d with x, y, and z set to cee::UNDEFINED_DOUBLE if no vector values was found.

  void `data`(int stateId, IsovolumeData *data) const

    Returns the data (triangles, vertices, results) of the isovolume in the given state.

    See also

    IsovolumeData

Conversation saved
HOOPSY BETA

### Hello! I'm HOOPSY

Your multilingual generative AI assistant for documentation. Ask me anything about HOOPS Envision for Desktop in your own language, 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...