Salome HOME
refs #80 - Sketch base GUI: create/draw point, circle and arc
[modules/shaper.git] / src / PartSet / PartSet_FeatureArcPrs.h
1 // File:        PartSet_FeatureArcPrs.h
2 // Created:     04 Jun 2014
3 // Author:      Natalia ERMOLAEVA
4
5 #ifndef PartSet_FeatureArcPrs_H
6 #define PartSet_FeatureArcPrs_H
7
8 #include "PartSet.h"
9
10 #include "PartSet_FeaturePrs.h"
11 #include "PartSet_Constants.h"
12
13 #include <gp_Pnt.hxx>
14
15 class GeomDataAPI_Point2D;
16 class Handle_V3d_View;
17
18 /*!
19  \class PartSet_FeatureArcPrs
20  * \brief The class to define the circle arc feature manipulation. It is created for
21  * the feature create operation to move out the feature properties set and use one operation
22  * for any type of features.
23 */
24 class PARTSET_EXPORT PartSet_FeatureArcPrs : public PartSet_FeaturePrs
25 {
26 public:
27   /// Returns the feature type processed by this presentation
28   /// \return the feature kind
29   static std::string getKind();
30
31   /// Constructor
32   /// \param theSketch the sketch feature
33   PartSet_FeatureArcPrs(FeaturePtr theSketch);
34   /// Destructor
35   virtual ~PartSet_FeatureArcPrs() {};
36
37   /// Sets the point to the feature in an attribute depending on the selection mode
38   /// \param theX the 2D point horizontal coordinate
39   /// \param theY the 2D point vertical coordinate
40   /// \param theMode the selection mode
41   /// \return the new selection mode
42   virtual PartSet_SelectionMode setPoint(double theX, double theY,
43                                          const PartSet_SelectionMode& theMode);
44
45   /// Returns the feature attribute name for the selection mode
46   /// \param theMode the current operation selection mode. The feature attribute depends on the mode
47   virtual std::string getAttribute(const PartSet_SelectionMode& theMode) const;
48
49   /// Returns the next selection mode after the attribute
50   /// \param theAttribute the feature attribute name
51   /// \return next attribute selection mode
52   virtual PartSet_SelectionMode getNextMode(const std::string& theAttribute) const;
53
54   /// Project the view point on the feature. The output coordinates belong to the feature
55   /// \param theFeature a feature
56   /// \param theSketch the sketch feature
57   /// \param thePoint a viewer point
58   /// \param theView the OCC view
59   /// \theX the output horizontal coordinate of a projected point
60   /// \theY the output vertical coordinate of a projected point
61   static void projectPointOnFeature(FeaturePtr theFeature, FeaturePtr theSketch, gp_Pnt& thePoint,
62                                     Handle_V3d_View theView, double& theX, double& theY);
63
64   /// Computes the feature's radius
65   /// \param theFeature an arc feature
66   /// \return the double value
67   static double radius(FeaturePtr theFeature);
68
69 protected:
70   /// Returns the feature point in the selection mode position.
71   /// \param theMode the current operation selection mode. The feature attribute depends on the mode
72   virtual boost::shared_ptr<GeomDataAPI_Point2D> featurePoint(const PartSet_SelectionMode& theMode);
73 };
74
75 #endif