cee::ug::VectorSettings Class Reference

Settings for a specific vector result. More...

Public Types

enum  ColorMode { SINGLE, COLOR_BY_FRINGES }
 List of vector color modes. More...
 
enum  ScaleMode { ABSOLUTE_SCALING, RELATIVE_SCALING }
 List of vector scaling modes. More...
 
enum  DrawMode { NORMAL, SIMPLE }
 List of vector draw modes. More...
 
enum  VectorType { ARROW, SYMMETRIC_ARROW, REVERSE_SYMMETRIC_ARROW }
 List of vector visualization types. More...
 

Public Member Functions

ScaleMode scaleMode () const
 Returns current scale mode. More...
 
double scaleFactor () const
 Returns scale factor. More...
 
void setScaleFactor (ScaleMode mode, double scaleFactor)
 Sets the scale factor to apply to vectors. More...
 
bool resultInLocalCoordinates () const
 Returns true if the vector result is defined in local coordinates and will follow the part transformations (default true). More...
 
void setResultInLocalCoordinates (bool localCoordinates)
 Sets if the vector result is specified in local coordinates (true) or world coordinates (false). More...
 
ColorMode colorMode () const
 Returns the current color mode. More...
 
void setColorMode (ColorMode colorMode)
 Sets the color mode for the vector coloring. More...
 
Color3f singleVectorColor () const
 Returns the single vector color. More...
 
void setSingleVectorColor (const Color3f &color)
 Sets the single vector color to apply to all vectors in the result. More...
 
int simpleVectorLineWidth () const
 Returns the line width used when drawing DrawMode::SIMPLE vectors. More...
 
void setSimpleVectorLineWidth (int width)
 Sets the line width used when drawing DrawMode::SIMPLE vectors. More...
 
VectorType vectorType () const
 Returns the current vector type. More...
 
void setVectorType (VectorType vectorType)
 Sets the vector type. More...
 
DrawMode drawMode () const
 Returns the current draw mode. More...
 
void setDrawMode (DrawMode mode)
 Sets the draw mode. More...
 
double arrowShaftRelativeRadius () const
 Returns the radius of the vector arrow shaft relative to the vector length. More...
 
void setArrowShaftRelativeRadius (double shaftRelativeRadius)
 Sets the radius of the vector arrow shaft as a fraction of the vector length. More...
 
double arrowHeadRelativeRadius () const
 Returns the radius of the vector arrow head relative to the vector length. More...
 
void setArrowHeadRelativeRadius (double headRelativeRadius)
 Sets the radius of the vector arrow head relative to the vector length. More...
 
double arrowHeadRelativeLength () const
 Returns the length of the vector arrow head relative to the vector length. More...
 
void setArrowHeadRelativeLength (double headRelativeLength)
 Sets the length of the vector arrow head relative to the vector length. More...
 
bool isClampingEnabled () const
 Returns true if vector clamping is enabled. More...
 
double clampingRangeMinimum () const
 Returns the minimum length the (non-zero) vectors will be drawn as (if clamping is enabled) More...
 
double clampingRangeMaximum () const
 Returns the maximum length the (non-zero) vectors will be drawn as (if clamping is enabled) More...
 
void setClampingRange (double min, double max)
 Specifies the min and max length of the vectors to be drawn. More...
 
void disableClamping ()
 Disables use of vector clamping. More...
 
bool isLengthFilteringEnabled () const
 Returns true if vector filtering is enabled. More...
 
double lengthFilteringMinimum () const
 Returns the required min length of the vectors in order to be drawn. More...
 
double lengthFilteringMaximum () const
 Returns the required max length of the vectors in order to be drawn. More...
 
void setLengthFilteringRange (double min, double max)
 Specifies the required min and max length of the vectors in order to be drawn. More...
 
void disableLengthFiltering ()
 Disables filtering of vectors. All vectors will be drawn. More...
 
bool showInteriorVectors () const
 Returns whether interior vectors are shown or only those defined on the display model. More...
 
void setShowInteriorVectors (bool show)
 Sets whether to show the vectors that are inside the display model or not. More...
 
unsigned int drawSkipBy () const
 Returns the number of arrows to skip between each arrow that is drawn. More...
 
void setDrawSkipBy (unsigned int skipBy)
 Sets the number of arrows to skip between each arrow that is drawn. More...
 
size_t drawMaximumCount () const
 Returns maximum number of vector arrows to draw. More...
 
void setDrawMaximumCount (size_t maximumCount)
 Sets the maximum number of vector arrows do draw. More...
 
- Public Member Functions inherited from cee::RefCountedObject
void addRef () const
 Increments the reference count for this object. More...
 
void release () const
 Decrements the reference count for this object. More...
 
int refCount () const
 Returns the reference count for this object. More...
 
void setRefCountZero () const
 Sets the ref count to zero, but DOES NOT delete the object. More...
 
Inheritance diagram for cee::ug::VectorSettings:
cee::RefCountedObject

Detailed Description

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) or by the scalar value in the mapped scalar result (ColorMode::COLOR_BY_FRINGES). 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.

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
UnstructGridModel

Member Enumeration Documentation

List of vector color modes.

Enumerator
SINGLE 

Single vector color.

COLOR_BY_FRINGES 

Color vector by scalar fringes.

List of vector draw modes.

Enumerator
NORMAL 

3D primitive with shading

SIMPLE 

Simple and unlit geometry.

List of vector scaling modes.

Enumerator
ABSOLUTE_SCALING 

Absolute scaling of vectors.

RELATIVE_SCALING 

Scales vectors relative to model extent.

List of vector visualization types.

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

Member Function Documentation

double cee::ug::VectorSettings::arrowHeadRelativeLength ( ) const

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

double cee::ug::VectorSettings::arrowHeadRelativeRadius ( ) const

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

double cee::ug::VectorSettings::arrowShaftRelativeRadius ( ) const

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

double cee::ug::VectorSettings::clampingRangeMaximum ( ) const

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

See also
setClampingRange()
double cee::ug::VectorSettings::clampingRangeMinimum ( ) const

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

See also
setClampingRange()
VectorSettings::ColorMode cee::ug::VectorSettings::colorMode ( ) const

Returns the current color mode.

void cee::ug::VectorSettings::disableClamping ( )

Disables use of vector clamping.

void cee::ug::VectorSettings::disableLengthFiltering ( )

Disables filtering of vectors. All vectors will be drawn.

size_t cee::ug::VectorSettings::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!

VectorSettings::DrawMode cee::ug::VectorSettings::drawMode ( ) const

Returns the current draw mode.

unsigned int cee::ug::VectorSettings::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.

bool cee::ug::VectorSettings::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.

bool cee::ug::VectorSettings::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 cee::ug::VectorSettings::lengthFilteringMaximum ( ) const

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

double cee::ug::VectorSettings::lengthFilteringMinimum ( ) const

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

bool cee::ug::VectorSettings::resultInLocalCoordinates ( ) const

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

double cee::ug::VectorSettings::scaleFactor ( ) const

Returns scale factor.

See also
scaleMode() and setScaleFactor()
VectorSettings::ScaleMode cee::ug::VectorSettings::scaleMode ( ) const

Returns current scale mode.

void cee::ug::VectorSettings::setArrowHeadRelativeLength ( double  headRelativeLength)

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

Default 0.25

void cee::ug::VectorSettings::setArrowHeadRelativeRadius ( double  headRelativeRadius)

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

Default 0.085

void cee::ug::VectorSettings::setArrowShaftRelativeRadius ( double  shaftRelativeRadius)

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

Default 0.025

void cee::ug::VectorSettings::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 cee::ug::VectorSettings::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.
void cee::ug::VectorSettings::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

maximum count ignored!

void cee::ug::VectorSettings::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.
void cee::ug::VectorSettings::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.

void cee::ug::VectorSettings::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 cee::ug::VectorSettings::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.

void cee::ug::VectorSettings::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.

void cee::ug::VectorSettings::setShowInteriorVectors ( bool  show)

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

void cee::ug::VectorSettings::setSimpleVectorLineWidth ( int  width)

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

See also
setDrawMode
void cee::ug::VectorSettings::setSingleVectorColor ( const Color3f color)

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

void cee::ug::VectorSettings::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
bool cee::ug::VectorSettings::showInteriorVectors ( ) const

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

int cee::ug::VectorSettings::simpleVectorLineWidth ( ) const

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

See also
setDrawMode
cee::Color3f cee::ug::VectorSettings::singleVectorColor ( ) const

Returns the single vector color.

VectorSettings::VectorType cee::ug::VectorSettings::vectorType ( ) const

Returns the current vector type.