Salome HOME
High level objects history implementation for Fillet feature.
[modules/shaper.git] / src / CollectionPlugin / CollectionPlugin_Field.h
1 // Copyright (C) 2014-2017  CEA/DEN, EDF R&D
2 //
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.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
19 //
20
21 #ifndef COLLECTIONPLUGIN_FIELD_H_
22 #define COLLECTIONPLUGIN_FIELD_H_
23
24 #include "CollectionPlugin.h"
25 #include <ModelAPI_Feature.h>
26 #include <GeomAPI_Shape.h>
27
28 /**\class CollectionPlugin_Field
29  * \ingroup Plugins
30  * \brief Feature for selection of sub-shapes of some shapes and assigning data on them.
31  *
32  * There is a set of containers that contains the following data that may be inserted by the user:
33  * 
34  * Selected sub-shapes (like in Groups).
35  * Number of components for each selection.
36  * Components names
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.
42  */
43 class CollectionPlugin_Field : public ModelAPI_Feature
44 {
45  public:
46   /// Feature kind
47   inline static const std::string& ID()
48   {
49     static const std::string MY_FIELD_ID("Field");
50     return MY_FIELD_ID;
51   }
52   /// attribute name of selected entities list
53   inline static const std::string& SELECTED_ID()
54   {
55     static const std::string MY_SELECTED_ID("selected");
56     return MY_SELECTED_ID;
57   }
58   /// attribute name of componenets titles array
59   inline static const std::string& COMPONENTS_NAMES_ID()
60   {
61     static const std::string MY_COMPONENTS_NAMES_ID("components_names");
62     return MY_COMPONENTS_NAMES_ID;
63   }
64   /// attribute name of stamps integer array
65   inline static const std::string& STAMPS_ID()
66   {
67     static const std::string MY_STAMPS_ID("stamps");
68     return MY_STAMPS_ID;
69   }
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()
72   {
73     static const std::string MY_VALUES_ID("values");
74     return MY_VALUES_ID;
75   }
76
77   /// Returns the kind of a feature
78   COLLECTIONPLUGIN_EXPORT virtual const std::string& getKind()
79   {
80     static std::string MY_KIND = CollectionPlugin_Field::ID();
81     return MY_KIND;
82   }
83
84   /// Creates a new field result if needed
85   COLLECTIONPLUGIN_EXPORT virtual void execute();
86
87   /// Request for initialization of data model of the feature: adding all attributes
88   COLLECTIONPLUGIN_EXPORT virtual void initAttributes();
89
90   /// Result of fields is created on the fly and don't stored to the document
91   COLLECTIONPLUGIN_EXPORT virtual bool isPersistentResult() {return false;}
92
93   /// Use plugin manager for features creation
94   CollectionPlugin_Field();
95
96 };
97
98 #endif