1 // Copyright (C) 2014-2020 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef COLLECTIONPLUGIN_FIELD_H_
21 #define COLLECTIONPLUGIN_FIELD_H_
23 #include "CollectionPlugin.h"
24 #include <ModelAPI_Feature.h>
25 #include <GeomAPI_Shape.h>
27 /**\class CollectionPlugin_Field
29 * \brief Feature for selection of sub-shapes of some shapes and assigning data on them.
31 * There is a set of containers that contains the following data that may be inserted by the user:
33 * Selected sub-shapes (like in Groups).
34 * Number of components for each selection.
36 * Type of values: Boolean, Integer, Double or String.
37 * Number of steps: for each step (indexes are zero-based) the values below are multiplied.
38 * Stamp: integer identifier per each step
39 * Defaul values for each components
40 * Values for each component and each selected sub-shape: all are of specific type.
42 class CollectionPlugin_Field : public ModelAPI_Feature
46 inline static const std::string& ID()
48 static const std::string MY_FIELD_ID("Field");
51 /// attribute name of selected entities list
52 inline static const std::string& SELECTED_ID()
54 static const std::string MY_SELECTED_ID("selected");
55 return MY_SELECTED_ID;
57 /// attribute name of componenets titles array
58 inline static const std::string& COMPONENTS_NAMES_ID()
60 static const std::string MY_COMPONENTS_NAMES_ID("components_names");
61 return MY_COMPONENTS_NAMES_ID;
63 /// attribute name of stamps integer array
64 inline static const std::string& STAMPS_ID()
66 static const std::string MY_STAMPS_ID("stamps");
69 /// attribute name of list of tables that contain deafult values (row 0) and the custom values
70 inline static const std::string& VALUES_ID()
72 static const std::string MY_VALUES_ID("values");
76 /// Returns the kind of a feature
77 COLLECTIONPLUGIN_EXPORT virtual const std::string& getKind()
79 static std::string MY_KIND = CollectionPlugin_Field::ID();
83 /// Creates a new field result if needed
84 COLLECTIONPLUGIN_EXPORT virtual void execute();
86 /// Request for initialization of data model of the feature: adding all attributes
87 COLLECTIONPLUGIN_EXPORT virtual void initAttributes();
89 /// Result of fields is created on the fly and don't stored to the document
90 COLLECTIONPLUGIN_EXPORT virtual bool isPersistentResult() {return false;}
92 /// Use plugin manager for features creation
93 CollectionPlugin_Field();