Salome HOME
refs #30 - Sketch base GUI: create, draw lines
[modules/shaper.git] / src / XGUI / XGUI_SelectionMgr.cpp
index c4c09491de67d2fe34635116cb1ee8888ef4fc70..6421d278b62bcd816a9999d6ae99cc485ea1196c 100644 (file)
@@ -6,18 +6,20 @@
 #include <ModelAPI_Feature.h>
 #include <ModelAPI_PluginManager.h>
 #include <ModelAPI_AttributeDocRef.h>
-#include <ModelAPI_Object.h>
+#include <ModelAPI_Data.h>
 
 
 
 XGUI_SelectionMgr::XGUI_SelectionMgr(XGUI_Workshop* theParent) :
   QObject(theParent), myWorkshop(theParent)
 {
-  XGUI_ObjectsBrowser* aObjBrowser = myWorkshop->mainWindow()->objectBrowser();
-
-  connect(aObjBrowser, SIGNAL(selectionChanged()), this, SLOT(onSelectionChanged()));
 }
 
+void XGUI_SelectionMgr::connectObjectBrowser(XGUI_ObjectsBrowser* theOB)
+{
+  myObjectBrowser = theOB;
+  connect(myObjectBrowser, SIGNAL(selectionChanged()), this, SLOT(onSelectionChanged()));
+}
 
 XGUI_SelectionMgr::~XGUI_SelectionMgr()
 {
@@ -32,8 +34,8 @@ void XGUI_SelectionMgr::onSelectionChanged()
   if (mySelectedData.size() > 0) {
     FeaturePtr aFeature = mySelectedData.first();
 
-    std::shared_ptr<ModelAPI_PluginManager> aMgr = ModelAPI_PluginManager::get();
-    std::shared_ptr<ModelAPI_AttributeDocRef> aDocRef = aFeature->data()->docRef("PartDocument");
+    boost::shared_ptr<ModelAPI_PluginManager> aMgr = ModelAPI_PluginManager::get();
+    boost::shared_ptr<ModelAPI_AttributeDocRef> aDocRef = aFeature->data()->docRef("PartDocument");
     if (aDocRef)
       aMgr->setCurrentDocument(aDocRef->value());
   }