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;
22 * Class which provides access to Workshop object serveces
24 class MODULEBASE_EXPORT ModuleBase_IWorkshop : public QObject
28 ModuleBase_IWorkshop(QObject* theParent)
32 virtual ~ModuleBase_IWorkshop()
35 virtual ModuleBase_ISelection* selection() const = 0;
37 /// Activate sub-shapes selection (opens local context)
38 /// Types has to be dined according to TopAbs_ShapeEnum
39 virtual void activateSubShapesSelection(const QIntList& theTypes) = 0;
41 /// Deactivate sub-shapes selection (closes local context)
42 virtual void deactivateSubShapesSelection() = 0;
44 //! Returns instance of loaded module
45 virtual ModuleBase_IModule* module() const = 0;
47 //! Returns current viewer
48 virtual ModuleBase_IViewer* viewer() const = 0;
50 //! Returns currently active operation
51 virtual ModuleBase_Operation* currentOperation() const = 0;
53 //! Returns true if the operation with id theId can be started
54 virtual bool canStartOperation(QString theId) = 0;
56 //! Returns AIS opbject by data object
57 virtual AISObjectPtr findPresentation(const ObjectPtr& theObject) const = 0;
59 //! Returns data object by AIS
60 virtual ObjectPtr findPresentedObject(const AISObjectPtr& theAIS) const = 0;
62 //! Select features clearing previous selection.
63 //! If the list is empty then selection will be cleared
64 virtual void setSelected(const QObjectPtrList& theFeatures) = 0;
67 void selectionChanged();
69 /// Signal about an operation is started. It is emitted after the start() of operation is done.
70 void operationStarted(ModuleBase_Operation* theOperation);
72 /// Signal about an operation is stopped. It is emitted after the stop() of operation is done.
73 /// \param theOperation a stopped operation
74 void operationStopped(ModuleBase_Operation* theOperation);
76 /// Signal about an operation is resumed. It is emitted after the resume() of operation is done.
77 void operationResumed(ModuleBase_Operation* theOperation);
79 /// Emitted when current operation is comitted
80 void operationComitted(ModuleBase_Operation* theOperation);
82 /// Emitted when current operation is aborted
83 void operationAborted(ModuleBase_Operation* theOperation);
85 /// Signal which is emited after activation of property panel
86 void propertyPanelActivated();