Salome HOME
Warnings correction for moc files generation
[modules/shaper.git] / src / ModuleBase / ModuleBase_IWorkshop.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        ModuleBase_IWorkshop.h
4 // Created:     2 June 2014
5 // Author:      Vitaly Smetannikov
6
7 #ifndef ModuleBase_IWorkshop_H
8 #define ModuleBase_IWorkshop_H
9
10 #include "ModuleBase.h"
11 #include "ModuleBase_Definitions.h"
12 #include <ModuleBase_FilterValidated.h>
13
14 #include <ModelAPI_Object.h>
15 #include <GeomAPI_AISObject.h>
16 #include <Config_FeatureMessage.h>
17
18 #include <QObject>
19
20 class ModuleBase_IModule;
21 class ModuleBase_ISelection;
22 class ModuleBase_IViewer;
23 class ModuleBase_IPropertyPanel;
24 class ModuleBase_Operation;
25 class ModuleBase_ViewerPrs;
26 class QMainWindow;
27
28 /**
29  * \ingroup GUI
30  * Class which provides access to Workshop object services
31  */
32 class MODULEBASE_EXPORT ModuleBase_IWorkshop : public QObject
33 {
34 Q_OBJECT
35  public:
36    /// Constructor
37    /// \param theParent parent object
38   ModuleBase_IWorkshop(QObject* theParent);
39
40   virtual ~ModuleBase_IWorkshop()
41   {}
42
43   /// Return current selection instance
44   virtual ModuleBase_ISelection* selection() const = 0;
45
46   /// Activate sub-shapes selection (opens local context)
47   /// Types has to be defined according to TopAbs_ShapeEnum
48   virtual void activateSubShapesSelection(const QIntList& theTypes) = 0;
49
50   /// Activate objects in the module selection modes(opens local context)
51   virtual void activateModuleSelectionModes() = 0;
52
53   /// Deactivate sub-shapes selection (closes local context)
54   virtual void deactivateSubShapesSelection() = 0;
55
56   //! Returns instance of loaded module
57   virtual ModuleBase_IModule* module() const = 0;
58
59   //! Returns current viewer
60   virtual ModuleBase_IViewer* viewer() const = 0;
61
62   //! Returns property panel
63   virtual ModuleBase_IPropertyPanel* propertyPanel() const = 0;
64
65   /// A filter to process an attribute validators
66   /// \return a filter
67   Handle(ModuleBase_FilterValidated) validatorFilter();
68
69   //! Returns currently active operation
70   virtual ModuleBase_Operation* currentOperation() const = 0;
71
72   //! Returns true if the operation with id theId can be started
73   virtual bool canStartOperation(QString theId) = 0;
74
75   //! Performs the operation launch
76   //! \param theOperation an operation to be launched
77   virtual void processLaunchOperation(ModuleBase_Operation* theOperation) = 0;
78
79   //! Returns started operation by the operation identifier
80   //! \param theId an operation id
81   //! \return an operation instance or NULL
82   virtual ModuleBase_Operation* findStartedOperation(const QString& theId) = 0;
83
84   //! Returns true if the operation with id theId can be stopped
85   //! \param theOperation a stopped operation
86   //! \return boolean result
87   virtual bool canStopOperation(ModuleBase_Operation* theOperation) = 0;
88
89   //! Commits if possible or aborts the given operation.
90   //! \param theOperation an aborted operation
91   virtual void stopOperation(ModuleBase_Operation* theOperation) = 0;
92
93   //! Returns AIS object by data object
94   //! \param theObject a data object
95   virtual AISObjectPtr findPresentation(const ObjectPtr& theObject) const = 0;
96
97   //! Returns data object by AIS
98   //! \param theAIS a presentation
99   virtual ObjectPtr findPresentedObject(const AISObjectPtr& theAIS) const = 0;
100
101   //! Select features clearing previous selection.
102   //! If the list is empty then selection will be cleared
103   //! \param theValues a list of presentations
104   virtual void setSelected(const QList<std::shared_ptr<ModuleBase_ViewerPrs>>& theValues) = 0;
105
106   //! Shows the message in the status bar
107   //! \param theMessage a message
108   virtual void setStatusBarMessage(const QString& theMessage) = 0;
109
110    /// Update of commands status
111   virtual void updateCommandStatus() = 0;
112
113   /// Returns feature info according to given feature ID
114   /// \param theId a feature Id
115   virtual std::shared_ptr<Config_FeatureMessage> featureInfo(const QString& theId) const = 0;
116
117   /// Returns main window of the application
118   virtual QMainWindow* desktop() const = 0;
119
120
121 signals:
122   /// Signal selection changed.
123   void selectionChanged();
124
125   /// Signal which is emited after activation of property panel
126   void propertyPanelActivated();
127
128 protected:
129   /// A filter to process an attribute validators
130   Handle(ModuleBase_FilterValidated) myValidatorFilter;
131 };
132
133 #endif