+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
+
// File: FeaturesPlugin_Group.cpp
// Created: 08 Oct 2014
// Author: Sergey BELASH
#include <ModelAPI_Document.h>
#include <ModelAPI_AttributeInteger.h>
#include <ModelAPI_AttributeString.h>
+#include <ModelAPI_AttributeSelectionList.h>
+#include <ModelAPI_ResultGroup.h>
+
using namespace std;
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<ModelAPI_AttributeInteger>(
- 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);
+ }
}