1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: ModuleBase_IWorkshop.h
4 // Created: 2 June 2014
5 // Author: Vitaly Smetannikov
7 #ifndef ModuleBase_IWorkshop_H
8 #define ModuleBase_IWorkshop_H
10 #include "ModuleBase.h"
11 #include "ModuleBase_Definitions.h"
12 #include <ModuleBase_FilterValidated.h>
13 #include <ModuleBase_ViewerPrs.h>
15 #include <ModelAPI_Object.h>
16 #include <GeomAPI_AISObject.h>
20 class ModuleBase_IModule;
21 class ModuleBase_ISelection;
22 class ModuleBase_IViewer;
23 class ModuleBase_IPropertyPanel;
24 class ModuleBase_Operation;
25 class ModuleBase_FilterFactory;
29 * Class which provides access to Workshop object services
31 class MODULEBASE_EXPORT ModuleBase_IWorkshop : public QObject
36 /// \param theParent parent object
37 ModuleBase_IWorkshop(QObject* theParent);
39 virtual ~ModuleBase_IWorkshop()
42 /// Return current selection instance
43 virtual ModuleBase_ISelection* selection() const = 0;
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;
49 /// Activate objects in the module selection modes(opens local context)
50 virtual void activateModuleSelectionModes() = 0;
52 /// Deactivate sub-shapes selection (closes local context)
53 virtual void deactivateSubShapesSelection() = 0;
55 //! Returns instance of loaded module
56 virtual ModuleBase_IModule* module() const = 0;
58 //! Returns current viewer
59 virtual ModuleBase_IViewer* viewer() const = 0;
61 //! Returns property panel
62 virtual ModuleBase_IPropertyPanel* propertyPanel() const = 0;
64 /// A filter to process an attribute validators
66 Handle(ModuleBase_FilterValidated) validatorFilter();
68 //! Returns the factory of selection filters : the only one instance per application
69 ModuleBase_FilterFactory* selectionFilters() const;
71 //! Returns currently active operation
72 virtual ModuleBase_Operation* currentOperation() const = 0;
74 //! Returns true if the operation with id theId can be started
75 virtual bool canStartOperation(QString theId) = 0;
77 //! Returns started operation by the operation identifier
78 //! \param theId an operation id
79 //! \return an operation instance or NULL
80 virtual ModuleBase_Operation* findStartedOperation(const QString& theId) = 0;
82 //! Returns true if the operation with id theId can be stopped
83 //! \param theOperation a stopped operation
84 //! \return boolean result
85 virtual bool canStopOperation(ModuleBase_Operation* theOperation) = 0;
87 //! Aborts the operation.
88 //! \param theOperation an aborted operation
89 virtual void abortOperation(ModuleBase_Operation* theOperation) = 0;
91 //! Returns AIS object by data object
92 //! \param theObject a data object
93 virtual AISObjectPtr findPresentation(const ObjectPtr& theObject) const = 0;
95 //! Returns data object by AIS
96 //! \param theAIS a presentation
97 virtual ObjectPtr findPresentedObject(const AISObjectPtr& theAIS) const = 0;
99 //! Select features clearing previous selection.
100 //! If the list is empty then selection will be cleared
101 //! \param theValues a list of presentations
102 virtual void setSelected(const QList<ModuleBase_ViewerPrs>& theValues) = 0;
104 /// Update of commands status
105 virtual void updateCommandStatus() = 0;
108 /// Signal selection changed.
109 void selectionChanged();
111 /// Signal which is emited after activation of property panel
112 void propertyPanelActivated();
115 /// A filter to process an attribute validators
116 Handle(ModuleBase_FilterValidated) myValidatorFilter;