X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXGUI%2FXGUI_WorkshopListener.h;h=abc801ec1cdd67f1734cb3bacb74b7735acda377;hb=176403004ff97696f3c0b5f8bdf48692177fb34a;hp=14c2edbfd75f76e719787cb97603365c56d416c9;hpb=bff91ccd66e7d51923fe1582658dcedc08e4d86c;p=modules%2Fshaper.git diff --git a/src/XGUI/XGUI_WorkshopListener.h b/src/XGUI/XGUI_WorkshopListener.h index 14c2edbfd..abc801ec1 100755 --- a/src/XGUI/XGUI_WorkshopListener.h +++ b/src/XGUI/XGUI_WorkshopListener.h @@ -8,6 +8,7 @@ #include #include +#include #include @@ -19,6 +20,7 @@ class XGUI_Workshop; class ModuleBase_IWorkshop; class QString; +class Events_InfoMessage; /**\class XGUI_WorkshopListener * \ingroup GUI @@ -28,9 +30,8 @@ class XGUI_EXPORT XGUI_WorkshopListener : public QObject, public Events_Listener { Q_OBJECT public: - /// Constructor - /// \param theConnector a Salome connector object. - /// Used only if the workshop is launched in Salome environment + /// Constructor. Used only if the workshop is launched in Salome environment + /// \param theWorkshop a reference to workshop. XGUI_WorkshopListener(ModuleBase_IWorkshop* theWorkshop); virtual ~XGUI_WorkshopListener(); @@ -42,41 +43,51 @@ public: signals: /// Emitted when error in applivation happens - void errorOccurred(const QString&); - -protected slots: - /// Updates Apply All button state of the feature to the state if the feature has the button - /// \param theFeatureId an index of the feature, the action is searched, which state is to be changed - /// \param theState an action enable state - //void onNestedStateChanged(const std::string& theFeatureId, const bool theState); + void errorOccurred(std::shared_ptr theMsg); protected: /// Procedure to process postponed events bool event(QEvent * theEvent); - /// Process event "Add a feature" - void addFeature(const std::shared_ptr&); - /// Process feature update message - void onFeatureUpdatedMsg(const std::shared_ptr& ); + /// \param theMsg a message with a container of objects + void onFeatureUpdatedMsg(const std::shared_ptr& theMsg); /// Process feature created message - void onFeatureCreatedMsg(const std::shared_ptr& ); + /// \param theMsg a message with a container of objects + void onFeatureCreatedMsg(const std::shared_ptr& theMsg); /// Process feature redisplay message - void onFeatureRedisplayMsg(const std::shared_ptr& ); + /// \param theMsg a message with a container of objects + void onFeatureRedisplayMsg(const std::shared_ptr& theMsg); + + /// Process clearing of presentation + /// \param theMsg an event message + void onFeatureEmptyPresentationMsg(const std::shared_ptr& theMsg); /// Displaus object and fit all viewer if the object is first (update viewer will not be called) /// Asks the module whether the object can be displayed /// \param theObj an object - /// \param theFirstVisualizedBody an output state whether there are not object displayed in the view - /// and the displayed object is a body + /// \param theFirstVisualizedBody an output state whether there are not object displayed in the + /// view and the displayed object is a body /// \return true if the object is displayed - bool displayObject(ObjectPtr theObj, bool& theFirstVisualizedBody); + bool displayObject(ObjectPtr theObj); + + /// Answer if the viewer needed to be fit all after the object visualization + /// The condition is there is not shown objects and the object is a group or body result + /// \param theObject a shown object + /// \param theNbOfShownObjects a count of already shown objects in the viewer + /// \return true if fit all should be done + bool neededFitAll(ObjectPtr theObject, const int theNbOfShownObjects); /// Calls the module method of cusomize object for the feature of the current operation + /// Perform cusomize if the force redisplay flag is true or the list of objects contains the + /// current operation feature + /// \param theObjects a list of objects to find current operation feature + /// if forced redisplay is false + /// \param theForceRedisplay a flag to customize object even always /// \return true if the object is modified - bool customizeCurrentObject(); + bool customizeCurrentObject(const std::set& theObjects, bool theForceRedisplay); /// Returns the workshop XGUI_Workshop* workshop() const;