allow to create SelectionObject from SelectionChanges structure

This commit is contained in:
wmayer
2016-10-21 14:56:29 +02:00
parent 6fef24f676
commit 6d5f7650ab
4 changed files with 37 additions and 1 deletions

View File

@@ -31,8 +31,9 @@
#include <Base/Interpreter.h>
#include "SelectionObject.h"
#include "SelectionObjectPy.h"
#include "Selection.h"
#include "Application.h"
#include <Gui/SelectionObjectPy.h>
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();