1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 // File: SketchPlugin_Line.h
4 // Created: 24 Apr 2014
5 // Author: Mikhail PONIKAROV
7 #ifndef SketchPlugin_Line_H_
8 #define SketchPlugin_Line_H_
10 #include "SketchPlugin.h"
11 #include <SketchPlugin_SketchEntity.h>
12 #include <SketchPlugin_Sketch.h>
17 /**\class SketchPlugin_Line
19 * \brief Feature for creation of the new part in PartSet.
21 class SketchPlugin_Line : public SketchPlugin_SketchEntity
25 inline static const std::string& ID()
27 static const std::string SKETCH_LINE_ID("SketchLine");
28 return SKETCH_LINE_ID;
30 /// Start 2D point of the line
31 inline static const std::string& START_ID()
33 static const std::string MY_START_ID("StartPoint");
36 /// End 2D point of the line
37 inline static const std::string& END_ID()
39 static const std::string MY_END_ID("EndPoint");
43 /// Returns the kind of a feature
44 SKETCHPLUGIN_EXPORT virtual const std::string& getKind();
46 /// Returns true is sketch element is under the rigid constraint
47 SKETCHPLUGIN_EXPORT virtual bool isFixed();
49 /// Creates a new part document if needed
50 SKETCHPLUGIN_EXPORT virtual void execute();
53 /// \param theDeltaX the delta for X coordinate is moved
54 /// \param theDeltaY the delta for Y coordinate is moved
55 SKETCHPLUGIN_EXPORT virtual void move(const double theDeltaX, const double theDeltaY);
57 /// Return the distance between the feature and the point
58 /// \param thePoint the point
59 double distanceToPoint(const std::shared_ptr<GeomAPI_Pnt2d>& thePoint);
61 /// Called on change of any argument-attribute of this object
62 SKETCHPLUGIN_EXPORT virtual void attributeChanged(const std::string& theID);
64 /// Use plugin manager for features creation
68 /// \brief Initializes attributes of derived class.
69 virtual void initDerivedClassAttributes();