Salome HOME
Issue #1903: Set default value for string
[modules/shaper.git] / src / CollectionPlugin / CollectionPlugin_Field.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:        CollectionPlugin_Group.h
4 // Created:     14 Nov 2016
5 // Author:      Mikhail PONIKAROV
6
7 #ifndef COLLECTIONPLUGIN_FIELD_H_
8 #define COLLECTIONPLUGIN_FIELD_H_
9
10 #include "CollectionPlugin.h"
11 #include <ModelAPI_Feature.h>
12 #include <GeomAPI_Shape.h>
13
14 /**\class CollectionPlugin_Field
15  * \ingroup Plugins
16  * \brief Feature for selection of sub-shapes of some shapes and assigning data on them.
17  *
18  * There is a set of containers that contains the following data that may be inserted by the user:
19  * 
20  * Selected sub-shapes (like in Groups).
21  * Number of components for each selection.
22  * Components names
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.
28  */
29 class CollectionPlugin_Field : public ModelAPI_Feature
30 {
31  public:
32   /// Feature kind
33   inline static const std::string& ID()
34   {
35     static const std::string MY_FIELD_ID("Field");
36     return MY_FIELD_ID;
37   }
38   /// attribute name of selected entities list
39   inline static const std::string& SELECTED_ID()
40   {
41     static const std::string MY_SELECTED_ID("selected");
42     return MY_SELECTED_ID;
43   }
44   /// attribute name of componenets titles array
45   inline static const std::string& COMPONENTS_NAMES_ID()
46   {
47     static const std::string MY_COMPONENTS_NAMES_ID("components_names");
48     return MY_COMPONENTS_NAMES_ID;
49   }
50   /// attribute name of stamps integer array
51   inline static const std::string& STAMPS_ID()
52   {
53     static const std::string MY_STAMPS_ID("stamps");
54     return MY_STAMPS_ID;
55   }
56   /// attribute name of list of tables that contain deafult values (row 0) and the custom values
57   inline static const std::string& VALUES_ID()
58   {
59     static const std::string MY_VALUES_ID("values");
60     return MY_VALUES_ID;
61   }
62
63   /// Returns the kind of a feature
64   COLLECTIONPLUGIN_EXPORT virtual const std::string& getKind()
65   {
66     static std::string MY_KIND = CollectionPlugin_Field::ID();
67     return MY_KIND;
68   }
69
70   /// Creates a new field result if needed
71   COLLECTIONPLUGIN_EXPORT virtual void execute();
72
73   /// Request for initialization of data model of the feature: adding all attributes
74   COLLECTIONPLUGIN_EXPORT virtual void initAttributes();
75
76   /// Result of fields is created on the fly and don't stored to the document
77   COLLECTIONPLUGIN_EXPORT virtual bool isPersistentResult() {return false;}
78
79   /// Use plugin manager for features creation
80   CollectionPlugin_Field();
81
82 };
83
84 #endif