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_Double;
21 class ModelHighAPI_Selection;
23 //--------------------------------------------------------------------------------------
24 /**\class SketchAPI_Sketch
26 * \brief Interface for Sketch feature
28 class SketchAPI_Sketch : public ModelHighAPI_Interface
31 /// Constructor without values
33 explicit SketchAPI_Sketch(const std::shared_ptr<ModelAPI_Feature> & theFeature);
34 /// Constructor with values
36 SketchAPI_Sketch(const std::shared_ptr<ModelAPI_Feature> & theFeature,
37 const std::shared_ptr<GeomAPI_Ax3> & thePlane);
38 /// Constructor with values
40 SketchAPI_Sketch(const std::shared_ptr<ModelAPI_Feature> & theFeature,
41 const ModelHighAPI_Selection & theExternal);
44 virtual ~SketchAPI_Sketch();
46 INTERFACE_7(SketchPlugin_Sketch::ID(),
47 origin, SketchPlugin_Sketch::ORIGIN_ID(), GeomDataAPI_Point, /** Origin point */,
48 dirX, SketchPlugin_Sketch::DIRX_ID(), GeomDataAPI_Dir, /** Direction of X */,
49 normal, SketchPlugin_Sketch::NORM_ID(), GeomDataAPI_Dir, /** Normal */,
50 features, SketchPlugin_Sketch::FEATURES_ID(), ModelAPI_AttributeRefList, /** Features */,
51 external, SketchPlugin_SketchEntity::EXTERNAL_ID(), ModelAPI_AttributeSelection, /** External */,
52 solverError, SketchPlugin_Sketch::SOLVER_ERROR(), ModelAPI_AttributeString, /** Solver error */,
53 solverDOF, SketchPlugin_Sketch::SOLVER_DOF(), ModelAPI_AttributeString, /** Solver DOF */
58 void setPlane(const std::shared_ptr<GeomAPI_Ax3> & thePlane);
62 void setExternal(const ModelHighAPI_Selection & theExternal);
64 // TODO(spo): addPoint
68 std::shared_ptr<SketchAPI_Line> addLine(
69 double theX1, double theY1, double theX2, double theY2);
72 std::shared_ptr<SketchAPI_Line> addLine(
73 const std::shared_ptr<GeomAPI_Pnt2d> & theStartPoint,
74 const std::shared_ptr<GeomAPI_Pnt2d> & theEndPoint);
77 std::shared_ptr<SketchAPI_Line> addLine(const ModelHighAPI_Selection & theExternal);
80 std::shared_ptr<SketchAPI_Line> addLine(const std::string & theExternalName);
82 // TODO(spo): addCircle
85 // TODO(spo): set* (constraints)
87 // TODO(spo): setValue
91 std::shared_ptr<ModelAPI_CompositeFeature> compositeFeature() const;
95 //! Pointer on Sketch object
96 typedef std::shared_ptr<SketchAPI_Sketch> SketchPtr;
98 /**\ingroup CPPHighAPI
99 * \brief Create Sketch feature
102 SketchPtr addSketch(const std::shared_ptr<ModelAPI_Document> & thePart,
103 const std::shared_ptr<GeomAPI_Ax3> & thePlane);
105 /**\ingroup CPPHighAPI
106 * \brief Create Sketch feature
109 SketchPtr addSketch(const std::shared_ptr<ModelAPI_Document> & thePart,
110 const ModelHighAPI_Selection & theExternal);
112 //--------------------------------------------------------------------------------------
113 //--------------------------------------------------------------------------------------
114 #endif /* SRC_SKETCHAPI_SKETCHAPI_SKETCH_H_ */