X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXGUI%2FXGUI_Displayer.h;h=78da19457d11969a3d4cdf34a811dd04829fced3;hb=2b21081bbbd86d0432cc408a1194df7804143209;hp=9e853afb0eaefbc54464c9c7136441c5b361ee0b;hpb=8873182f935a9f77cdb25a770d4c8780b7669773;p=modules%2Fshaper.git diff --git a/src/XGUI/XGUI_Displayer.h b/src/XGUI/XGUI_Displayer.h index 9e853afb0..78da19457 100644 --- a/src/XGUI/XGUI_Displayer.h +++ b/src/XGUI/XGUI_Displayer.h @@ -118,7 +118,7 @@ class XGUI_EXPORT XGUI_Displayer: public QObject /// \param theUpdateViewer the parameter whether the viewer should be update immediatelly void closeLocalContexts(const bool theUpdateViewer = true); - // Remove default selection filters of the module from the current viewer + /// Remove default selection filters of the module from the current viewer void deactivateSelectionFilters(); /// \brief Add selection filter @@ -141,16 +141,22 @@ class XGUI_EXPORT XGUI_Displayer: public QObject /// \param isEnabled a boolean value bool enableUpdateViewer(const bool isEnabled); + /// Returns myEnableUpdateViewer flag + bool isUpdateEnabled() const { return myEnableUpdateViewer; } + /// Updates the viewer void updateViewer() const; /// Activate interactive context - /// \param theIO - /// \param theMode + /// \param theIO an interactive object + /// \param theMode activation mode + /// \param theUpdateViewer update viewer flag void activateAIS(const Handle(AIS_InteractiveObject)& theIO, const int theMode, const bool theUpdateViewer) const; /// Activate interactive context. It is necessary to call ClearOutdatedSelection after deactivation + /// \param theIO an interactive object + /// \param theMode a mode to deactivate. When theMode=-1 then all modes will be deactivated void deactivateAIS(const Handle(AIS_InteractiveObject)& theIO, const int theMode = -1) const; /// Searches the interactive object by feature @@ -186,6 +192,7 @@ class XGUI_EXPORT XGUI_Displayer: public QObject /// Activates in local context displayed outside of the context. /// \param theModes - modes on which it has to be activated (can be empty) /// \param theObjList - list of objects which has to be activated. + /// \param theUpdateViewer an update viewer flag void activateObjects(const QIntList& theModes, const QObjectPtrList& theObjList, const bool theUpdateViewer = true); @@ -221,6 +228,18 @@ class XGUI_EXPORT XGUI_Displayer: public QObject /// \return previously defined color on the object QColor setObjectColor(ObjectPtr theObject, const QColor& theColor, bool theUpdateViewer = true); + /// Returns Trihedron object if it is displayed + Handle(AIS_InteractiveObject) getTrihedron() const; + + // Set trihedron active (used in selection) or non active + void activateTrihedron(bool theIsActive); + + bool isTrihedronActive() const { return myIsTrihedronActive; } + + /// Converts shape type (TopAbs_ShapeEnum) to selection mode + /// \param theShapeType a shape type from TopAbs_ShapeEnum + static int getSelectionMode(int theShapeType); + signals: /// Signal on object display /// \param theObject a data object @@ -253,7 +272,8 @@ private: /// Activates the interactive object in the local context. /// \param theIO an interactive object /// \param theModes - modes on which it has to be activated (can be empty) - void activate(const Handle(AIS_InteractiveObject)& theIO, const QIntList& theModes, + /// \return a flag is object activated or not + bool activate(const Handle(AIS_InteractiveObject)& theIO, const QIntList& theModes, const bool theUpdateViewer) const; /// Deactivates the given object (not allow selection) @@ -302,7 +322,13 @@ private: QIntList myActiveSelectionModes; /// the enable update viewer flag - bool myEnableUpdateViewer; + bool myEnableUpdateViewer; + + // Flag: use trihedgon for selection or not + bool myIsTrihedronActive; + + /// A flag that update was requested but not done + mutable bool myNeedUpdate; }; #endif