Salome HOME
Merge branch 'master' into Dev_1.1.0
[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
17 #include <QObject>
18
19 class ModuleBase_IModule;
20 class ModuleBase_ISelection;
21 class ModuleBase_IViewer;
22 class ModuleBase_Operation;
23 class ModuleBase_FilterFactory;
24
25 /**
26  * \ingroup GUI
27  * Class which provides access to Workshop object serveces
28  */
29 class MODULEBASE_EXPORT ModuleBase_IWorkshop : public QObject
30 {
31 Q_OBJECT
32  public:
33    /// Constructor
34    /// \param theParent parent object
35   ModuleBase_IWorkshop(QObject* theParent);
36
37   virtual ~ModuleBase_IWorkshop()
38   {}
39
40   /// Return current selection instance
41   virtual ModuleBase_ISelection* selection() const = 0;
42
43   /// Activate sub-shapes selection (opens local context)
44   /// Types has to be defined according to TopAbs_ShapeEnum
45   virtual void activateSubShapesSelection(const QIntList& theTypes) = 0;
46
47   /// Deactivate sub-shapes selection (closes local context)
48   virtual void deactivateSubShapesSelection() = 0;
49
50   //! Returns instance of loaded module
51   virtual ModuleBase_IModule* module() const = 0;
52
53   //! Returns current viewer
54   virtual ModuleBase_IViewer* viewer() const = 0;
55
56   /// A filter to process an attribute validators
57   /// \return a filter
58   Handle(ModuleBase_FilterValidated) validatorFilter();
59
60   //! Returns the factory of selection filters : the only one instance per application
61   ModuleBase_FilterFactory* selectionFilters() const;
62   
63   //! Returns currently active operation
64   virtual ModuleBase_Operation* currentOperation() const = 0;
65
66   //! Returns true if the operation with id theId can be started
67   virtual bool canStartOperation(QString theId) = 0;
68
69   //! Returns AIS opbject by data object
70   virtual AISObjectPtr findPresentation(const ObjectPtr& theObject) const = 0;
71
72   //! Returns data object by AIS
73   virtual ObjectPtr findPresentedObject(const AISObjectPtr& theAIS) const = 0;
74
75   //! Select features clearing previous selection. 
76   //! If the list is empty then selection will be cleared
77   virtual void setSelected(const QObjectPtrList& theFeatures) = 0;
78
79 signals:
80   /// Signal selection chaged.
81   void selectionChanged();
82
83   /// Signal which is emited after activation of property panel
84   void propertyPanelActivated();
85
86 protected:
87   /// A filter to process an attribute validators
88   Handle(ModuleBase_FilterValidated) myValidatorFilter;
89 };
90
91 #endif