Salome HOME
Merge branch 'master' of newgeom:newgeom
[modules/shaper.git] / src / PartSet / PartSet_FeatureCirclePrs.h
1 // File:        PartSet_FeatureCirclePrs.h
2 // Created:     04 Jun 2014
3 // Author:      Natalia ERMOLAEVA
4
5 #ifndef PartSet_FeatureCirclePrs_H
6 #define PartSet_FeatureCirclePrs_H
7
8 #include "PartSet.h"
9
10 #include "PartSet_FeaturePrs.h"
11 #include "PartSet_Constants.h"
12
13 class GeomDataAPI_Point2D;
14
15 /*!
16  \class PartSet_FeatureCirclePrs
17  * \brief The class to define the circle feature manipulation. It is created for
18  * the feature create operation to move out the feature properties set and use one operation
19  * for any type of features.
20 */
21 class PARTSET_EXPORT PartSet_FeatureCirclePrs : public PartSet_FeaturePrs
22 {
23 public:
24   /// Returns the feature type processed by this presentation
25   /// \return the feature kind
26   static std::string getKind();
27
28   /// Constructor
29   /// \param theSketch the sketch feature
30   PartSet_FeatureCirclePrs(FeaturePtr theSketch);
31   /// Destructor
32   virtual ~PartSet_FeatureCirclePrs() {};
33
34   /// Sets the point to the feature in an attribute depending on the selection mode
35   /// \param theX the 2D point horizontal coordinate
36   /// \param theY the 2D point vertical coordinate
37   /// \param theMode the selection mode
38   /// \return the new selection mode
39   virtual PartSet_SelectionMode setPoint(double theX, double theY,
40                                          const PartSet_SelectionMode& theMode);
41
42   /// Returns the feature attribute name for the selection mode
43   /// \param theMode the current operation selection mode. The feature attribute depends on the mode
44   virtual std::string getAttribute(const PartSet_SelectionMode& theMode) const;
45
46   /// Returns the next selection mode after the attribute
47   /// \param theAttribute the feature attribute name
48   /// \return next attribute selection mode
49   virtual PartSet_SelectionMode getNextMode(const std::string& theAttribute) const;
50
51   /// \brief Move the full feature.
52   /// \param theDeltaX the delta for X coordinate is moved
53   /// \param theDeltaY the delta for Y coordinate is moved
54   virtual void move(double theDeltaX, double theDeltaY);
55
56   /// Return the distance between the feature and the point
57   /// \param theFeature feature object
58   /// \param theX the horizontal coordinate of the point
59   /// \param theX the vertical coordinate of the point
60   virtual double distanceToPoint(FeaturePtr theFeature, double theX, double theY);
61
62   /// Find a point in the line with given coordinates
63   /// \param theFeature the line feature
64   /// \param theX the horizontal point coordinate
65   /// \param theY the vertical point coordinate
66   virtual boost::shared_ptr<GeomDataAPI_Point2D> findPoint(FeaturePtr theFeature, double theX,
67                                                            double theY);
68 protected:
69   /// Returns the feature point in the selection mode position.
70   /// \param theMode the current operation selection mode. The feature attribute depends on the mode
71   virtual boost::shared_ptr<GeomDataAPI_Point2D> featurePoint(const PartSet_SelectionMode& theMode);
72 };
73
74 #endif