Salome HOME
Issue #2167: error when create circle
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_IntersectionPoint.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:    SketchPlugin_IntersectionPoint.h
4 // Created: 07 May 2014
5 // Author:  Artem ZHIDKOV
6
7 #ifndef SketchPlugin_IntersectionPoint_H_
8 #define SketchPlugin_IntersectionPoint_H_
9
10 #include "SketchPlugin_Point.h"
11
12 /**\class SketchPlugin_IntersectionPoint
13  * \ingroup Plugins
14  * \brief Feature for creation of external point as an intersection
15  *        between external edge and a plane of the sketch.
16  */
17 class SketchPlugin_IntersectionPoint : public SketchPlugin_Point
18 {
19 public:
20   /// Point feature kind
21   inline static const std::string& ID()
22   {
23     static const std::string MY_POINT_ID("SketchIntersectionPoint");
24     return MY_POINT_ID;
25   }
26   /// Returns the kind of a feature
27   virtual const std::string& getKind()
28   {
29     static std::string MY_KIND = SketchPlugin_IntersectionPoint::ID();
30     return MY_KIND;
31   }
32
33   static const std::string& EXTERNAL_LINE_ID()
34   {
35     static std::string MY_LINE_ID("ExternalLine");
36     return MY_LINE_ID;
37   }
38
39   /// Returns true because intersection point is always external
40   virtual bool isFixed()
41   { return true; }
42
43   /// Creates a new part document if needed
44   SKETCHPLUGIN_EXPORT virtual void execute();
45
46   /// Moves the feature
47   /// \param theDeltaX the delta for X coordinate is moved
48   /// \param theDeltaY the delta for Y coordinate is moved
49   SKETCHPLUGIN_EXPORT virtual void move(const double theDeltaX, const double theDeltaY);
50
51   /// Called on change of any argument-attribute of this object: for external point
52   SKETCHPLUGIN_EXPORT virtual void attributeChanged(const std::string& theID);
53
54   /// Use plugin manager for features creation
55   SketchPlugin_IntersectionPoint();
56
57 protected:
58   /// \brief Initializes attributes of derived class.
59   virtual void initDerivedClassAttributes();
60
61 private:
62   /// \brief Find intersection between a line and a sketch plane
63   void computePoint();
64 };
65
66 #endif