Salome HOME
Update line endings according to coding rules
[modules/shaper.git] / src / ModelHighAPI / ModelHighAPI_Tools.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2 // Name   : ModelHighAPI_Tools.h
3 // Purpose:
4 //
5 // History:
6 // 07/06/16 - Sergey POKHODENKO - Creation of the file
7
8 #ifndef SRC_MODELHIGHAPI_MODELHIGHAPI_TOOLS_H_
9 #define SRC_MODELHIGHAPI_MODELHIGHAPI_TOOLS_H_
10
11 //--------------------------------------------------------------------------------------
12 #include "ModelHighAPI.h"
13 #include <ModelAPI_AttributeTables.h>
14
15 #include <GeomAPI_Shape.h>
16
17 #include <list>
18 #include <memory>
19 #include <string>
20 //--------------------------------------------------------------------------------------
21 class GeomAPI_Dir;
22 class GeomAPI_Pnt;
23 class GeomAPI_Pnt2d;
24 //--------------------------------------------------------------------------------------
25 class GeomDataAPI_Dir;
26 class GeomDataAPI_Point;
27 class GeomDataAPI_Point2D;
28 //--------------------------------------------------------------------------------------
29 class ModelAPI_AttributeBoolean;
30 class ModelAPI_AttributeDouble;
31 class ModelAPI_AttributeIntArray;
32 class ModelAPI_AttributeInteger;
33 class ModelAPI_AttributeRefAttr;
34 class ModelAPI_AttributeRefAttrList;
35 class ModelAPI_AttributeReference;
36 class ModelAPI_AttributeRefList;
37 class ModelAPI_AttributeSelection;
38 class ModelAPI_AttributeSelectionList;
39 class ModelAPI_AttributeString;
40 class ModelAPI_AttributeStringArray;
41 class ModelAPI_Object;
42 //--------------------------------------------------------------------------------------
43 class ModelHighAPI_Double;
44 class ModelHighAPI_Integer;
45 class ModelHighAPI_RefAttr;
46 class ModelHighAPI_Reference;
47 class ModelHighAPI_Selection;
48 //--------------------------------------------------------------------------------------
49 MODELHIGHAPI_EXPORT
50 void fillAttribute(const std::shared_ptr<GeomAPI_Pnt2d> & theValue,
51                    const std::shared_ptr<GeomDataAPI_Point2D> & theAttribute);
52
53 MODELHIGHAPI_EXPORT
54 void fillAttribute(const std::shared_ptr<GeomDataAPI_Point2D> & theAttribute,
55                    double theX, double theY);
56
57 MODELHIGHAPI_EXPORT
58 void fillAttribute(const std::shared_ptr<GeomAPI_Dir> & theValue,
59                    const std::shared_ptr<GeomDataAPI_Dir> & theAttribute);
60
61 MODELHIGHAPI_EXPORT
62 void fillAttribute(const std::shared_ptr<GeomAPI_Pnt> & theValue,
63                    const std::shared_ptr<GeomDataAPI_Point> & theAttribute);
64
65 //--------------------------------------------------------------------------------------
66 MODELHIGHAPI_EXPORT
67 void fillAttribute(bool theValue,
68                    const std::shared_ptr<ModelAPI_AttributeBoolean> & theAttribute);
69
70 MODELHIGHAPI_EXPORT
71 void fillAttribute(const ModelHighAPI_Double & theValue,
72                    const std::shared_ptr<ModelAPI_AttributeDouble> & theAttribute);
73
74 MODELHIGHAPI_EXPORT
75 void fillAttribute(double theValue,
76                    const std::shared_ptr<ModelAPI_AttributeDouble> & theAttribute);
77
78 MODELHIGHAPI_EXPORT
79 void fillAttribute(const ModelHighAPI_Integer & theValue,
80                    const std::shared_ptr<ModelAPI_AttributeInteger> & theAttribute);
81
82 MODELHIGHAPI_EXPORT
83 void fillAttribute(int theValue,
84                    const std::shared_ptr<ModelAPI_AttributeInteger> & theAttribute);
85
86 MODELHIGHAPI_EXPORT
87 void fillAttribute(const ModelHighAPI_RefAttr & theValue,
88                    const std::shared_ptr<ModelAPI_AttributeRefAttr> & theAttribute);
89
90 MODELHIGHAPI_EXPORT
91 void fillAttribute(const std::list<ModelHighAPI_RefAttr> & theValue,
92                    const std::shared_ptr<ModelAPI_AttributeRefAttrList> & theAttribute);
93
94 MODELHIGHAPI_EXPORT
95 void fillAttribute(const ModelHighAPI_Reference & theValue,
96                    const std::shared_ptr<ModelAPI_AttributeReference> & theAttribute);
97
98 MODELHIGHAPI_EXPORT
99 void fillAttribute(const std::list<ModelHighAPI_Reference> & theValue,
100                    const std::shared_ptr<ModelAPI_AttributeRefList> & theAttribute);
101
102 MODELHIGHAPI_EXPORT
103 void fillAttribute(const std::shared_ptr<ModelAPI_Object> & theValue,
104                    const std::shared_ptr<ModelAPI_AttributeReference> & theAttribute);
105
106 MODELHIGHAPI_EXPORT
107 void fillAttribute(const std::list<std::shared_ptr<ModelAPI_Object> > & theValue,
108                    const std::shared_ptr<ModelAPI_AttributeRefList> & theAttribute);
109
110 MODELHIGHAPI_EXPORT
111 void fillAttribute(const std::list<ModelHighAPI_Selection> & theValue,
112                    const std::shared_ptr<ModelAPI_AttributeRefList> & theAttribute);
113
114 MODELHIGHAPI_EXPORT
115 void fillAttribute(const ModelHighAPI_Selection & theValue,
116                    const std::shared_ptr<ModelAPI_AttributeSelection> & theAttribute);
117
118 MODELHIGHAPI_EXPORT
119 void fillAttribute(const std::list<ModelHighAPI_Selection> & theValue,
120                    const std::shared_ptr<ModelAPI_AttributeSelectionList> & theAttribute);
121
122 MODELHIGHAPI_EXPORT
123 void fillAttribute(const std::string & theValue,
124                    const std::shared_ptr<ModelAPI_AttributeString> & theAttribute);
125 MODELHIGHAPI_EXPORT
126 void fillAttribute(const char * theValue,
127                    const std::shared_ptr<ModelAPI_AttributeString> & theAttribute);
128
129 MODELHIGHAPI_EXPORT
130 void fillAttribute(const std::list<std::string> & theValue,
131                    const std::shared_ptr<ModelAPI_AttributeStringArray> & theAttribute);
132
133 MODELHIGHAPI_EXPORT
134 void fillAttribute(const std::list<ModelHighAPI_Integer> & theValue,
135                    const std::shared_ptr<ModelAPI_AttributeIntArray> & theAttribute);
136
137 MODELHIGHAPI_EXPORT
138 GeomAPI_Shape::ShapeType shapeTypeByStr(std::string theShapeTypeStr);
139
140 MODELHIGHAPI_EXPORT
141 GeomAPI_Shape::ShapeType getShapeType(const ModelHighAPI_Selection& theSelection);
142
143 MODELHIGHAPI_EXPORT
144 ModelAPI_AttributeTables::ValueType valueTypeByStr(const std::string& theValueTypeStr);
145
146 MODELHIGHAPI_EXPORT
147 std::string strByValueType(const ModelAPI_AttributeTables::ValueType theType);
148
149 /// Performs the high level API dump, then closes all and executes the script:
150 /// model must be recreated fully, with all attributes
151 /// \returns true if check is well done
152 MODELHIGHAPI_EXPORT
153 bool checkPythonDump();
154
155 //--------------------------------------------------------------------------------------
156 //--------------------------------------------------------------------------------------
157 #endif /* SRC_MODELHIGHAPI_MODELHIGHAPI_TOOLS_H_ */