1 // File: XGUI_ModuleConnector.cpp
2 // Created: 3 June 2014
3 // Author: Vitaly Smetannikov
5 #include "XGUI_ModuleConnector.h"
6 #include "XGUI_Workshop.h"
7 #include "XGUI_ViewerProxy.h"
8 #include "XGUI_SelectionMgr.h"
9 #include "XGUI_Selection.h"
10 #include "XGUI_OperationMgr.h"
11 #include "XGUI_Displayer.h"
13 XGUI_ModuleConnector::XGUI_ModuleConnector(XGUI_Workshop* theWorkshop)
14 : ModuleBase_IWorkshop(theWorkshop),
15 myWorkshop(theWorkshop)
17 XGUI_SelectionMgr* aSelector = myWorkshop->selector();
18 connect(aSelector, SIGNAL(selectionChanged()), this, SIGNAL(selectionChanged()));
20 XGUI_OperationMgr* anOperationMgr = myWorkshop->operationMgr();
22 connect(anOperationMgr, SIGNAL(operationStarted(ModuleBase_Operation*)),
23 this, SIGNAL(operationStarted(ModuleBase_Operation*)));
24 connect(anOperationMgr, SIGNAL(operationStopped(ModuleBase_Operation*)),
25 this, SIGNAL(operationStopped(ModuleBase_Operation*)));
28 XGUI_ModuleConnector::~XGUI_ModuleConnector()
32 ModuleBase_ISelection* XGUI_ModuleConnector::selection() const
34 return myWorkshop->selector()->selection();
37 ModuleBase_IModule* XGUI_ModuleConnector::module() const
39 return myWorkshop->module();
42 ModuleBase_IViewer* XGUI_ModuleConnector::viewer() const
44 return myWorkshop->viewer();
47 ModuleBase_Operation* XGUI_ModuleConnector::currentOperation() const
49 return myWorkshop->operationMgr()->currentOperation();
53 void XGUI_ModuleConnector::activateSubShapesSelection(const QIntList& theTypes)
55 XGUI_Displayer* aDisp = myWorkshop->displayer();
56 aDisp->openLocalContext();
57 aDisp->activateObjectsOutOfContext();
58 aDisp->setSelectionModes(theTypes);
61 void XGUI_ModuleConnector::deactivateSubShapesSelection()
63 XGUI_Displayer* aDisp = myWorkshop->displayer();
64 aDisp->closeLocalContexts(false);