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