]> SALOME platform Git repositories - modules/shaper.git/blob - src/PartSet/PartSet_ConstraintRadiusPrs.h
Salome HOME
Move generation of AIS presentation into SketchPlugin
[modules/shaper.git] / src / PartSet / PartSet_ConstraintRadiusPrs.h
1 // File:        PartSet_ConstraintRadiusPrs.h
2 // Created:     16 Jun 2014
3 // Author:      Natalia ERMOLAEVA
4
5 #ifndef PartSet_ConstraintRadiusPrs_H
6 #define PartSet_ConstraintRadiusPrs_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_AIS_InteractiveObject;
17 class Handle_V3d_View;
18
19 /*!
20  \class PartSet_ConstraintRadiusPrs
21  * \brief The class to define the circle feature manipulation. It is created for
22  * the feature create operation to move out the feature properties set and use one operation
23  * for any type of features.
24 */
25 class PARTSET_EXPORT PartSet_ConstraintRadiusPrs : public PartSet_FeaturePrs
26 {
27 public:
28   /// Returns the feature type processed by this presentation
29   /// \return the feature kind
30   static std::string getKind();
31
32   /// Constructor
33   /// \param theSketch the sketch feature
34   PartSet_ConstraintRadiusPrs(FeaturePtr theSketch);
35   /// Destructor
36   virtual ~PartSet_ConstraintRadiusPrs() {};
37
38   /// Sets the feature to to a feature attribute depending on the selection mode
39   /// \param theFeature a feature instance
40   /// \param theMode the selection mode
41   /// \return whether the feature is set
42   virtual PartSet_SelectionMode setFeature(FeaturePtr theFeature, const PartSet_SelectionMode& theMode);
43
44   /// Sets the point to the feature in an attribute depending on the selection mode
45   /// \param theX the 2D point horizontal coordinate
46   /// \param theY the 2D point vertical coordinate
47   /// \param theMode the selection mode
48   /// \return the new selection mode
49   virtual PartSet_SelectionMode setPoint(double theX, double theY,
50                                          const PartSet_SelectionMode& theMode);
51
52   /// Returns the feature attribute name for the selection mode
53   /// \param theMode the current operation selection mode. The feature attribute depends on the mode
54   virtual std::string getAttribute(const PartSet_SelectionMode& theMode) const;
55
56   /// Returns the next selection mode after the attribute
57   /// \param theAttribute the feature attribute name
58   /// \return next attribute selection mode
59   virtual PartSet_SelectionMode getNextMode(const std::string& theAttribute) const;
60
61   /// Find a point in the line with given coordinates
62   /// \param theFeature the line feature
63   /// \param theX the horizontal point coordinate
64   /// \param theY the vertical point coordinate
65   virtual boost::shared_ptr<GeomDataAPI_Point2D> findPoint(FeaturePtr theFeature, double theX,
66                                                            double theY);
67   /// Project the view point on the feature. The output coordinates belong to the feature
68   /// \param theFeature a feature
69   /// \param theSketch the sketch feature
70   /// \param thePoint a viewer point
71   /// \param theView the OCC view
72   /// \theX the output horizontal coordinate of a projected point
73   /// \theY the output vertical coordinate of a projected point
74   static void projectPointOnFeature(FeaturePtr theFeature, FeaturePtr theSketch, gp_Pnt& thePoint,
75                                     Handle_V3d_View theView, double& theX, double& theY);
76
77 protected:
78   /// Returns the feature point in the selection mode position.
79   /// \param theMode the current operation selection mode. The feature attribute depends on the mode
80   virtual boost::shared_ptr<GeomDataAPI_Point2D> featurePoint(const PartSet_SelectionMode& theMode);
81 };
82
83 #endif