SHAPER
9.12.0
|
Displayer. More...
Public Types | |
enum | DisplayMode { NoMode = -1 , Wireframe , Shading } |
display mode More... | |
Signals | |
void | objectDisplayed (ObjectPtr theObject, AISObjectPtr theAIS) |
Signal on object display. More... | |
void | beforeObjectErase (ObjectPtr theObject, AISObjectPtr theAIS) |
Signal on before object erase. More... | |
Public Member Functions | |
XGUI_Displayer (XGUI_Workshop *theWorkshop) | |
Constructor. More... | |
virtual | ~XGUI_Displayer () |
Destructor. More... | |
bool | isVisible (ObjectPtr theObject) const |
Returns the feature visibility state. More... | |
bool | display (ObjectPtr theObject, bool theUpdateViewer=true) |
Display the feature. More... | |
bool | displayAIS (AISObjectPtr theAIS, const bool toActivateInSelectionModes, const Standard_Integer theDisplayMode=0, bool theUpdateViewer=true) |
Display the given AIS object. More... | |
bool | redisplay (ObjectPtr theObject, bool theUpdateViewer=true) |
Redisplay the shape if it was displayed. More... | |
void | redisplayObjects () |
Sends and flushes a signal to redisplay all visualized objects. More... | |
void | setSelected (const QList< std::shared_ptr< ModuleBase_ViewerPrs >> &theValues, bool theUpdateViewer=true) |
Add presentations to current selection. More... | |
void | clearSelected (const bool theUpdateViewer=true) |
Unselect all objects. More... | |
bool | erase (ObjectPtr theObject, const bool theUpdateViewer=true) |
Erase the feature and a shape. More... | |
bool | eraseAIS (AISObjectPtr theAIS, const bool theUpdateViewer=true) |
Erase the given AIS object displayed by corresponded display method. More... | |
bool | eraseAll (const bool theUpdateViewer=true) |
Erase all presentations. More... | |
void | deactivateSelectionFilters (const bool theAddFilterOnly=true) |
Remove default selection filters of the module from the current viewer. More... | |
void | addSelectionFilter (const Handle &&theFilter) |
Add selection filter. More... | |
void | removeSelectionFilter (const Handle &&theFilter) |
Remove selection filter. More... | |
virtual bool | hasSelectionFilter (const Handle &&theFilter) |
Returns true if the selection filter is set to the viewer. More... | |
void | removeFilters () |
Remove all selection filters. More... | |
bool | enableUpdateViewer (const bool isEnabled) |
Sets a flag to the displayer whether the internal viewer can be updated by the updateViewer method call. More... | |
bool | isUpdateEnabled () const |
Returns true if the viewer update is not blocked. More... | |
void | updateViewer () const |
Updates the viewer. More... | |
AISObjectPtr | getAISObject (ObjectPtr theObject) const |
Searches the interactive object by feature. More... | |
ObjectPtr | getObject (const AISObjectPtr &theIO) const |
Searches the feature by interactive object. More... | |
ObjectPtr | getObject (const Handle &&theIO) const |
Searches the feature by interactive object. More... | |
void | deactivateObjects (const QObjectPtrList &theObjList, const bool theUpdateViewer=true) |
Deactivates the given objects (not allow selection) More... | |
void | setDisplayMode (ObjectPtr theObject, DisplayMode theMode, bool theUpdateViewer=true) |
Sets display mode for the given object if this object is displayed. More... | |
DisplayMode | displayMode (ObjectPtr theObject) const |
Returns current display mode for the given object. More... | |
void | showOnly (const QObjectPtrList &theList) |
Displays only objects listed in the list. More... | |
int | objectsCount () const |
Returns number of displayed objects. More... | |
QObjectPtrList | displayedObjects () const |
Returns list of displayed objects. More... | |
QList< Handle > | displayedPresentations () const |
Returns list of displayed objects. More... | |
bool | canBeShaded (ObjectPtr theObject) const |
Returns true if the given object can be shown in shaded mode. More... | |
QColor | setObjectColor (ObjectPtr theObject, const QColor &theColor, bool theUpdateViewer=true) |
Set color on presentation of an object if it is displayed. More... | |
void | displayTrihedron (bool theToDisplay) const |
Displays/erases thrihedron in current modes. More... | |
GeomPlanePtr | getScreenPlane () const |
Returns screen plane of active view. More... | |
double | getViewScale () const |
Returns scale of active view. More... | |
void | setSelectionColor (const std::vector< int > &theColor) |
Set color of selection. More... | |
std::vector< int > | selectionColor () const |
Returns current selection color. More... | |
Static Public Member Functions | |
static bool | isVisible (XGUI_Displayer *theDisplayer, const ObjectPtr &theObject) |
Return true if the object is visible. More... | |
Protected Member Functions | |
HandleAAISContext () const | |
Returns currently installed AIS_InteractiveContext. More... | |
HandleGGetFilter () | |
Returns the viewer context top filter. More... | |
bool | display (ObjectPtr theObject, AISObjectPtr theAIS, bool isShading, bool theUpdateViewer=true) |
Display the feature and a shape. More... | |
Displayer.
Provides mechanizm of display/erase of objects in the viewer
XGUI_Displayer::XGUI_Displayer | ( | XGUI_Workshop * | theWorkshop | ) |
Constructor.
theWorkshop | a workshop instance |
|
virtual |
Destructor.
bool XGUI_Displayer::isVisible | ( | ObjectPtr | theObject | ) | const |
Returns the feature visibility state.
theObject | an object instance |
bool XGUI_Displayer::display | ( | ObjectPtr | theObject, |
bool | theUpdateViewer = true |
||
) |
Display the feature.
Obtain the visualized object from the feature.
theObject | an object to display |
theUpdateViewer | the parameter whether the viewer should be update immediatelly |
bool XGUI_Displayer::displayAIS | ( | AISObjectPtr | theAIS, |
const bool | toActivateInSelectionModes, | ||
const Standard_Integer | theDisplayMode = 0 , |
||
bool | theUpdateViewer = true |
||
) |
Display the given AIS object.
This object is not added to the displayer internal map of objects So, it can not be obtained from displayer. This is just a wrap method of OCC display in order to perform the display with correct flags.
theAIS | AIOS object to display |
toActivateInSelectionModes | boolean value whether the presentation should be activated in the current selection modes |
theDisplayMode | mode how the presentation should be displayed |
theUpdateViewer | the parameter whether the viewer should be update immediatelly |
bool XGUI_Displayer::redisplay | ( | ObjectPtr | theObject, |
bool | theUpdateViewer = true |
||
) |
Redisplay the shape if it was displayed.
theObject | an object instance |
theUpdateViewer | the parameter whether the viewer should be update immediatelly |
void XGUI_Displayer::redisplayObjects | ( | ) |
Sends and flushes a signal to redisplay all visualized objects.
void XGUI_Displayer::setSelected | ( | const QList< std::shared_ptr< ModuleBase_ViewerPrs >> & | theValues, |
bool | theUpdateViewer = true |
||
) |
Add presentations to current selection.
It unhighlight and deselect the current selection. The shape and result components are processed in the values. If the presentation shape is not empty, select it, otherwise select the result.
theValues | a list of presentation to be selected |
theUpdateViewer | the parameter whether the viewer should be update immediatelly |
void XGUI_Displayer::clearSelected | ( | const bool | theUpdateViewer = true | ) |
Unselect all objects.
theUpdateViewer | the parameter whether the viewer should be update immediatelly |
theUpdateViewer | the parameter to update viewer |
bool XGUI_Displayer::erase | ( | ObjectPtr | theObject, |
const bool | theUpdateViewer = true |
||
) |
Erase the feature and a shape.
theObject | an object instance |
theUpdateViewer | the parameter whether the viewer should be update immediatelly |
bool XGUI_Displayer::eraseAIS | ( | AISObjectPtr | theAIS, |
const bool | theUpdateViewer = true |
||
) |
Erase the given AIS object displayed by corresponded display method.
theAIS | instance of AIS object |
theUpdateViewer | the parameter whether the viewer should be update immediatelly |
bool XGUI_Displayer::eraseAll | ( | const bool | theUpdateViewer = true | ) |
Erase all presentations.
theUpdateViewer | the parameter whether the viewer should be update immediatelly |
void XGUI_Displayer::deactivateSelectionFilters | ( | const bool | theAddFilterOnly = true | ) |
Remove default selection filters of the module from the current viewer.
theAddFilterOnly | if is not 'true' it will deactivate all fiters in viewer |
void XGUI_Displayer::addSelectionFilter | ( | const Handle && | theFilter | ) |
Add selection filter.
theFilter | a filter instance |
void XGUI_Displayer::removeSelectionFilter | ( | const Handle && | theFilter | ) |
Remove selection filter.
theFilter | a filter instance |
|
virtual |
Returns true if the selection filter is set to the viewer.
theFilter | a selection filter |
void XGUI_Displayer::removeFilters | ( | ) |
Remove all selection filters.
bool XGUI_Displayer::enableUpdateViewer | ( | const bool | isEnabled | ) |
Sets a flag to the displayer whether the internal viewer can be updated by the updateViewer method call.
If it is not enabled, this method do nothing. This state maintain recurse, if the update is blocked twice or three times, the viewer will not be updated until it is unblocked necessary times (twice or three in the example).
isEnabled | a boolean value |
|
inline |
Returns true if the viewer update is not blocked.
void XGUI_Displayer::updateViewer | ( | ) | const |
Updates the viewer.
AISObjectPtr XGUI_Displayer::getAISObject | ( | ObjectPtr | theObject | ) | const |
Searches the interactive object by feature.
theObject | the object or presentable feature |
ObjectPtr XGUI_Displayer::getObject | ( | const AISObjectPtr & | theIO | ) | const |
Searches the feature by interactive object.
theIO | an interactive object |
ObjectPtr XGUI_Displayer::getObject | ( | const Handle && | theIO | ) | const |
Searches the feature by interactive object.
theIO | an interactive object |
void XGUI_Displayer::deactivateObjects | ( | const QObjectPtrList & | theObjList, |
const bool | theUpdateViewer = true |
||
) |
Deactivates the given objects (not allow selection)
theObjList | - list of objects which has to be deactivated. |
theUpdateViewer | update viewer flag |
void XGUI_Displayer::setDisplayMode | ( | ObjectPtr | theObject, |
DisplayMode | theMode, | ||
bool | theUpdateViewer = true |
||
) |
Sets display mode for the given object if this object is displayed.
XGUI_Displayer::DisplayMode XGUI_Displayer::displayMode | ( | ObjectPtr | theObject | ) | const |
Returns current display mode for the given object.
If object is not dis played then returns NoMode.
theObject | object to check |
void XGUI_Displayer::showOnly | ( | const QObjectPtrList & | theList | ) |
Displays only objects listed in the list.
theList | list of objects |
|
inline |
Returns number of displayed objects.
|
inline |
Returns list of displayed objects.
|
inline |
Returns list of displayed objects.
bool XGUI_Displayer::canBeShaded | ( | ObjectPtr | theObject | ) | const |
Returns true if the given object can be shown in shaded mode.
theObject | object to check |
QColor XGUI_Displayer::setObjectColor | ( | ObjectPtr | theObject, |
const QColor & | theColor, | ||
bool | theUpdateViewer = true |
||
) |
Set color on presentation of an object if it is displayed.
theObject | an object |
theColor | a color which has to be set |
theUpdateViewer | update viewer flag |
void XGUI_Displayer::displayTrihedron | ( | bool | theToDisplay | ) | const |
Displays/erases thrihedron in current modes.
It will be activated or deactivated depending on the trihedron visible state and displayer active trihedron state
|
static |
Return true if the object is visible.
If the object is feature, it returns true if all results of the feature are shown
theDisplayer | a displayer |
theObject | an object |
GeomPlanePtr XGUI_Displayer::getScreenPlane | ( | ) | const |
Returns screen plane of active view.
double XGUI_Displayer::getViewScale | ( | ) | const |
Returns scale of active view.
void XGUI_Displayer::setSelectionColor | ( | const std::vector< int > & | theColor | ) |
Set color of selection.
theColor | R,G,B values of color |
std::vector< int > XGUI_Displayer::selectionColor | ( | ) | const |
Returns current selection color.
|
signal |
Signal on object display.
theObject | a data object |
theAIS | a presentation object |
|
signal |
Signal on before object erase.
theObject | a data object |
theAIS | a presentation object |
|
protected |
Returns currently installed AIS_InteractiveContext.
|
protected |
Returns the viewer context top filter.
If there is no a filter, it is created and set into The context should have only this filter inside. Other filters should be add to the filter
|
protected |
Display the feature and a shape.
This shape would be associated to the given feature
theObject | an object instance |
theAIS | AIS presentation |
isShading | flag to show in shading mode |
theUpdateViewer | the parameter whether the viewer should be update immediatelly |