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 componenets titles array
45 inline static const std::string& COMPONENTS_NAMES_ID()
47 static const std::string MY_COMPONENTS_NAMES_ID("components_names");
48 return MY_COMPONENTS_NAMES_ID;
50 /// attribute name of stamps integer array
51 inline static const std::string& STAMPS_ID()
53 static const std::string MY_STAMPS_ID("stamps");
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()
59 static const std::string MY_VALUES_ID("values");
63 /// Returns the kind of a feature
64 COLLECTIONPLUGIN_EXPORT virtual const std::string& getKind()
66 static std::string MY_KIND = CollectionPlugin_Field::ID();
70 /// Creates a new field result if needed
71 COLLECTIONPLUGIN_EXPORT virtual void execute();
73 /// Request for initialization of data model of the feature: adding all attributes
74 COLLECTIONPLUGIN_EXPORT virtual void initAttributes();
76 /// Result of fields is created on the fly and don't stored to the document
77 COLLECTIONPLUGIN_EXPORT virtual bool isPersistentResult() {return false;}
79 /// Use plugin manager for features creation
80 CollectionPlugin_Field();