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