Salome HOME
Fixed naming in Partition and in GeomAlgoAPI_MakeShapeList.
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_Group.cpp
index e9ae74d59627fda00bc49c8bebdb64bed2021025..182a1d74c0f16da727629969d45c136c016950ef 100644 (file)
@@ -1,3 +1,5 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
+
 // File:        FeaturesPlugin_Group.cpp
 // Created:     08 Oct 2014
 // Author:      Sergey BELASH
@@ -9,6 +11,7 @@
 #include <ModelAPI_AttributeInteger.h>
 #include <ModelAPI_AttributeString.h>
 #include <ModelAPI_AttributeSelectionList.h>
+#include <ModelAPI_ResultGroup.h>
 
 
 using namespace std;
@@ -19,13 +22,14 @@ FeaturesPlugin_Group::FeaturesPlugin_Group()
 
 void FeaturesPlugin_Group::initAttributes()
 {
-  //data()->addAttribute(FeaturesPlugin_Group::NAME_ID(), ModelAPI_AttributeString::type());
-  data()->addAttribute(FeaturesPlugin_Group::LIST_ID(), ModelAPI_AttributeSelectionList::type());
+  //data()->addAttribute(FeaturesPlugin_Group::NAME_ID(), ModelAPI_AttributeString::typeId());
+  data()->addAttribute(FeaturesPlugin_Group::LIST_ID(), ModelAPI_AttributeSelectionList::typeId());
 }
 
 void FeaturesPlugin_Group::execute()
 {
-  if (results().empty()) { // just create result if not exists
-    document()->createGroup(data());
+  if (results().empty() || firstResult()->isDisabled()) { // just create result if not exists
+    ResultPtr aGroup = document()->createGroup(data());
+    setResult(aGroup);
   }
 }