Salome HOME
Issue #1865 : initial implementation of the "Fields" feature and additional attribute...
[modules/shaper.git] / src / CollectionPlugin / CollectionPlugin_Field.cpp
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:        CollectionPlugin_Field.cpp
4 // Created:     08 Oct 2014
5 // Author:      Sergey BELASH
6
7 #include "CollectionPlugin_Field.h"
8
9 #include <ModelAPI_Data.h>
10 #include <ModelAPI_Document.h>
11 #include <ModelAPI_AttributeInteger.h>
12 #include <ModelAPI_AttributeStringArray.h>
13 #include <ModelAPI_AttributeSelectionList.h>
14 #include <ModelAPI_AttributeIntArray.h>
15 #include <ModelAPI_AttributeTables.h>
16
17 CollectionPlugin_Field::CollectionPlugin_Field()
18 {
19 }
20
21 void CollectionPlugin_Field::initAttributes()
22 {
23   data()->addAttribute(SELECTED_ID(), ModelAPI_AttributeSelectionList::typeId());
24   data()->addAttribute(COMPONENTS_NB_ID(), ModelAPI_AttributeInteger::typeId());
25   data()->addAttribute(COMPONENTS_NAMES_ID(), ModelAPI_AttributeStringArray::typeId());
26   data()->addAttribute(VALUES_TYPE_ID(), ModelAPI_AttributeInteger::typeId());
27   data()->addAttribute(STEPS_NB_ID(), ModelAPI_AttributeInteger::typeId());
28   data()->addAttribute(STAMPS_ID(), ModelAPI_AttributeIntArray::typeId());
29   data()->addAttribute(VALUES_ID(), ModelAPI_AttributeTables::typeId());
30 }
31
32 void CollectionPlugin_Field::execute()
33 {
34   if (results().empty() || firstResult()->isDisabled()) { // just create result if not exists
35     //ResultPtr aField = document()->createField(data());
36     //setResult(aField);
37   }
38 }