X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_IWorkshop.h;h=a9c66405d9a8836758299ebe1ceee3920f6c2fd5;hb=1de75803e9baf3de59fa755f9eccb6ef60bb64e4;hp=94c1800d11d3a29124a16402c96ce04113bd666d;hpb=a7f44a41bdf29e7bd978ff3b8c8bd514d1223be7;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_IWorkshop.h b/src/ModuleBase/ModuleBase_IWorkshop.h index 94c1800d1..a9c66405d 100644 --- a/src/ModuleBase/ModuleBase_IWorkshop.h +++ b/src/ModuleBase/ModuleBase_IWorkshop.h @@ -1,3 +1,5 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + // File: ModuleBase_IWorkshop.h // Created: 2 June 2014 // Author: Vitaly Smetannikov @@ -7,37 +9,48 @@ #include "ModuleBase.h" #include "ModuleBase_Definitions.h" +#include #include #include +#include #include class ModuleBase_IModule; class ModuleBase_ISelection; class ModuleBase_IViewer; +class ModuleBase_IPropertyPanel; +class ModuleBase_IErrorMgr; class ModuleBase_Operation; +class ModuleBase_ViewerPrs; +class QMainWindow; /** - * Class which provides access to Workshop object serveces + * \ingroup GUI + * Class which provides access to Workshop object services */ class MODULEBASE_EXPORT ModuleBase_IWorkshop : public QObject { Q_OBJECT public: - ModuleBase_IWorkshop(QObject* theParent) - : QObject(theParent) - {} + /// Constructor + /// \param theParent parent object + ModuleBase_IWorkshop(QObject* theParent); virtual ~ModuleBase_IWorkshop() {} + /// Return current selection instance virtual ModuleBase_ISelection* selection() const = 0; /// Activate sub-shapes selection (opens local context) - /// Types has to be dined according to TopAbs_ShapeEnum + /// Types has to be defined according to TopAbs_ShapeEnum virtual void activateSubShapesSelection(const QIntList& theTypes) = 0; + /// Activate objects in the module selection modes(opens local context) + virtual void activateModuleSelectionModes() = 0; + /// Deactivate sub-shapes selection (closes local context) virtual void deactivateSubShapesSelection() = 0; @@ -47,44 +60,78 @@ Q_OBJECT //! Returns current viewer virtual ModuleBase_IViewer* viewer() const = 0; + //! Returns property panel + virtual ModuleBase_IPropertyPanel* propertyPanel() const = 0; + + //! Returns error manager + virtual ModuleBase_IErrorMgr* errorMgr() const = 0; + + /// A filter to process an attribute validators + /// \return a filter + Handle(ModuleBase_FilterValidated) validatorFilter(); + //! Returns currently active operation virtual ModuleBase_Operation* currentOperation() const = 0; //! Returns true if the operation with id theId can be started virtual bool canStartOperation(QString theId) = 0; - //! Returns AIS opbject by data object + //! Performs the operation launch + //! \param theOperation an operation to be launched + virtual void processLaunchOperation(ModuleBase_Operation* theOperation) = 0; + + //! Returns started operation by the operation identifier + //! \param theId an operation id + //! \return an operation instance or NULL + virtual ModuleBase_Operation* findStartedOperation(const QString& theId) = 0; + + //! Returns true if the operation with id theId can be stopped + //! \param theOperation a stopped operation + //! \return boolean result + virtual bool canStopOperation(ModuleBase_Operation* theOperation) = 0; + + //! Commits if possible or aborts the given operation. + //! \param theOperation an aborted operation + virtual void stopOperation(ModuleBase_Operation* theOperation) = 0; + + //! Returns AIS object by data object + //! \param theObject a data object virtual AISObjectPtr findPresentation(const ObjectPtr& theObject) const = 0; //! Returns data object by AIS + //! \param theAIS a presentation virtual ObjectPtr findPresentedObject(const AISObjectPtr& theAIS) const = 0; - //! Select features clearing previous selection. + //! Select features clearing previous selection. //! If the list is empty then selection will be cleared - virtual void setSelected(const QObjectPtrList& theFeatures) = 0; + //! \param theValues a list of presentations + virtual void setSelected(const QList>& theValues) = 0; -signals: - void selectionChanged(); + //! Shows the message in the status bar + //! \param theMessage a message + virtual void setStatusBarMessage(const QString& theMessage) = 0; - /// Signal about an operation is started. It is emitted after the start() of operation is done. - void operationStarted(ModuleBase_Operation* theOperation); + /// Update of commands status + virtual void updateCommandStatus() = 0; - /// Signal about an operation is stopped. It is emitted after the stop() of operation is done. - /// \param theOperation a stopped operation - void operationStopped(ModuleBase_Operation* theOperation); + /// Returns feature info according to given feature ID + /// \param theId a feature Id + virtual std::shared_ptr featureInfo(const QString& theId) const = 0; - /// Signal about an operation is resumed. It is emitted after the resume() of operation is done. - void operationResumed(ModuleBase_Operation* theOperation); + /// Returns main window of the application + virtual QMainWindow* desktop() const = 0; - /// Emitted when current operation is comitted - void operationComitted(ModuleBase_Operation* theOperation); - /// Emitted when current operation is aborted - void operationAborted(ModuleBase_Operation* theOperation); +signals: + /// Signal selection changed. + void selectionChanged(); /// Signal which is emited after activation of property panel void propertyPanelActivated(); +protected: + /// A filter to process an attribute validators + Handle(ModuleBase_FilterValidated) myValidatorFilter; }; #endif