C3D Toolkit
Kernel - 117982, Vision - 2.9.2.2
|
Object rendering state. More...
#include <vsn_renderstate.h>
Public Member Functions | |
RenderingState | GetRenderingState () const |
Returns the current rendering state. | |
void | SetRenderingState (RenderingState state) |
Sets the rendering state. More... | |
RenderingState | GetProperRenderingState () const |
Returns the proper rendering state. More... | |
RenderingState | GetRenderingSpecialState () const |
Returns the current rendering state. | |
void | SetRenderingSpecialState (RenderingState state) |
Sets the rendering state. More... | |
DrawBufferMode | GetPolyFaceMode () const |
Returns rendering mode value for faces. More... | |
PolygonMode | GetPolygonMode () const |
Returns rendering mode value for polygons. More... | |
void | SetPolygonMode (DrawBufferMode fMode, PolygonMode pMode) |
Sets rendering mode for faces and polygons. More... | |
RenderMode | GetRenderingMode () const |
Returns the current model visualization mode. | |
void | SetRenderingMode (RenderMode mode) |
Sets the current model visualization mode. | |
bool | IsTransparencyRequired () const |
Returns True if the current mode requires transparency rendering. | |
int | GetCurrentBodyIndex () const |
Returns the current index of geometry part. | |
void | SetCurrentBodyIndex (int partIdx) |
Sets the current index of geometry part. | |
Material * | GetSpecialMaterial () const |
Returns pointer to other material that is different from the source. | |
void | SetSpecialMaterial (Material *pMaterial) |
Sets other material that is different from the source. | |
void | SetSpecialMaterialTransparency (float alpha) |
Sets transparency for the special material. | |
float | GetSpecialTransparency () const |
Returns transparency for the special material. | |
void | AddSpecialMaterial (uint id, Material *mat, int partIdx=0) |
Adds special material for primitive. More... | |
void | ClearSpecialMaterials () |
Clears special materials. | |
std::unordered_map< uint, Material * > * | GetSpecialMaterials () const |
Returns special material container of the current geometry part. More... | |
bool | IsSpecialMaterialsEmpty () const |
True if no special materials. | |
void | ApplyMaterial (Material *pMaterial) |
Applies the specified material. | |
void | ExcludeMaterial (Material *pMaterial) |
Excludes the specified material. | |
std::unordered_map< int, uint > * | GetHighlightedPrimitives () const |
Returns highlighted objects array. | |
bool | IsHighlightedPrimitive (uint id) const |
True if primitive is selected. More... | |
bool | IsHighlightedPrimitiveEmpty () const |
Returns true if there are no highlighted objects. | |
bool | IsNoHighlightedPrimitive () const |
True if array of highlighted primitives is empty. | |
uint | GetHighlightedPrimitive (int body) const |
Returns identifier of highlighted primitive of the current geometry part. | |
void | SetHighlightedPrimitiveId (uint, int body=0) |
Adds primitive by identifier and geometry part index to highlight. | |
void | RemoveHighlightedPrimitiveId (uint id, int body) |
Remove primitive by identifier and geometry part index to selection. | |
bool | IsHighlighted () const |
True if the current rendering mode is highlighted. | |
void | SetHighlighted (bool selected) |
Sets/Resets highlighted. | |
bool | IsSelected () const |
True if the current rendering mode is selected. | |
void | SetSelected (bool selected) |
Sets/Resets selection. | |
void | Unselect () |
Unselect. | |
bool | IsSelectedPrimitive (uint id) const |
True if primitive is selected. More... | |
bool | IsSelectedPrimitive (int partIdx, uint id) const |
True if primitive by identifier and body index is selected. More... | |
bool | IsNoSelectedPrimitive () const |
True if array of selected primitives is empty. | |
std::set< uint > * | GetSelectedPrimitives () const |
Returns identifier array of selected primitives of the current geometry part. | |
void | AddSelectedPrimitivesId (const std::set< uint > &, int body=0) |
Adds selected primitive array by identifier and body index. | |
void | AddSelectedPrimitiveId (uint, int body=0) |
Adds primitive by identifier and geometry part index to selection. | |
void | RemoveSelectedPrimitiveId (uint id, int body) |
Remove primitive by identifier and geometry part index to selection. | |
void | ClearSelectedPrimitives () |
Clears all selected primitives. | |
bool | IsSelectedGroupGeometry (const NodeKey &key) const |
NO TRANSLATION. | |
void | AddSelectedGroupGeometry (const NodeKey &key, uint primId) |
NO TRANSLATION. | |
void | RemoveSelectedGroupGeometry (const NodeKey &key, uint primId) |
NO TRANSLATION. | |
void | ClearSelectedGroupGeometry () |
NO TRANSLATION. | |
bool | IsHighlightedGroupGeometry (const NodeKey &key) const |
NO TRANSLATION. | |
void | AddHighlightedGroupGeometry (const NodeKey &key, uint primId) |
NO TRANSLATION. | |
void | RemoveHighlightedGroupGeometry (const NodeKey &key, uint primId) |
NO TRANSLATION. | |
void | ClearHighlightedGroupGeometry () |
NO TRANSLATION. | |
CuttingUtil * | GetCuttingTool () const |
NO TRANSLATION. | |
void | SetCuttingTool (CuttingUtil *tool) |
NO TRANSLATION. | |
const Matrix3DF & | GetModelViewMatrix () const |
NO TRANSLATION. | |
void | SetModelViewMatrix (const Matrix3DF &mx) |
NO TRANSLATION. | |
void | Clear () |
Clears visualization content and update material values. | |
RenderState & | operator= (const RenderState &) |
Assignment operator. | |
Constructors. | |
RenderState () | |
Default constructor. | |
RenderState (const RenderState &other) | |
Copy constructor. | |
~RenderState () | |
Destructor. | |
Static Public Member Functions | |
static NodeKey | GetCurrentSelectedGroupGeometry () |
NO TRANSLATION. | |
static void | SetCurrentSelectedGroupGeometry (const NodeKey &key) |
NO TRANSLATION. | |
static void | ResetCurrentSelectedGroupGeometry () |
NO TRANSLATION. | |
static NodeKey | GetCurrentHighlightedGroupGeometry () |
NO TRANSLATION. | |
static void | SetCurrentHighlightedGroupGeometry (const NodeKey &key) |
NO TRANSLATION. | |
static void | ResetCurrentHighlightedGroupGeometry () |
NO TRANSLATION. | |
Object rendering state.
RenderState class stores a rendering state and provides functions to control RenderObject object rendering modes.
void VSN::RenderState::SetRenderingState | ( | RenderingState | state | ) |
Sets the rendering state.
One of the following rendering values: NormalRenderState, PrimitiveSelectedState, BodySelectionState and PrimitiveSelectionState.
RenderingState VSN::RenderState::GetProperRenderingState | ( | ) | const |
Returns the proper rendering state.
The function returns the proper rendering state that belongs to given object not depending on its temporary states such as highlight mode and selection.
void VSN::RenderState::SetRenderingSpecialState | ( | RenderingState | state | ) |
Sets the rendering state.
One of the following rendering values: NormalRenderState, SpecialMaterialState, SpecialTransparencyState, SpecialMaterialTransparencyState и SpecialMaterialPrimitiveState.
DrawBufferMode VSN::RenderState::GetPolyFaceMode | ( | ) | const |
Returns rendering mode value for faces.
PolygonMode VSN::RenderState::GetPolygonMode | ( | ) | const |
Returns rendering mode value for polygons.
void VSN::RenderState::SetPolygonMode | ( | DrawBufferMode | fMode, |
PolygonMode | pMode | ||
) |
Sets rendering mode for faces and polygons.
[in] | fMode | - Rendering mode for faces with one of the following values: GL_FRONT_AND_BACK, GL_FRONT, and GL_BACK. |
[in] | pMode | - Rendering mode for curves with one of the following values: GL_FRONT_AND_BACK, GL_FRONT, and GL_BACK. |
Adds special material for primitive.
[in] | id | - Primitive identifier. |
[in] | mat- | Pointer to primitive identifier. |
[in] | partIdx | - Geometry part index. |
std::unordered_map<uint, Material*>* VSN::RenderState::GetSpecialMaterials | ( | ) | const |
Returns special material container of the current geometry part.
The function returns pointer map to special materials and primitive identifiers of the current geometry part.
bool VSN::RenderState::IsHighlightedPrimitive | ( | uint | id | ) | const |
True if primitive is selected.
[in] | id | - Primitive identifier. |
bool VSN::RenderState::IsSelectedPrimitive | ( | uint | id | ) | const |
True if primitive is selected.
[in] | id | - Primitive identifier. |
bool VSN::RenderState::IsSelectedPrimitive | ( | int | partIdx, |
uint | id | ||
) | const |
True if primitive by identifier and body index is selected.
[in] | id | - Primitive identifier. |
[in] | partIdx | - Geometry part index. |