X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FFeaturesPlugin%2FFeaturesPlugin_Group.cpp;h=4708c6fc0f6250ac69e73772326676ae865043b9;hb=51889d235a27d0ee4b3c3237d21d1ea621063580;hp=3a9a07a15f86442317430e73d8f91c8a06ac2a11;hpb=87c2d038fe6feaae3951850cbfb43313015aa1f7;p=modules%2Fshaper.git diff --git a/src/FeaturesPlugin/FeaturesPlugin_Group.cpp b/src/FeaturesPlugin/FeaturesPlugin_Group.cpp index 3a9a07a15..4708c6fc0 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Group.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Group.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D --> + // File: FeaturesPlugin_Group.cpp // Created: 08 Oct 2014 // Author: Sergey BELASH @@ -8,6 +10,9 @@ #include #include #include +#include +#include + using namespace std; @@ -17,16 +22,14 @@ FeaturesPlugin_Group::FeaturesPlugin_Group() void FeaturesPlugin_Group::initAttributes() { - data()->addAttribute(FeaturesPlugin_Group::NAME_ID(), ModelAPI_AttributeString::type()); - data()->addAttribute(FeaturesPlugin_Group::TYPE_ID(), ModelAPI_AttributeInteger::type()); - data()->addAttribute(FeaturesPlugin_Group::LIST_ID(), ModelAPI_AttributeString::type()); + //data()->addAttribute(FeaturesPlugin_Group::NAME_ID(), ModelAPI_AttributeString::type()); + data()->addAttribute(FeaturesPlugin_Group::LIST_ID(), ModelAPI_AttributeSelectionList::type()); } void FeaturesPlugin_Group::execute() { - AttributeIntegerPtr aTypeAttr = boost::dynamic_pointer_cast( - data()->attribute(FeaturesPlugin_Group::TYPE_ID())); - if (!aTypeAttr) - return; - int aType = aTypeAttr->value(); + if (results().empty()) { // just create result if not exists + ResultPtr aGroup = document()->createGroup(data()); + setResult(aGroup); + } }