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);
65 std::shared_ptr<SketchAPI_Line> addLine(
66 double theX1, double theY1, double theX2, double theY2);
69 std::shared_ptr<SketchAPI_Line> addLine(
70 const std::shared_ptr<GeomAPI_Pnt2d> & theStartPoint,
71 const std::shared_ptr<GeomAPI_Pnt2d> & theEndPoint);
74 std::shared_ptr<SketchAPI_Line> addLine(const ModelHighAPI_Selection & theExternal);
77 std::shared_ptr<SketchAPI_Line> addLine(const std::string & theExternalName);
80 std::shared_ptr<ModelAPI_CompositeFeature> compositeFeature() const;
84 //! Pointer on Sketch object
85 typedef std::shared_ptr<SketchAPI_Sketch> SketchPtr;
87 /**\ingroup CPPHighAPI
88 * \brief Create Sketch feature
91 SketchPtr addSketch(const std::shared_ptr<ModelAPI_Document> & thePart,
92 const std::shared_ptr<GeomAPI_Ax3> & thePlane);
94 /**\ingroup CPPHighAPI
95 * \brief Create Sketch feature
98 SketchPtr addSketch(const std::shared_ptr<ModelAPI_Document> & thePart,
99 const ModelHighAPI_Selection & theExternal);
101 //--------------------------------------------------------------------------------------
102 //--------------------------------------------------------------------------------------
103 #endif /* SRC_SKETCHAPI_SKETCHAPI_SKETCH_H_ */