diff --git a/src/Gui/Selection.cpp b/src/Gui/Selection.cpp index d7936701f..8f0b726a4 100644 --- a/src/Gui/Selection.cpp +++ b/src/Gui/Selection.cpp @@ -527,6 +527,7 @@ bool SelectionSingleton::setPreselect(const char* pDocName, const char* pObjectN Chng.pDocName = DocName.c_str(); Chng.pObjectName = FeatName.c_str(); Chng.pSubName = SubName.c_str(); + Chng.pTypeName = ""; Chng.x = x; Chng.y = y; Chng.z = z; @@ -706,6 +707,7 @@ bool SelectionSingleton::addSelection(const char* pDocName, const char* pObjectN Chng.pDocName = pDocName; Chng.pObjectName = pObjectName ? pObjectName : ""; Chng.pSubName = pSubName ? pSubName : ""; + Chng.pTypeName = temp.TypeName.c_str(); Chng.x = x; Chng.y = y; Chng.z = z; @@ -761,6 +763,7 @@ bool SelectionSingleton::addSelection(const char* pDocName, const char* pObjectN Chng.pDocName = pDocName; Chng.pObjectName = pObjectName ? pObjectName : ""; Chng.pSubName = ""; + Chng.pTypeName = temp.TypeName.c_str(); Chng.x = 0; Chng.y = 0; Chng.z = 0; @@ -793,6 +796,7 @@ void SelectionSingleton::rmvSelection(const char* pDocName, const char* pObjectN std::string tmpDocName = It->DocName; std::string tmpFeaName = It->FeatName; std::string tmpSubName = It->SubName; + std::string tmpTypName = It->TypeName; // destroy the _SelObj item It = _SelList.erase(It); @@ -801,6 +805,7 @@ void SelectionSingleton::rmvSelection(const char* pDocName, const char* pObjectN Chng.pDocName = tmpDocName.c_str(); Chng.pObjectName = tmpFeaName.c_str(); Chng.pSubName = tmpSubName.c_str(); + Chng.pTypeName = tmpTypName.c_str(); Chng.Type = SelectionChanges::RmvSelection; Notify(Chng); @@ -868,6 +873,7 @@ void SelectionSingleton::setSelection(const char* pDocName, const std::vector #include "SelectionObject.h" -#include "SelectionObjectPy.h" +#include "Selection.h" #include "Application.h" +#include using namespace Gui; @@ -43,6 +44,17 @@ SelectionObject::SelectionObject() { } +SelectionObject::SelectionObject(const Gui::SelectionChanges& msg) +{ + FeatName = msg.pObjectName ? msg.pObjectName : ""; + DocName = msg.pDocName ? msg.pDocName : ""; + TypeName = msg.pTypeName ? msg.pTypeName : ""; + if (msg.pSubName) { + SubNames.push_back(msg.pSubName); + SelPoses.push_back(Base::Vector3d(msg.x, msg.y, msg.z)); + } +} + SelectionObject::SelectionObject(App::DocumentObject* obj) { FeatName = obj->getNameInDocument(); diff --git a/src/Gui/SelectionObject.h b/src/Gui/SelectionObject.h index 2ff59d396..f52f56341 100644 --- a/src/Gui/SelectionObject.h +++ b/src/Gui/SelectionObject.h @@ -34,6 +34,8 @@ namespace App { namespace Gui { +class SelectionChanges; + /** * The Selection object class */ @@ -44,6 +46,9 @@ class GuiExport SelectionObject : public Base::BaseClass public: /** Constructs a SelectionObject object. */ SelectionObject(); + /*! Constructs a SelectionObject from the SelectionChanges structure. + */ + SelectionObject(const SelectionChanges& msg); SelectionObject(App::DocumentObject*); virtual ~SelectionObject(); /**