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