1 // File: XGUI_ModuleConnector.h
2 // Created: 3 June 2014
3 // Author: Vitaly Smetannikov
5 #ifndef XGUI_ModuleConnector_H
6 #define XGUI_ModuleConnector_H
9 #include <ModuleBase_Definitions.h>
10 #include <ModuleBase_IWorkshop.h>
11 #include <ModuleBase_ViewerFilters.h>
13 class Handle_AIS_InteractiveContext;
18 * Implementation of IWorkshop interface which provides access to Workshop sevices at module level
20 class XGUI_EXPORT XGUI_ModuleConnector : public ModuleBase_IWorkshop
24 XGUI_ModuleConnector(XGUI_Workshop* theWorkshop);
26 virtual ~XGUI_ModuleConnector();
28 //! Returns list of currently selected data objects
29 virtual ModuleBase_ISelection* selection() const;
31 /// Activate sub-shapes selection (opens local context if it was not opened)
32 /// Types has to be dined according to TopAbs_ShapeEnum
33 virtual void activateSubShapesSelection(const QIntList& theTypes);
35 /// Deactivate sub-shapes selection (closes local context)
36 virtual void deactivateSubShapesSelection();
38 //! Returns instance of loaded module
39 virtual ModuleBase_IModule* module() const;
41 //! Returns current viewer
42 virtual ModuleBase_IViewer* viewer() const;
44 //! Returns currently active operation
45 virtual ModuleBase_Operation* currentOperation() const;
47 //! Returns AIS opbject by data object
48 virtual AISObjectPtr findPresentation(const ObjectPtr& theObject) const;
50 //! Returns data object by AIS
51 virtual ObjectPtr findPresentedObject(const AISObjectPtr& theAIS) const;
53 //! Select features clearing previous selection.
54 //! If the list is empty then selection will be cleared
55 virtual void setSelected(const QList<ObjectPtr>& theFeatures);
57 XGUI_Workshop* workshop() const { return myWorkshop; }
60 XGUI_Workshop* myWorkshop;
62 /// A filter which provides selection within a current document or whole PartSet
63 Handle(ModuleBase_ShapeDocumentFilter) myDocumentShapeFilter;