1 // Copyright (C) 2014-2017 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
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 #ifndef COLLECTIONPLUGIN_FIELD_H_
22 #define COLLECTIONPLUGIN_FIELD_H_
24 #include "CollectionPlugin.h"
25 #include <ModelAPI_Feature.h>
26 #include <GeomAPI_Shape.h>
28 /**\class CollectionPlugin_Field
30 * \brief Feature for selection of sub-shapes of some shapes and assigning data on them.
32 * There is a set of containers that contains the following data that may be inserted by the user:
34 * Selected sub-shapes (like in Groups).
35 * Number of components for each selection.
37 * Type of values: Boolean, Integer, Double or String.
38 * Number of steps: for each step (indexes are zero-based) the values below are multiplied.
39 * Stamp: integer identifier per each step
40 * Defaul values for each components
41 * Values for each component and each selected sub-shape: all are of specific type.
43 class CollectionPlugin_Field : public ModelAPI_Feature
47 inline static const std::string& ID()
49 static const std::string MY_FIELD_ID("Field");
52 /// attribute name of selected entities list
53 inline static const std::string& SELECTED_ID()
55 static const std::string MY_SELECTED_ID("selected");
56 return MY_SELECTED_ID;
58 /// attribute name of componenets titles array
59 inline static const std::string& COMPONENTS_NAMES_ID()
61 static const std::string MY_COMPONENTS_NAMES_ID("components_names");
62 return MY_COMPONENTS_NAMES_ID;
64 /// attribute name of stamps integer array
65 inline static const std::string& STAMPS_ID()
67 static const std::string MY_STAMPS_ID("stamps");
70 /// attribute name of list of tables that contain deafult values (row 0) and the custom values
71 inline static const std::string& VALUES_ID()
73 static const std::string MY_VALUES_ID("values");
77 /// Returns the kind of a feature
78 COLLECTIONPLUGIN_EXPORT virtual const std::string& getKind()
80 static std::string MY_KIND = CollectionPlugin_Field::ID();
84 /// Creates a new field result if needed
85 COLLECTIONPLUGIN_EXPORT virtual void execute();
87 /// Request for initialization of data model of the feature: adding all attributes
88 COLLECTIONPLUGIN_EXPORT virtual void initAttributes();
90 /// Result of fields is created on the fly and don't stored to the document
91 COLLECTIONPLUGIN_EXPORT virtual bool isPersistentResult() {return false;}
93 /// Use plugin manager for features creation
94 CollectionPlugin_Field();