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