# cee::ug::VectorSettings

class `VectorSettings` : public RefCountedObject

  Settings for a specific vector result.

  See topic Vector Results

  A vector result is a collection of vector values which are mapped on a part per node, per element, per element node or per element surface.

  The vector result has various settings that can be configured to make a better visual appearance of your result data, for instance scaling and color mode. Each vector result has its own settings. Get vector settings for a specific vector result by calling UnstructGridModel::vectorSettings() with the requested id.

      int vectorId = vectorResultInfos[0].id();
      cee::ug::VectorSettings* settings = ugModel->vectorSettings(vectorId);

  Scaling

  The vector result can be scaled to enhance the visual representation. The scaling can be either absolute or relative. Check current scale mode with scaleMode(). Set the scaling factor with setScaleFactor() with a scaling factor and an enumerator telling whether the scaling should be relative or absolute. Get current scaling factor with scaleFactor().

  Colors

  The vector can be colored either by a single color (ColorMode::SINGLE), by the scalar value in the mapped scalar result (ColorMode::COLOR_BY_FRINGES), or by the scalar value referenced by the provided scalar result ID (ColorMode::COLOR_BY_MAP_SCALAR. Set color mode with setColorMode() and get current color mode with colorMode(). Set the single vector color with setSingleVectorColor() and get current vector color with singleVectorColor().

  Clamping

  The length of the vectors (for all non-zero vectors) can be clamped into a given range. By enabling clamping with setClampingRange() all vectors will be drawn with the minimum length of clampingRangeMin() and the maximum length of clampingRangeMax(). One use case for this could be specify the same amount for clamp min and max (thus making all the vectors equal in length) to indicate the orientation of a vector field. Then coloring the vectors by a scalar (e.g. magnitude) could be used to indicate the intensity of the vector field for each arrow.

  Example

  This example will set the relative scaling for the current vector result and set a single vector color.

  Gets the vector setting for the vector result shown on the model

      int vectorId = vectorResultInfos[0].id();
      cee::ug::VectorSettings* settings = ugModel->vectorSettings(vectorId);

  Sets number relative scaling to 0.2.

      settings->setScaleFactor(cee::ug::VectorSettings::RELATIVE_SCALING, 0.2);

  Sets the single vector color to yellow.

      settings->setSingleVectorColor(cee::Color3f(1.0, 1.0, 0.0));

  See the complete source code at: UnstructGrid: Set Vector Settings on a Loaded Model

  See also

  ModelSpec and UnstructGridModel

  Public Types

  enum `ColorMode`

    List of vector color modes.

    Values:

    enumerator `SINGLE`

      Single vector color.

    enumerator `COLOR_BY_FRINGES`

      Color vector by scalar fringes.

    enumerator `COLOR_BY_MAP_SCALAR`

      Color vector by specified scalar result ID.

  enum `ScaleMode`

    List of vector scaling modes.

    Values:

    enumerator `ABSOLUTE_SCALING`

      Absolute scaling of vectors.

    enumerator `RELATIVE_SCALING`

      Scales vectors relative to model extent.

  enum `DrawMode`

    List of vector draw modes.

    Values:

    enumerator `NORMAL`

      3D primitive with shading

    enumerator `SIMPLE`

      Simple and unlit geometry.

  enum `VectorType`

    List of vector visualization types.

    Values:

    enumerator `ARROW`

      A standard vector arrow.

    enumerator `SYMMETRIC_ARROW`

      A vector centered in the node/vertex, with arrow heads pointing outwards in both directions.

    enumerator `REVERSE_SYMMETRIC_ARROW`

      A vector centered in the node/vertex, with arrow heads pointing inward in both directions.

  Public Functions

  ScaleMode `scaleMode`() const

    Returns current scale mode.

  double `scaleFactor`() const

    Returns scale factor.

    If anisotropic scaling is used, undefined is returned.

    See also

    scaleMode() and setScaleFactor()

  void `setScaleFactor`(ScaleMode mode, double scaleFactor)

    Sets the scale factor to apply to vectors.

    If the scale mode is RELATIVE_SCALING, vectors will be scaled relative to model extent using the specified factor. If mode is ABSOLUTE_SCALING the vectors will be scaled using scaleFactor regardless of model extent. If anisotropic scaling was previously set, the anisotropicScaleFactor will return undefined in favor of this uniform scale factor.

  Vec3d `anisotopicScaleFactor`() const

    Returns the anisotropic scale factor.

    Will return undefined if scaleFactor is set instead.

    See also

    scaleMode() and setAnisotropicScaleFactor()

  void `setAnisotropicScaleFactor`(ScaleMode mode, const Vec3d &anisotopicScaleFactor)

    Sets the anisotropic scale factor to apply to each vector result component.

    If the scale mode is RELATIVE_SCALING, vector components will be scaled relative to model extent using the specified component factors. If mode is ABSOLUTE_SCALING the vector components will be scaled using anisotropicScaleFactor regardless of model extent. If the uniform scaleFactor was previously set, it will return undefined in favor of this anisotropic scale factor.

  bool `resultInLocalCoordinates`() const

    Returns true if the vector result is defined in local coordinates and will follow the part transformations (default true).

  void `setResultInLocalCoordinates`(bool localCoordinates)

    Sets if the vector result is specified in local coordinates (true) or world coordinates (false).

    If local coordinates (default), the vector results will be transformed with the current part transformation matrix. If world coordinates, the direction of the vector result will not be changed by the part transformation matrix.

  ColorMode `colorMode`() const

    Returns the current color mode.

  void `setColorMode`(ColorMode colorMode)

    Sets the color mode for the vector coloring.

    Available modes are:

    - SINGLE: Uses a single color for all vectors
    - COLOR_BY_FRINGES: Uses the color for the mapped scalar result.
    - COLOR_BY_MAP_SCALAR: Uses the specified scalar result ID to color vectors
  Color3f `singleVectorColor`() const

    Returns the single vector color.

  void `setSingleVectorColor`(const Color3f &color)

    Sets the single vector color to apply to all vectors in the result.

  int `mapScalarResultId`() const

    Returns the scalar ID used for coloring the vectors.

  void `setMapScalarResultId`(int scalarId)

    Sets the scalar ID to use for coloring the vectors.

  int `simpleVectorLineWidth`() const

    Returns the line width used when drawing DrawMode::SIMPLE vectors.

    See also

    setDrawMode

  void `setSimpleVectorLineWidth`(int width)

    Sets the line width used when drawing DrawMode::SIMPLE vectors.

    See also

    setDrawMode

  int `simpleVectorNullVectorPointSize`() const

    Returns the point size used when drawing DrawMode::SIMPLE null-vectors.

    See also

    setDrawMode

  void `setSimpleVectorNullVectorPointSize`(int size)

    Sets the point size used when drawing DrawMode::SIMPLE null-vectors.

    See also

    setDrawMode

  VectorType `vectorType`() const

    Returns the current vector type.

  void `setVectorType`(VectorType vectorType)

    Sets the vector type.

    Available modes are:

    - ARROW: A standard vector arrow
    - SYMMETRIC_ARROW: A vector centered in the node/vertex, with arrow heads pointing outwards in both directions
    - REVERSE_SYMMETRIC_ARROW: A vector centered in the node/vertex, with arrow heads pointing inward in both directions
  DrawMode `drawMode`() const

    Returns the current draw mode.

  void `setDrawMode`(DrawMode mode)

    Sets the draw mode.

    Available modes are:

    - NORMAL: Draw using a more complex 3D model with shading.
    - SIMPLE: Draw using an unlit and simple geometry.
  bool `drawNullVectors`() const

    Returns true if null-vectors are drawn or not.

  void `setDrawNullVectors`(bool draw)

    Sets if to draw the null-vectors or not.

    A null-vector has no (zero) length The null-vectors are drawn as singularities either as points or spheres, dependent on the draw mode used.

    See also

    setDrawMode

  bool `showNodeAverageValues`() const

    If false (default) the result is shown as is computed.

    If true, a node averaged result will be shown that is derived from the original result.

  void `setShowNodeAverageValues`(bool showNodeAverageValues)

    Specify if the vector result should be shown as a node averaged result or not.

  double `arrowShaftRelativeRadius`() const

    Returns the radius of the vector arrow shaft relative to the vector length.

  void `setArrowShaftRelativeRadius`(double shaftRelativeRadius)

    Sets the radius of the vector arrow shaft as a fraction of the vector length.

    Default 0.025

  double `arrowHeadRelativeRadius`() const

    Returns the radius of the vector arrow head relative to the vector length.

  void `setArrowHeadRelativeRadius`(double headRelativeRadius)

    Sets the radius of the vector arrow head relative to the vector length.

    Default 0.085

  double `arrowHeadRelativeLength`() const

    Returns the length of the vector arrow head relative to the vector length.

  void `setArrowHeadRelativeLength`(double headRelativeLength)

    Sets the length of the vector arrow head relative to the vector length.

    Default 0.25

  bool `isClampingEnabled`() const

    Returns true if vector clamping is enabled.

    If enabled, the (non-zero length) vectors will be drawn with a length that is within the range given by the setClampingRange() method.

  double `clampingRangeMinimum`() const

    Returns the minimum length the (non-zero) vectors will be drawn as (if clamping is enabled)

    See also

    setClampingRange()

  double `clampingRangeMaximum`() const

    Returns the maximum length the (non-zero) vectors will be drawn as (if clamping is enabled)

    See also

    setClampingRange()

  void `setClampingRange`(double min, double max)

    Specifies the min and max length of the vectors to be drawn.

    The (non-zero) vectors will be drawn with a length that is within the given range.

  void `disableClamping`()

    Disables use of vector clamping.

  bool `isLengthFilteringEnabled`() const

    Returns true if vector filtering is enabled.

    If enabled, only the vectors with length in the specified range given by the setLengthFilteringRange() method will be drawn. All other vectors will be skipped.

  double `lengthFilteringMinimum`() const

    Returns the required min length of the vectors in order to be drawn.

  double `lengthFilteringMaximum`() const

    Returns the required max length of the vectors in order to be drawn.

  void `setLengthFilteringRange`(double min, double max)

    Specifies the required min and max length of the vectors in order to be drawn.

    Only vectors with the length in the given range will be drawn. All other vectors will be skipped.

  void `disableLengthFiltering`()

    Disables filtering of vectors. All vectors will be drawn.

  bool `showInteriorVectors`() const

    Returns whether interior vectors are shown or only those defined on the display model.

  void `setShowInteriorVectors`(bool show)

    Sets whether to show the vectors that are inside the display model or not.

  unsigned int `drawSkipBy`() const

    Returns the number of arrows to skip between each arrow that is drawn.

    Default is 0. Used to reduce the total amount of arrows.

  void `setDrawSkipBy`(unsigned int skipBy)

    Sets the number of arrows to skip between each arrow that is drawn.

    Default is 0. Used to reduce the total amount of arrows.

  size_t `drawMaximumCount`() const

    Returns maximum number of vector arrows to draw.

    If there are more vectors than specified with setDrawMaximumCount(), every n’th vector arrow will be skipped to reduce the number of arrows to within maximum count.

    When set to 0, all vectors will be drawn.

    Note! If setDrawSkipBy() is set to value other than 0, this skip by value will be used and maximum count ignored!

  void `setDrawMaximumCount`(size_t maximumCount)

    Sets the maximum number of vector arrows do draw.

    If there are more vectors than specified with setDrawMaximumCount(), every n’th vector arrow will be skipped to reduce the number of arrows to within maximum count.

    When set to 0, all vectors will be drawn.

    Note! If setDrawSkipBy() is set to value other than 0, this skip by value will be used and

  bool `projectVectorsOnSurface`() const

    Returns true if the vectors are projected onto the surface of the model.

    If true, all PER_NODE vectors are projected onto the surface using the surface normal in that point

  void `setProjectVectorsOnSurface`(bool project)

    Sets if the vectors should be projected onto the model surface or not.

    If project is true, all PER_NODE vectors are projected onto the surface using the surface normal in that point to define the plane to project onto.

    This works in the similar way to the CuttingPlane::setProjectVectorsOnPlane() method.

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...