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_RefAttr;
22 class ModelHighAPI_Selection;
24 //--------------------------------------------------------------------------------------
25 /**\class SketchAPI_Sketch
27 * \brief Interface for Sketch feature
29 class SketchAPI_Sketch : public ModelHighAPI_Interface
32 /// Constructor without values
34 explicit SketchAPI_Sketch(const std::shared_ptr<ModelAPI_Feature> & theFeature);
35 /// Constructor with values
37 SketchAPI_Sketch(const std::shared_ptr<ModelAPI_Feature> & theFeature,
38 const std::shared_ptr<GeomAPI_Ax3> & thePlane);
39 /// Constructor with values
41 SketchAPI_Sketch(const std::shared_ptr<ModelAPI_Feature> & theFeature,
42 const ModelHighAPI_Selection & theExternal);
45 virtual ~SketchAPI_Sketch();
47 INTERFACE_7(SketchPlugin_Sketch::ID(),
48 origin, SketchPlugin_Sketch::ORIGIN_ID(), GeomDataAPI_Point, /** Origin point */,
49 dirX, SketchPlugin_Sketch::DIRX_ID(), GeomDataAPI_Dir, /** Direction of X */,
50 normal, SketchPlugin_Sketch::NORM_ID(), GeomDataAPI_Dir, /** Normal */,
51 features, SketchPlugin_Sketch::FEATURES_ID(), ModelAPI_AttributeRefList, /** Features */,
52 external, SketchPlugin_SketchEntity::EXTERNAL_ID(), ModelAPI_AttributeSelection, /** External */,
53 solverError, SketchPlugin_Sketch::SOLVER_ERROR(), ModelAPI_AttributeString, /** Solver error */,
54 solverDOF, SketchPlugin_Sketch::SOLVER_DOF(), ModelAPI_AttributeString, /** Solver DOF */
59 void setPlane(const std::shared_ptr<GeomAPI_Ax3> & thePlane);
63 void setExternal(const ModelHighAPI_Selection & theExternal);
65 // TODO(spo): addPoint
69 std::shared_ptr<SketchAPI_Line> addLine(
70 double theX1, double theY1, double theX2, double theY2);
73 std::shared_ptr<SketchAPI_Line> addLine(
74 const std::shared_ptr<GeomAPI_Pnt2d> & theStartPoint,
75 const std::shared_ptr<GeomAPI_Pnt2d> & theEndPoint);
78 std::shared_ptr<SketchAPI_Line> addLine(const ModelHighAPI_Selection & theExternal);
81 std::shared_ptr<SketchAPI_Line> addLine(const std::string & theExternalName);
83 // TODO(spo): addCircle
88 std::shared_ptr<ModelAPI_Feature> setCoincident(
89 // TODO(spo): should it be more concrete type (e.g. ModelAPI_Object)?
90 const ModelHighAPI_RefAttr & thePoint1,
91 const ModelHighAPI_RefAttr & thePoint2);
93 // TODO(spo): set* (constraints)
95 // TODO(spo): addMirror
100 const std::shared_ptr<ModelAPI_Feature> & theConstraint,
101 const ModelHighAPI_Double & theValue);
103 // TODO(spo): setText. Is it necessary as setValue accepts text expressions?
106 std::shared_ptr<ModelAPI_CompositeFeature> compositeFeature() const;
110 //! Pointer on Sketch object
111 typedef std::shared_ptr<SketchAPI_Sketch> SketchPtr;
113 /**\ingroup CPPHighAPI
114 * \brief Create Sketch feature
117 SketchPtr addSketch(const std::shared_ptr<ModelAPI_Document> & thePart,
118 const std::shared_ptr<GeomAPI_Ax3> & thePlane);
120 /**\ingroup CPPHighAPI
121 * \brief Create Sketch feature
124 SketchPtr addSketch(const std::shared_ptr<ModelAPI_Document> & thePart,
125 const ModelHighAPI_Selection & theExternal);
127 //--------------------------------------------------------------------------------------
128 //--------------------------------------------------------------------------------------
129 #endif /* SRC_SKETCHAPI_SKETCHAPI_SKETCH_H_ */