Configuration of an isovolume. More...
Public Types | |
enum | DrawStyle { SURFACE, SURFACE_MESH, SURFACE_OUTLINE_MESH, LINE, OUTLINE } |
Isovolume surface draw styles More... | |
Public Member Functions | |
Isovolume () | |
Constructs an empty isovolume object. More... | |
bool | visible () const |
Returns true if the isovolume (and optional mapped vectors) is drawn. More... | |
void | setVisible (bool visible) |
Specifies if the isovolume (and optional mapped vectors) should be drawn or not. More... | |
bool | highlight () const |
Returns true if current isovolume is highlighted. More... | |
void | setHighlight (bool showHighlighted) |
Toggles isovolume highlighting. More... | |
bool | volumeGeometryVisible () const |
Returns true if the isovolume itself should be drawn. More... | |
void | setVolumeGeometryVisible (bool show) |
Specifies if the geometry of the isovolume should be drawn or not. More... | |
DrawStyle | drawStyle () const |
Returns the current draw style of the isovolume. More... | |
void | setDrawStyle (DrawStyle drawStyle) |
Sets the draw style of the isovolume. More... | |
Color3f | volumeColor () const |
Returns the color of the isovolume if no result is mapped onto the volume. More... | |
void | setVolumeColor (const Color3f &color) |
Sets the color of the volume. More... | |
float | opacity () const |
Returns the opacity of the isovolume. More... | |
void | setOpacity (float opacity) |
Sets the opacity of the isovolume. More... | |
float | specularIntensity () const |
Returns the specular intensity set for this isovolume. More... | |
void | setSpecularIntensity (float intensity) |
Sets the specular intensity to use for this isovolume. More... | |
double | minimumIsoValue () const |
Returns the minimum iso scalar value of the volume. More... | |
void | setMinimumIsoValue (double value) |
Sets the minimum iso scalar value for the volume. More... | |
double | maximumIsoValue () const |
Returns the maximum iso scalar value of the volume. More... | |
void | setMaximumIsoValue (double value) |
Sets the maximum iso scalar value for the volume. More... | |
int | isoScalarResultId () const |
Returns the id of the current iso scalar result. More... | |
void | setIsoScalarResultId (int resultId) |
Sets the result defining the isovolume. More... | |
bool | computeFromVisibleParts () const |
Returns true if the isovolume only will be computed from the currently visible parts. More... | |
void | setComputeFromVisibleParts (bool visiblePartsOnly) |
Sets if the isovolume should be computed from only the visible parts or not. More... | |
int | mapScalarResultId () const |
Returns the id of the scalar result currently mapped on the volume. More... | |
void | setMapScalarResultId (int resultId) |
Sets the scalar result to be mapped on the volume. More... | |
int | mapVectorResultId () const |
Returns the id of the vector result currently mapped on the volume. More... | |
void | setMapVectorResultId (int resultId) |
Sets the vector result to be mapped on the volume. More... | |
Image * | textureImage () const |
Returns the texture image mapped on the isovolume. More... | |
void | setTextureImage (Image *image) |
Sets a texture to map on the isovolume surface. More... | |
bool | textureEnvironmentMapping () const |
Returns true if environment mapping is used for the current texture. More... | |
void | setTextureEnvironmentMapping (bool useEnvironmentMapping) |
Enables/disables use of environment mapping for the texture on the isovolume surface. More... | |
bool | isPrecomputed () const |
Returns true if the isovolume is precomputed. More... | |
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. More... | |
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. More... | |
void | data (int stateId, IsovolumeData *data) const |
Returns the data (triangles, vertices, results) of the isovolume in the given state. 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... | |
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.
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.)
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.
Sets the scalar result to be shown as mapped fringes on the isovolume volume.
Adds the isovolume to the model.
To get a better view of the cutting plane inside the model, set all normal parts draw style to LINES.
See the complete source code at: UnstructGrid: Create an isovolume
cee::ug::Isovolume::Isovolume | ( | ) |
Constructs an empty isovolume object.
bool cee::ug::Isovolume::computeFromVisibleParts | ( | ) | const |
Returns true if the isovolume only will be computed from the currently visible parts.
void cee::ug::Isovolume::data | ( | int | stateId, |
IsovolumeData * | data | ||
) | const |
Returns the data (triangles, vertices, results) of the isovolume in the given state.
Isovolume::DrawStyle cee::ug::Isovolume::drawStyle | ( | ) | const |
Returns the current draw style of the isovolume.
bool cee::ug::Isovolume::highlight | ( | ) | const |
Returns true if current isovolume is highlighted.
int cee::ug::Isovolume::isoScalarResultId | ( | ) | const |
Returns the id of the current iso scalar result.
bool cee::ug::Isovolume::isPrecomputed | ( | ) | const |
Returns true if the isovolume is precomputed.
Precomputed isovolumes cannot be altered or moved.
int cee::ug::Isovolume::mapScalarResultId | ( | ) | const |
Returns the id of the scalar result currently mapped on the volume.
Returns -1 if none.
int cee::ug::Isovolume::mapVectorResultId | ( | ) | const |
Returns the id of the vector result currently mapped on the volume.
Returns -1 if none.
double cee::ug::Isovolume::maximumIsoValue | ( | ) | const |
Returns the maximum iso scalar value of the volume.
double cee::ug::Isovolume::minimumIsoValue | ( | ) | const |
Returns the minimum iso scalar value of the volume.
float cee::ug::Isovolume::opacity | ( | ) | const |
Returns the opacity of the isovolume.
1.0 is opaque and 0.0 is fully transparent (invisible)
double cee::ug::Isovolume::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.
cee::Vec3d cee::ug::Isovolume::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 cee::ug::Isovolume::setComputeFromVisibleParts | ( | bool | computeFromVisibleParts | ) |
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.
void cee::ug::Isovolume::setDrawStyle | ( | DrawStyle | drawStyle | ) |
Sets the draw style of the isovolume.
void cee::ug::Isovolume::setHighlight | ( | bool | showHighlighted | ) |
Toggles isovolume highlighting.
void cee::ug::Isovolume::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.
void cee::ug::Isovolume::setMapScalarResultId | ( | int | resultId | ) |
Sets the scalar result to be mapped on the volume.
Set resultId to -1 to clear the mapped scalar result.
void cee::ug::Isovolume::setMapVectorResultId | ( | int | resultId | ) |
Sets the vector result to be mapped on the volume.
Set resultId to -1 to clear the mapped scalar result.
void cee::ug::Isovolume::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.
void cee::ug::Isovolume::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.
void cee::ug::Isovolume::setOpacity | ( | float | opacity | ) |
Sets the opacity of the isovolume.
1.0 is opaque and 0.0 is fully transparent (invisible)
void cee::ug::Isovolume::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.
void cee::ug::Isovolume::setTextureEnvironmentMapping | ( | bool | useEnvironmentMapping | ) |
Enables/disables use of environment mapping for the texture on the isovolume surface.
void cee::ug::Isovolume::setTextureImage | ( | cee::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.
void cee::ug::Isovolume::setVisible | ( | bool | visible | ) |
Specifies if the isovolume (and optional mapped vectors) should be drawn or not.
void cee::ug::Isovolume::setVolumeColor | ( | const Color3f & | color | ) |
Sets the color of the volume.
void cee::ug::Isovolume::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.
float cee::ug::Isovolume::specularIntensity | ( | ) | const |
Returns the specular intensity set for this isovolume.
bool cee::ug::Isovolume::textureEnvironmentMapping | ( | ) | const |
Returns true if environment mapping is used for the current texture.
cee::Image * cee::ug::Isovolume::textureImage | ( | ) | const |
Returns the texture image mapped on the isovolume.
NULL if no texture mapping is used.
bool cee::ug::Isovolume::visible | ( | ) | const |
Returns true if the isovolume (and optional mapped vectors) is drawn.
cee::Color3f cee::ug::Isovolume::volumeColor | ( | ) | const |
Returns the color of the isovolume if no result is mapped onto the volume.
bool cee::ug::Isovolume::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.