Salome HOME
Added groups results
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_Group.cpp
1 // File:        FeaturesPlugin_Group.cpp
2 // Created:     08 Oct 2014
3 // Author:      Sergey BELASH
4
5 #include "FeaturesPlugin_Group.h"
6
7 #include <ModelAPI_Data.h>
8 #include <ModelAPI_Document.h>
9 #include <ModelAPI_AttributeInteger.h>
10 #include <ModelAPI_AttributeString.h>
11 #include <ModelAPI_AttributeSelectionList.h>
12
13
14 using namespace std;
15
16 FeaturesPlugin_Group::FeaturesPlugin_Group()
17 {
18 }
19
20 void FeaturesPlugin_Group::initAttributes()
21 {
22   //data()->addAttribute(FeaturesPlugin_Group::NAME_ID(), ModelAPI_AttributeString::type());
23   data()->addAttribute(FeaturesPlugin_Group::LIST_ID(), ModelAPI_AttributeSelectionList::type());
24 }
25
26 void FeaturesPlugin_Group::execute()
27 {
28   if (results().empty()) { // just create result if not exists
29     document()->createGroup(data());
30   }
31 }