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... | |
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... | |
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... | |
![]() | |
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... | |
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.
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().
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().
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.
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
Sets number relative scaling to 0.2.
Sets the single vector color to yellow.
See the complete source code at: UnstructGrid: Set vector settings on a loaded model
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)
double cee::ug::VectorSettings::clampingRangeMinimum | ( | ) | const |
Returns the minimum length the (non-zero) vectors will be drawn as (if clamping is enabled)
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.
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:
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
void cee::ug::VectorSettings::setDrawMode | ( | DrawMode | mode | ) |
Sets the draw mode.
Available modes are:
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.
void cee::ug::VectorSettings::setSingleVectorColor | ( | const Color3f & | color | ) |
Sets the single vector color to apply to all vectors in the result.
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.
cee::Color3f cee::ug::VectorSettings::singleVectorColor | ( | ) | const |
Returns the single vector color.