Salome HOME
Merge branch 'Dev_0.6.1' of newgeom:newgeom into Dev_0.6.1
[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
13 #include <ModelAPI_Object.h>
14 #include <GeomAPI_AISObject.h>
15
16 #include <QObject>
17
18 class ModuleBase_IModule;
19 class ModuleBase_ISelection;
20 class ModuleBase_IViewer;
21 class ModuleBase_Operation;
22 class ModuleBase_FilterFactory;
23
24 /**
25  * Class which provides access to Workshop object serveces
26  */
27 class MODULEBASE_EXPORT ModuleBase_IWorkshop : public QObject
28 {
29 Q_OBJECT
30  public:
31   ModuleBase_IWorkshop(QObject* theParent)
32       : QObject(theParent)
33   {}
34
35   virtual ~ModuleBase_IWorkshop()
36   {}
37
38   virtual ModuleBase_ISelection* selection() const = 0;
39
40   /// Activate sub-shapes selection (opens local context)
41   /// Types has to be dined according to TopAbs_ShapeEnum
42   virtual void activateSubShapesSelection(const QIntList& theTypes) = 0;
43
44   /// Deactivate sub-shapes selection (closes local context)
45   virtual void deactivateSubShapesSelection() = 0;
46
47   //! Returns instance of loaded module
48   virtual ModuleBase_IModule* module() const = 0;
49
50   //! Returns current viewer
51   virtual ModuleBase_IViewer* viewer() const = 0;
52
53   //! Returns the factory of selection filters : the only one instance per application
54   ModuleBase_FilterFactory* selectionFilters() const;
55   
56   //! Returns currently active operation
57   virtual ModuleBase_Operation* currentOperation() const = 0;
58
59   //! Returns true if the operation with id theId can be started
60   virtual bool canStartOperation(QString theId) = 0;
61
62   //! Returns AIS opbject by data object
63   virtual AISObjectPtr findPresentation(const ObjectPtr& theObject) const = 0;
64
65   //! Returns data object by AIS
66   virtual ObjectPtr findPresentedObject(const AISObjectPtr& theAIS) const = 0;
67
68   //! Select features clearing previous selection. 
69   //! If the list is empty then selection will be cleared
70   virtual void setSelected(const QObjectPtrList& theFeatures) = 0;
71
72 signals:
73   void selectionChanged();
74
75   /// Signal about an operation is started. It is emitted after the start() of operation is done.
76   void operationStarted(ModuleBase_Operation* theOperation);
77
78   /// Signal about an operation is stopped. It is emitted after the stop() of operation is done.
79   /// \param theOperation a stopped operation
80   void operationStopped(ModuleBase_Operation* theOperation);
81
82   /// Signal about an operation is resumed. It is emitted after the resume() of operation is done.
83   void operationResumed(ModuleBase_Operation* theOperation);
84
85   /// Emitted when current operation is comitted
86   void operationComitted(ModuleBase_Operation* theOperation);
87
88   /// Emitted when current operation is aborted
89   void operationAborted(ModuleBase_Operation* theOperation);
90
91   /// Signal which is emited after activation of property panel
92   void propertyPanelActivated();
93
94 };
95
96 #endif