Salome HOME
Provide preselection
[modules/shaper.git] / src / ModuleBase / ModuleBase_IWorkshop.h
1 // File:        ModuleBase_IWorkshop.h
2 // Created:     2 June 2014
3 // Author:      Vitaly Smetannikov
4
5 #ifndef ModuleBase_IWorkshop_H
6 #define ModuleBase_IWorkshop_H
7
8 #include "ModuleBase.h"
9 #include "ModuleBase_Definitions.h"
10
11 #include <ModelAPI_Object.h>
12 #include <GeomAPI_AISObject.h>
13
14 #include <QObject>
15
16 class ModuleBase_IModule;
17 class ModuleBase_ISelection;
18 class ModuleBase_IViewer;
19 class ModuleBase_Operation;
20
21 /**
22  * Class which provides access to Workshop object serveces
23  */
24 class MODULEBASE_EXPORT ModuleBase_IWorkshop : public QObject
25 {
26 Q_OBJECT
27  public:
28   ModuleBase_IWorkshop(QObject* theParent)
29       : QObject(theParent)
30   {}
31
32   virtual ~ModuleBase_IWorkshop()
33   {}
34
35   virtual ModuleBase_ISelection* selection() const = 0;
36
37   /// Activate sub-shapes selection (opens local context)
38   /// Types has to be dined according to TopAbs_ShapeEnum
39   virtual void activateSubShapesSelection(const QIntList& theTypes) = 0;
40
41   /// Deactivate sub-shapes selection (closes local context)
42   virtual void deactivateSubShapesSelection() = 0;
43
44   //! Returns instance of loaded module
45   virtual ModuleBase_IModule* module() const = 0;
46
47   //! Returns current viewer
48   virtual ModuleBase_IViewer* viewer() const = 0;
49
50   //! Returns currently active operation
51   virtual ModuleBase_Operation* currentOperation() const = 0;
52
53   //! Returns AIS opbject by data object
54   virtual AISObjectPtr findPresentation(const ObjectPtr& theObject) const = 0;
55
56   //! Returns data object by AIS
57   virtual ObjectPtr findPresentedObject(const AISObjectPtr& theAIS) const = 0;
58
59   //! Select features clearing previous selection. 
60   //! If the list is empty then selection will be cleared
61   virtual void setSelected(const QList<ObjectPtr>& theFeatures) = 0;
62
63 signals:
64   void selectionChanged();
65
66   void operationStarted(ModuleBase_Operation*);
67   void operationStopped(ModuleBase_Operation*);
68 };
69
70 #endif