Salome HOME
Issue #1865 : support while part type in the result of the field
[modules/shaper.git] / src / CollectionPlugin / CollectionPlugin_Field.cpp
index e1921c0b693073480fbbce76a3cdde76277d09a2..ddae4d0425fc3239e43761b4ddd6be2e2d7908e4 100644 (file)
@@ -8,12 +8,13 @@
 
 #include <ModelAPI_Data.h>
 #include <ModelAPI_Document.h>
-#include <ModelAPI_AttributeInteger.h>
 #include <ModelAPI_AttributeStringArray.h>
 #include <ModelAPI_AttributeSelectionList.h>
 #include <ModelAPI_AttributeIntArray.h>
 #include <ModelAPI_AttributeTables.h>
 #include <ModelAPI_ResultField.h>
+#include <ModelAPI_Session.h>
+#include <ModelAPI_Validator.h>
 
 CollectionPlugin_Field::CollectionPlugin_Field()
 {
@@ -22,6 +23,9 @@ CollectionPlugin_Field::CollectionPlugin_Field()
 void CollectionPlugin_Field::initAttributes()
 {
   data()->addAttribute(SELECTED_ID(), ModelAPI_AttributeSelectionList::typeId());
+  // for the whole part result it is not obligatory
+  ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), SELECTED_ID());
+
   data()->addAttribute(COMPONENTS_NAMES_ID(), ModelAPI_AttributeStringArray::typeId());
   data()->addAttribute(STAMPS_ID(), ModelAPI_AttributeIntArray::typeId());
   data()->addAttribute(VALUES_ID(), ModelAPI_AttributeTables::typeId());