X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXGUI%2FXGUI_Workshop.h;h=cddb72f72d5c2eb242fd5784a0ee25e626a06f94;hb=64fc7e4fdd63997ec7a502b233ef5f88186d5bbb;hp=b41634aab7a05d6875fd78169f70b281bfabe01a;hpb=e688b089a4eab3d48ed762e18f9761da01bbaf81;p=modules%2Fshaper.git diff --git a/src/XGUI/XGUI_Workshop.h b/src/XGUI/XGUI_Workshop.h index b41634aab..cddb72f72 100644 --- a/src/XGUI/XGUI_Workshop.h +++ b/src/XGUI/XGUI_Workshop.h @@ -20,23 +20,24 @@ class AppElements_MainWindow; class AppElements_Command; class AppElements_Workbench; -class XGUI_SelectionMgr; +class XGUI_ActionsMgr; +class XGUI_ContextMenuMgr; class XGUI_Displayer; +class XGUI_ErrorDialog; +class XGUI_ErrorMgr; +class XGUI_ModuleConnector; +class XGUI_ObjectsBrowser; class XGUI_OperationMgr; +class XGUI_PropertyPanel; class XGUI_SalomeConnector; -class XGUI_ObjectsBrowser; -class XGUI_ActionsMgr; -class XGUI_ErrorDialog; class XGUI_SalomeViewer; +class XGUI_SelectionMgr; class XGUI_ViewerProxy; -class XGUI_PropertyPanel; -class XGUI_ContextMenuMgr; -class XGUI_ModuleConnector; class XGUI_WorkshopListener; -class ModuleBase_Operation; class ModuleBase_IModule; class ModuleBase_IViewer; +class ModuleBase_Operation; class QWidget; class QDockWidget; @@ -91,6 +92,12 @@ Q_OBJECT return myOperationMgr; } + //! ! Returns error manager. + XGUI_ErrorMgr* errorMgr() const + { + return myErrorMgr; + } + //! ! Returns an actions manager XGUI_ActionsMgr* actionsMgr() const { @@ -127,13 +134,6 @@ Q_OBJECT return mySalomeConnector != 0; } - /// Returns true if the loading data process is started and has not been finished yet - /// \return boolean result - bool isLoadingData() const - { - return myIsLoadingData; - }; - //! Returns Object browser XGUI_ObjectsBrowser* objectBrowser() const { @@ -163,6 +163,18 @@ Q_OBJECT //! Delete features void deleteObjects(); + //! Returns true if the selected feature can be moved to the position after the current feature + //! \return boolean value + bool canMoveFeature(); + + //! Move selected features to be after the current feature + void moveObjects(); + + //! Returns true if the object can be shaded. If the object is a compsolid result, the method + //! checks subobjects of the result + //! \return boolean value + bool canBeShaded(const ObjectPtr& theObject) const; + //! Returns true if there is at least one selected body/construction/group result //! \return boolean value bool canChangeColor() const; @@ -208,7 +220,7 @@ Q_OBJECT * - operation aborted successfully * - there is no active operation */ - bool isActiveOperationAborted(); + bool abortAllOperations(); //! Delete features. Delete the referenced features. There can be a question with a list of referenced //! objects. @@ -218,10 +230,10 @@ Q_OBJECT //! \param theAskAboutDeleteReferences if true, the message box with a list of references to the //! objects features appear. If the user chose do not continue, the deletion is not performed //! \return the success of the delete - static bool deleteFeatures(const QObjectPtrList& theList, - std::set theIgnoredFeatures = std::set(), - QWidget* theParent = 0, - const bool theAskAboutDeleteReferences = false); + bool deleteFeatures(const QObjectPtrList& theList, + const std::set& theIgnoredFeatures = std::set(), + QWidget* theParent = 0, + const bool theAskAboutDeleteReferences = false); /// Deactivates the object, if it is active and the module returns that the activation /// of selection for the object is not possible currently(the current operation uses it) @@ -229,6 +241,10 @@ Q_OBJECT /// \param theUpdateViewer a boolean flag to update viewer immediately void deactivateActiveObject(const ObjectPtr& theObject, const bool theUpdateViewer); + /// Returns true if the action of the feature is created to contain Accept/Cancel button + /// \param theFeature a feature + bool isFeatureOfNested(const FeaturePtr& theFeature); + signals: /// Emitted when selection happens in Salome viewer void salomeViewerSelection(); @@ -294,26 +310,20 @@ signals: /// Hide object Browser void hideObjectBrowser(); - /// Reaction on command call - //void onFeatureTriggered(); - /// Close document void closeDocument(); protected: - /// Find the nested features and set them into the operation + /// Sets the granted operations for the parameter operation. Firtsly, it finds the nested features + /// and set them into the operation. Secondly, it asks the module about ids of granted operations. /// \param theOperation an operation - void setNestedFeatures(ModuleBase_Operation* theOperation); + void setGrantedFeatures(ModuleBase_Operation* theOperation); /// Update the property panel content by the XML description of the operation and set the panel /// into the operation /// \param theOperation an operation void setPropertyPanel(ModuleBase_Operation* theOperation); - /// Connect to operation signals - /// \param theOperation an operation - void connectWithOperation(ModuleBase_Operation* theOperation); - private: /// Display all results //void displayAllResults(); @@ -357,6 +367,19 @@ private: /// Set waiting cursor void onStartWaiting(); + /// Called by Ok button clicked in the property panel. Asks the error manager whether + /// the operation can be commited and do it if it returns true. + void onAcceptActionClicked(); + + /// Listens the corresponded signal from operation manager and send it with the Ok + /// action to operation manager. + /// \param theEnabled an enabled state for the action + //void onValidationStateChanged(bool theEnabled); + + //connect(myOperationMgr, SIGNAL(validationStateChanged(bool)), + // aOkAct, SLOT(setEnabled(bool))); + + private: /// Init menu void initMenu(); @@ -395,6 +418,7 @@ private: private: AppElements_MainWindow* myMainWindow; ModuleBase_IModule* myModule; + XGUI_ErrorMgr* myErrorMgr; XGUI_ObjectsBrowser* myObjectBrowser; XGUI_PropertyPanel* myPropertyPanel; XGUI_SelectionMgr* mySelector; @@ -409,9 +433,6 @@ private: XGUI_WorkshopListener* myEventsListener; QString myCurrentDir; - - /// The flag is true when we loading a document - bool myIsLoadingData; }; #endif