1 // Name : ModelHighAPI_Tools.h
5 // 07/06/16 - Sergey POKHODENKO - Creation of the file
7 #ifndef SRC_MODELHIGHAPI_MODELHIGHAPI_TOOLS_H_
8 #define SRC_MODELHIGHAPI_MODELHIGHAPI_TOOLS_H_
10 //--------------------------------------------------------------------------------------
11 #include "ModelHighAPI.h"
13 #include <GeomAPI_Shape.h>
18 //--------------------------------------------------------------------------------------
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 //--------------------------------------------------------------------------------------
47 void fillAttribute(const std::shared_ptr<GeomAPI_Pnt2d> & theValue,
48 const std::shared_ptr<GeomDataAPI_Point2D> & theAttribute);
51 void fillAttribute(const std::shared_ptr<GeomDataAPI_Point2D> & theAttribute,
52 double theX, double theY);
55 void fillAttribute(const std::shared_ptr<GeomAPI_Dir> & theValue,
56 const std::shared_ptr<GeomDataAPI_Dir> & theAttribute);
59 void fillAttribute(const std::shared_ptr<GeomAPI_Pnt> & theValue,
60 const std::shared_ptr<GeomDataAPI_Point> & theAttribute);
62 //--------------------------------------------------------------------------------------
64 void fillAttribute(bool theValue,
65 const std::shared_ptr<ModelAPI_AttributeBoolean> & theAttribute);
68 void fillAttribute(const ModelHighAPI_Double & theValue,
69 const std::shared_ptr<ModelAPI_AttributeDouble> & theAttribute);
72 void fillAttribute(double theValue,
73 const std::shared_ptr<ModelAPI_AttributeDouble> & theAttribute);
76 void fillAttribute(const ModelHighAPI_Integer & theValue,
77 const std::shared_ptr<ModelAPI_AttributeInteger> & theAttribute);
80 void fillAttribute(int theValue,
81 const std::shared_ptr<ModelAPI_AttributeInteger> & theAttribute);
84 void fillAttribute(const ModelHighAPI_RefAttr & theValue,
85 const std::shared_ptr<ModelAPI_AttributeRefAttr> & theAttribute);
88 void fillAttribute(const std::list<ModelHighAPI_RefAttr> & theValue,
89 const std::shared_ptr<ModelAPI_AttributeRefAttrList> & theAttribute);
92 void fillAttribute(const ModelHighAPI_Reference & theValue,
93 const std::shared_ptr<ModelAPI_AttributeReference> & theAttribute);
96 void fillAttribute(const std::list<ModelHighAPI_Reference> & theValue,
97 const std::shared_ptr<ModelAPI_AttributeRefList> & theAttribute);
100 void fillAttribute(const std::shared_ptr<ModelAPI_Object> & theValue,
101 const std::shared_ptr<ModelAPI_AttributeReference> & theAttribute);
104 void fillAttribute(const std::list<std::shared_ptr<ModelAPI_Object> > & theValue,
105 const std::shared_ptr<ModelAPI_AttributeRefList> & theAttribute);
108 void fillAttribute(const std::list<ModelHighAPI_Selection> & theValue,
109 const std::shared_ptr<ModelAPI_AttributeRefList> & theAttribute);
112 void fillAttribute(const ModelHighAPI_Selection & theValue,
113 const std::shared_ptr<ModelAPI_AttributeSelection> & theAttribute);
116 void fillAttribute(const std::list<ModelHighAPI_Selection> & theValue,
117 const std::shared_ptr<ModelAPI_AttributeSelectionList> & theAttribute);
120 void fillAttribute(const std::string & theValue,
121 const std::shared_ptr<ModelAPI_AttributeString> & theAttribute);
123 void fillAttribute(const char * theValue,
124 const std::shared_ptr<ModelAPI_AttributeString> & theAttribute);
127 GeomAPI_Shape::ShapeType shapeTypeByStr(std::string theShapeTypeStr);
130 GeomAPI_Shape::ShapeType getShapeType(const ModelHighAPI_Selection& theSelection);
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
136 bool checkPythonDump();
138 //--------------------------------------------------------------------------------------
139 //--------------------------------------------------------------------------------------
140 #endif /* SRC_MODELHIGHAPI_MODELHIGHAPI_TOOLS_H_ */