1 // Name : SketchAPI_Sketch.h
5 // 07/06/16 - Sergey POKHODENKO - Creation of the file
7 #ifndef SRC_SKETCHAPI_SKETCHAPI_SKETCH_H_
8 #define SRC_SKETCHAPI_SKETCHAPI_SKETCH_H_
10 //--------------------------------------------------------------------------------------
11 #include "SketchAPI.h"
13 #include <SketchPlugin_Sketch.h>
14 #include <SketchPlugin_SketchEntity.h>
16 #include <ModelHighAPI_Interface.h>
17 #include <ModelHighAPI_Macro.h>
18 //--------------------------------------------------------------------------------------
19 class ModelAPI_CompositeFeature;
20 class ModelHighAPI_Selection;
22 //--------------------------------------------------------------------------------------
23 /**\class SketchAPI_Sketch
25 * \brief Interface for Sketch feature
27 class SketchAPI_Sketch : public ModelHighAPI_Interface
30 /// Constructor without values
32 explicit SketchAPI_Sketch(const std::shared_ptr<ModelAPI_Feature> & theFeature);
33 /// Constructor with values
35 SketchAPI_Sketch(const std::shared_ptr<ModelAPI_Feature> & theFeature,
36 const std::shared_ptr<GeomAPI_Ax3> & thePlane);
37 /// Constructor with values
39 SketchAPI_Sketch(const std::shared_ptr<ModelAPI_Feature> & theFeature,
40 const ModelHighAPI_Selection & theExternal);
43 virtual ~SketchAPI_Sketch();
45 INTERFACE_7(SketchPlugin_Sketch::ID(),
46 origin, SketchPlugin_Sketch::ORIGIN_ID(), GeomDataAPI_Point, /** Origin point */,
47 dirX, SketchPlugin_Sketch::DIRX_ID(), GeomDataAPI_Dir, /** Direction of X */,
48 normal, SketchPlugin_Sketch::NORM_ID(), GeomDataAPI_Dir, /** Normal */,
49 features, SketchPlugin_Sketch::FEATURES_ID(), ModelAPI_AttributeRefList, /** Features */,
50 external, SketchPlugin_SketchEntity::EXTERNAL_ID(), ModelAPI_AttributeSelection, /** External */,
51 solverError, SketchPlugin_Sketch::SOLVER_ERROR(), ModelAPI_AttributeString, /** Solver error */,
52 solverDOF, SketchPlugin_Sketch::SOLVER_DOF(), ModelAPI_AttributeString, /** Solver DOF */
57 void setPlane(const std::shared_ptr<GeomAPI_Ax3> & thePlane);
61 void setExternal(const ModelHighAPI_Selection & theExternal);
63 // TODO(spo): addPoint
67 std::shared_ptr<SketchAPI_Line> addLine(
68 double theX1, double theY1, double theX2, double theY2);
71 std::shared_ptr<SketchAPI_Line> addLine(
72 const std::shared_ptr<GeomAPI_Pnt2d> & theStartPoint,
73 const std::shared_ptr<GeomAPI_Pnt2d> & theEndPoint);
76 std::shared_ptr<SketchAPI_Line> addLine(const ModelHighAPI_Selection & theExternal);
79 std::shared_ptr<SketchAPI_Line> addLine(const std::string & theExternalName);
81 // TODO(spo): addCircle
84 // TODO(spo): set* (constraints)
86 // TODO(spo): setValue
90 std::shared_ptr<ModelAPI_CompositeFeature> compositeFeature() const;
94 //! Pointer on Sketch object
95 typedef std::shared_ptr<SketchAPI_Sketch> SketchPtr;
97 /**\ingroup CPPHighAPI
98 * \brief Create Sketch feature
101 SketchPtr addSketch(const std::shared_ptr<ModelAPI_Document> & thePart,
102 const std::shared_ptr<GeomAPI_Ax3> & thePlane);
104 /**\ingroup CPPHighAPI
105 * \brief Create Sketch feature
108 SketchPtr addSketch(const std::shared_ptr<ModelAPI_Document> & thePart,
109 const ModelHighAPI_Selection & theExternal);
111 //--------------------------------------------------------------------------------------
112 //--------------------------------------------------------------------------------------
113 #endif /* SRC_SKETCHAPI_SKETCHAPI_SKETCH_H_ */