Salome HOME
Code documentation update
[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
13 #include <ModelAPI_Object.h>
14 #include <GeomAPI_AISObject.h>
15
16 #include <QObject>
17
18 class ModuleBase_IModule;
19 class ModuleBase_ISelection;
20 class ModuleBase_IViewer;
21 class ModuleBase_Operation;
22 class ModuleBase_FilterFactory;
23
24 /**
25  * Class which provides access to Workshop object serveces
26  */
27 class MODULEBASE_EXPORT ModuleBase_IWorkshop : public QObject
28 {
29 Q_OBJECT
30  public:
31    /// Constructor
32    /// \param theParent parent object
33   ModuleBase_IWorkshop(QObject* theParent)
34       : QObject(theParent)
35   {}
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   //! Returns the factory of selection filters : the only one instance per application
57   ModuleBase_FilterFactory* selectionFilters() const;
58   
59   //! Returns currently active operation
60   virtual ModuleBase_Operation* currentOperation() const = 0;
61
62   //! Returns true if the operation with id theId can be started
63   virtual bool canStartOperation(QString theId) = 0;
64
65   //! Returns AIS opbject by data object
66   virtual AISObjectPtr findPresentation(const ObjectPtr& theObject) const = 0;
67
68   //! Returns data object by AIS
69   virtual ObjectPtr findPresentedObject(const AISObjectPtr& theAIS) const = 0;
70
71   //! Select features clearing previous selection. 
72   //! If the list is empty then selection will be cleared
73   virtual void setSelected(const QObjectPtrList& theFeatures) = 0;
74
75 signals:
76   /// Signal selection chaged.
77   void selectionChanged();
78
79   /// Signal which is emited after activation of property panel
80   void propertyPanelActivated();
81
82 };
83
84 #endif