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 serveces
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 /// Deactivate sub-shapes selection (closes local context)
50 virtual void deactivateSubShapesSelection() = 0;
52 //! Returns instance of loaded module
53 virtual ModuleBase_IModule* module() const = 0;
55 //! Returns current viewer
56 virtual ModuleBase_IViewer* viewer() const = 0;
58 //! Returns property panel
59 virtual ModuleBase_IPropertyPanel* propertyPanel() const = 0;
61 /// A filter to process an attribute validators
63 Handle(ModuleBase_FilterValidated) validatorFilter();
65 //! Returns the factory of selection filters : the only one instance per application
66 ModuleBase_FilterFactory* selectionFilters() const;
68 //! Returns currently active operation
69 virtual ModuleBase_Operation* currentOperation() const = 0;
71 //! Returns true if the operation with id theId can be started
72 virtual bool canStartOperation(QString theId) = 0;
74 //! Returns AIS opbject by data object
75 virtual AISObjectPtr findPresentation(const ObjectPtr& theObject) const = 0;
77 //! Returns data object by AIS
78 virtual ObjectPtr findPresentedObject(const AISObjectPtr& theAIS) const = 0;
80 //! Select features clearing previous selection.
81 //! If the list is empty then selection will be cleared
82 virtual void setSelected(const QList<ModuleBase_ViewerPrs>& theValues) = 0;
85 /// Signal selection chaged.
86 void selectionChanged();
88 /// Signal which is emited after activation of property panel
89 void propertyPanelActivated();
92 /// A filter to process an attribute validators
93 Handle(ModuleBase_FilterValidated) myValidatorFilter;