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 //! \return boolean result
84 virtual bool canStopOperation() = 0;
86 //! Aborts the operation.
87 //! \param theId an aborted operation
88 virtual void abortOperation(ModuleBase_Operation* theOperation) = 0;
90 //! Returns AIS object by data object
91 virtual AISObjectPtr findPresentation(const ObjectPtr& theObject) const = 0;
93 //! Returns data object by AIS
94 virtual ObjectPtr findPresentedObject(const AISObjectPtr& theAIS) const = 0;
96 //! Select features clearing previous selection.
97 //! If the list is empty then selection will be cleared
98 virtual void setSelected(const QList<ModuleBase_ViewerPrs>& theValues) = 0;
101 /// Signal selection changed.
102 void selectionChanged();
104 /// Signal which is emited after activation of property panel
105 void propertyPanelActivated();
108 /// A filter to process an attribute validators
109 Handle(ModuleBase_FilterValidated) myValidatorFilter;