1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 // File: CollectionPlugin_Group.h
4 // Created: 14 Nov 2016
5 // Author: Mikhail PONIKAROV
7 #ifndef COLLECTIONPLUGIN_FIELD_H_
8 #define COLLECTIONPLUGIN_FIELD_H_
10 #include "CollectionPlugin.h"
11 #include <ModelAPI_Feature.h>
12 #include <GeomAPI_Shape.h>
14 /**\class CollectionPlugin_Field
16 * \brief Feature for selection of sub-shapes of some shapes and assigning data on them.
18 * There is a set of containers that contains the following data that may be inserted by the user:
20 * Selected sub-shapes (like in Groups).
21 * Number of components for each selection.
23 * Type of values: Boolean, Integer, Double or String.
24 * Number of steps: for each step (indexes are zero-based) the values below are multiplied.
25 * Stamp: integer identifier per each step
26 * Defaul values for each components
27 * Values for each component and each selected sub-shape: all are of specific type.
29 class CollectionPlugin_Field : public ModelAPI_Feature
33 inline static const std::string& ID()
35 static const std::string MY_FIELD_ID("Field");
38 /// attribute name of selected entities list
39 inline static const std::string& SELECTED_ID()
41 static const std::string MY_SELECTED_ID("selected");
42 return MY_SELECTED_ID;
44 /// attribute name of components number
45 inline static const std::string& COMPONENTS_NB_ID()
47 static const std::string MY_COMPONENTS_NB_ID("components_nb");
48 return MY_COMPONENTS_NB_ID;
50 /// attribute name of componenets titles array
51 inline static const std::string& COMPONENTS_NAMES_ID()
53 static const std::string MY_COMPONENTS_NAMES_ID("components_names");
54 return MY_COMPONENTS_NAMES_ID;
56 /// attribute name of values types integer identifier
57 inline static const std::string& VALUES_TYPE_ID()
59 static const std::string MY_VALUES_TYPE_ID("type");
60 return MY_VALUES_TYPE_ID;
62 /// attribute name of number of steps
63 inline static const std::string& STEPS_NB_ID()
65 static const std::string MY_STEPS_NB_ID("steps_nb");
66 return MY_STEPS_NB_ID;
68 /// attribute name of stamps integer array
69 inline static const std::string& STAMPS_ID()
71 static const std::string MY_STAMPS_ID("stamps");
74 /// attribute name of list of tables that contain deafult values (row 0) and the custom values
75 inline static const std::string& VALUES_ID()
77 static const std::string MY_VALUES_ID("values");
81 /// Returns the kind of a feature
82 COLLECTIONPLUGIN_EXPORT virtual const std::string& getKind()
84 static std::string MY_KIND = CollectionPlugin_Field::ID();
88 /// Creates a new field result if needed
89 COLLECTIONPLUGIN_EXPORT virtual void execute();
91 /// Request for initialization of data model of the feature: adding all attributes
92 COLLECTIONPLUGIN_EXPORT virtual void initAttributes();
94 /// Result of fields is created on the fly and don't stored to the document
95 COLLECTIONPLUGIN_EXPORT virtual bool isPersistentResult() {return false;}
97 /// Use plugin manager for features creation
98 CollectionPlugin_Field();