1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 // File: XGUI_ModuleConnector.h
4 // Created: 3 June 2014
5 // Author: Vitaly Smetannikov
7 #ifndef XGUI_ModuleConnector_H
8 #define XGUI_ModuleConnector_H
11 #include <ModuleBase_Definitions.h>
12 #include <ModuleBase_IWorkshop.h>
13 #include <ModuleBase_ViewerFilters.h>
15 class Handle_AIS_InteractiveContext;
21 * Implementation of IWorkshop interface which provides access to Workshop sevices at module level
23 class XGUI_EXPORT XGUI_ModuleConnector : public ModuleBase_IWorkshop
28 /// \param theWorkshop a workshop
29 XGUI_ModuleConnector(XGUI_Workshop* theWorkshop);
31 virtual ~XGUI_ModuleConnector();
33 //! Returns list of currently selected data objects
34 virtual ModuleBase_ISelection* selection() const;
36 /// Activate sub-shapes selection (opens local context if it was not opened)
37 /// Types has to be dined according to TopAbs_ShapeEnum
38 virtual void activateSubShapesSelection(const QIntList& theTypes);
40 /// Deactivate sub-shapes selection (closes local context)
41 virtual void deactivateSubShapesSelection();
43 //! Returns instance of loaded module
44 virtual ModuleBase_IModule* module() const;
46 //! Returns current viewer
47 virtual ModuleBase_IViewer* viewer() const;
49 //! Returns property panel
50 virtual ModuleBase_IPropertyPanel* propertyPanel() const;
52 //! Returns currently active operation
53 virtual ModuleBase_Operation* currentOperation() const;
55 //! Returns true if the operation with id theId can be started
56 virtual bool canStartOperation(QString theId);
58 //! Returns AIS opbject by data object
59 virtual AISObjectPtr findPresentation(const ObjectPtr& theObject) const;
61 //! Returns data object by AIS
62 virtual ObjectPtr findPresentedObject(const AISObjectPtr& theAIS) const;
64 //! Select features clearing previous selection.
65 //! If the list is empty then selection will be cleared
66 virtual void setSelected(const QObjectPtrList& theFeatures);
69 XGUI_Workshop* workshop() const { return myWorkshop; }
72 /// Reference to workshop
73 XGUI_Workshop* myWorkshop;
75 /// A filter which provides selection within a current document or whole PartSet
76 Handle(ModuleBase_ShapeDocumentFilter) myDocumentShapeFilter;