1 // File: ModuleBase_IWorkshop.h
2 // Created: 2 June 2014
3 // Author: Vitaly Smetannikov
5 #ifndef ModuleBase_IWorkshop_H
6 #define ModuleBase_IWorkshop_H
8 #include "ModuleBase.h"
9 #include "ModuleBase_Definitions.h"
11 #include <ModelAPI_Object.h>
12 #include <GeomAPI_AISObject.h>
16 class ModuleBase_IModule;
17 class ModuleBase_ISelection;
18 class ModuleBase_IViewer;
19 class ModuleBase_Operation;
20 class ModuleBase_FilterFactory;
23 * Class which provides access to Workshop object serveces
25 class MODULEBASE_EXPORT ModuleBase_IWorkshop : public QObject
29 ModuleBase_IWorkshop(QObject* theParent)
33 virtual ~ModuleBase_IWorkshop()
36 virtual ModuleBase_ISelection* selection() const = 0;
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;
42 /// Deactivate sub-shapes selection (closes local context)
43 virtual void deactivateSubShapesSelection() = 0;
45 //! Returns instance of loaded module
46 virtual ModuleBase_IModule* module() const = 0;
48 //! Returns current viewer
49 virtual ModuleBase_IViewer* viewer() const = 0;
51 //! Returns the factory of selection filters : the only one instance per application
52 ModuleBase_FilterFactory* selectionFilters() const;
54 //! Returns currently active operation
55 virtual ModuleBase_Operation* currentOperation() const = 0;
57 //! Returns true if the operation with id theId can be started
58 virtual bool canStartOperation(QString theId) = 0;
60 //! Returns AIS opbject by data object
61 virtual AISObjectPtr findPresentation(const ObjectPtr& theObject) const = 0;
63 //! Returns data object by AIS
64 virtual ObjectPtr findPresentedObject(const AISObjectPtr& theAIS) const = 0;
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;
71 void selectionChanged();
73 /// Signal about an operation is started. It is emitted after the start() of operation is done.
74 void operationStarted(ModuleBase_Operation* theOperation);
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);
80 /// Signal about an operation is resumed. It is emitted after the resume() of operation is done.
81 void operationResumed(ModuleBase_Operation* theOperation);
83 /// Emitted when current operation is comitted
84 void operationComitted(ModuleBase_Operation* theOperation);
86 /// Emitted when current operation is aborted
87 void operationAborted(ModuleBase_Operation* theOperation);
89 /// Signal which is emited after activation of property panel
90 void propertyPanelActivated();