]> SALOME platform Git repositories - modules/shaper.git/blob - src/ModelHighAPI/ModelHighAPI_Tools.h
Salome HOME
Add copyright header according to request of CEA from 06.06.2017
[modules/shaper.git] / src / ModelHighAPI / ModelHighAPI_Tools.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 email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
18 //
19
20 #ifndef SRC_MODELHIGHAPI_MODELHIGHAPI_TOOLS_H_
21 #define SRC_MODELHIGHAPI_MODELHIGHAPI_TOOLS_H_
22
23 //--------------------------------------------------------------------------------------
24 #include "ModelHighAPI.h"
25 #include <ModelAPI_AttributeTables.h>
26
27 #include <GeomAPI_Shape.h>
28
29 #include <list>
30 #include <memory>
31 #include <string>
32 //--------------------------------------------------------------------------------------
33 class GeomAPI_Dir;
34 class GeomAPI_Pnt;
35 class GeomAPI_Pnt2d;
36 //--------------------------------------------------------------------------------------
37 class GeomDataAPI_Dir;
38 class GeomDataAPI_Point;
39 class GeomDataAPI_Point2D;
40 //--------------------------------------------------------------------------------------
41 class ModelAPI_AttributeBoolean;
42 class ModelAPI_AttributeDouble;
43 class ModelAPI_AttributeIntArray;
44 class ModelAPI_AttributeInteger;
45 class ModelAPI_AttributeRefAttr;
46 class ModelAPI_AttributeRefAttrList;
47 class ModelAPI_AttributeReference;
48 class ModelAPI_AttributeRefList;
49 class ModelAPI_AttributeSelection;
50 class ModelAPI_AttributeSelectionList;
51 class ModelAPI_AttributeString;
52 class ModelAPI_AttributeStringArray;
53 class ModelAPI_Object;
54 //--------------------------------------------------------------------------------------
55 class ModelHighAPI_Double;
56 class ModelHighAPI_Integer;
57 class ModelHighAPI_RefAttr;
58 class ModelHighAPI_Reference;
59 class ModelHighAPI_Selection;
60 //--------------------------------------------------------------------------------------
61 MODELHIGHAPI_EXPORT
62 void fillAttribute(const std::shared_ptr<GeomAPI_Pnt2d> & theValue,
63                    const std::shared_ptr<GeomDataAPI_Point2D> & theAttribute);
64
65 MODELHIGHAPI_EXPORT
66 void fillAttribute(const std::shared_ptr<GeomDataAPI_Point2D> & theAttribute,
67                    double theX, double theY);
68
69 MODELHIGHAPI_EXPORT
70 void fillAttribute(const std::shared_ptr<GeomAPI_Dir> & theValue,
71                    const std::shared_ptr<GeomDataAPI_Dir> & theAttribute);
72
73 MODELHIGHAPI_EXPORT
74 void fillAttribute(const std::shared_ptr<GeomAPI_Pnt> & theValue,
75                    const std::shared_ptr<GeomDataAPI_Point> & theAttribute);
76
77 //--------------------------------------------------------------------------------------
78 MODELHIGHAPI_EXPORT
79 void fillAttribute(bool theValue,
80                    const std::shared_ptr<ModelAPI_AttributeBoolean> & theAttribute);
81
82 MODELHIGHAPI_EXPORT
83 void fillAttribute(const ModelHighAPI_Double & theValue,
84                    const std::shared_ptr<ModelAPI_AttributeDouble> & theAttribute);
85
86 MODELHIGHAPI_EXPORT
87 void fillAttribute(double theValue,
88                    const std::shared_ptr<ModelAPI_AttributeDouble> & theAttribute);
89
90 MODELHIGHAPI_EXPORT
91 void fillAttribute(const ModelHighAPI_Integer & theValue,
92                    const std::shared_ptr<ModelAPI_AttributeInteger> & theAttribute);
93
94 MODELHIGHAPI_EXPORT
95 void fillAttribute(int theValue,
96                    const std::shared_ptr<ModelAPI_AttributeInteger> & theAttribute);
97
98 MODELHIGHAPI_EXPORT
99 void fillAttribute(const ModelHighAPI_RefAttr & theValue,
100                    const std::shared_ptr<ModelAPI_AttributeRefAttr> & theAttribute);
101
102 MODELHIGHAPI_EXPORT
103 void fillAttribute(const std::list<ModelHighAPI_RefAttr> & theValue,
104                    const std::shared_ptr<ModelAPI_AttributeRefAttrList> & theAttribute);
105
106 MODELHIGHAPI_EXPORT
107 void fillAttribute(const ModelHighAPI_Reference & theValue,
108                    const std::shared_ptr<ModelAPI_AttributeReference> & theAttribute);
109
110 MODELHIGHAPI_EXPORT
111 void fillAttribute(const std::list<ModelHighAPI_Reference> & theValue,
112                    const std::shared_ptr<ModelAPI_AttributeRefList> & theAttribute);
113
114 MODELHIGHAPI_EXPORT
115 void fillAttribute(const std::shared_ptr<ModelAPI_Object> & theValue,
116                    const std::shared_ptr<ModelAPI_AttributeReference> & theAttribute);
117
118 MODELHIGHAPI_EXPORT
119 void fillAttribute(const std::list<std::shared_ptr<ModelAPI_Object> > & theValue,
120                    const std::shared_ptr<ModelAPI_AttributeRefList> & theAttribute);
121
122 MODELHIGHAPI_EXPORT
123 void fillAttribute(const std::list<ModelHighAPI_Selection> & theValue,
124                    const std::shared_ptr<ModelAPI_AttributeRefList> & theAttribute);
125
126 MODELHIGHAPI_EXPORT
127 void fillAttribute(const ModelHighAPI_Selection & theValue,
128                    const std::shared_ptr<ModelAPI_AttributeSelection> & theAttribute);
129
130 MODELHIGHAPI_EXPORT
131 void fillAttribute(const std::list<ModelHighAPI_Selection> & theValue,
132                    const std::shared_ptr<ModelAPI_AttributeSelectionList> & theAttribute);
133
134 MODELHIGHAPI_EXPORT
135 void fillAttribute(const std::string & theValue,
136                    const std::shared_ptr<ModelAPI_AttributeString> & theAttribute);
137 MODELHIGHAPI_EXPORT
138 void fillAttribute(const char * theValue,
139                    const std::shared_ptr<ModelAPI_AttributeString> & theAttribute);
140
141 MODELHIGHAPI_EXPORT
142 void fillAttribute(const std::list<std::string> & theValue,
143                    const std::shared_ptr<ModelAPI_AttributeStringArray> & theAttribute);
144
145 MODELHIGHAPI_EXPORT
146 void fillAttribute(const std::list<ModelHighAPI_Integer> & theValue,
147                    const std::shared_ptr<ModelAPI_AttributeIntArray> & theAttribute);
148
149 MODELHIGHAPI_EXPORT
150 GeomAPI_Shape::ShapeType shapeTypeByStr(std::string theShapeTypeStr);
151
152 MODELHIGHAPI_EXPORT
153 GeomAPI_Shape::ShapeType getShapeType(const ModelHighAPI_Selection& theSelection);
154
155 MODELHIGHAPI_EXPORT
156 ModelAPI_AttributeTables::ValueType valueTypeByStr(const std::string& theValueTypeStr);
157
158 MODELHIGHAPI_EXPORT
159 std::string strByValueType(const ModelAPI_AttributeTables::ValueType theType);
160
161 /// Performs the high level API dump, then closes all and executes the script:
162 /// model must be recreated fully, with all attributes
163 /// \returns true if check is well done
164 MODELHIGHAPI_EXPORT
165 bool checkPythonDump();
166
167 //--------------------------------------------------------------------------------------
168 //--------------------------------------------------------------------------------------
169 #endif /* SRC_MODELHIGHAPI_MODELHIGHAPI_TOOLS_H_ */