1 // File: PartSet_ConstraintRadiusPrs.h
2 // Created: 16 Jun 2014
3 // Author: Natalia ERMOLAEVA
5 #ifndef PartSet_ConstraintRadiusPrs_H
6 #define PartSet_ConstraintRadiusPrs_H
10 #include "PartSet_FeaturePrs.h"
11 #include "PartSet_Constants.h"
15 class GeomDataAPI_Point2D;
16 class Handle_AIS_InteractiveObject;
17 class Handle_V3d_View;
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.
25 class PARTSET_EXPORT PartSet_ConstraintRadiusPrs : public PartSet_FeaturePrs
28 /// Returns the feature type processed by this presentation
29 /// \return the feature kind
30 static std::string getKind();
33 /// \param theSketch the sketch feature
34 PartSet_ConstraintRadiusPrs(FeaturePtr theSketch);
36 virtual ~PartSet_ConstraintRadiusPrs() {};
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);
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);
52 /// Creates an AIS presentation if the previous is null or update the given one
53 /// \param theFeature a feature
54 /// \param theSketch a feature sketch
55 /// \param thePrevious a previuos AIS presentation
56 /// \return a created/changed AIS object with the feature parameters
57 static Handle_AIS_InteractiveObject createPresentation(FeaturePtr theFeature,
59 Handle_AIS_InteractiveObject thePreviuos);
61 /// Returns the feature attribute name for the selection mode
62 /// \param theMode the current operation selection mode. The feature attribute depends on the mode
63 virtual std::string getAttribute(const PartSet_SelectionMode& theMode) const;
65 /// Returns the next selection mode after the attribute
66 /// \param theAttribute the feature attribute name
67 /// \return next attribute selection mode
68 virtual PartSet_SelectionMode getNextMode(const std::string& theAttribute) const;
70 /// Find a point in the line with given coordinates
71 /// \param theFeature the line feature
72 /// \param theX the horizontal point coordinate
73 /// \param theY the vertical point coordinate
74 virtual boost::shared_ptr<GeomDataAPI_Point2D> findPoint(FeaturePtr theFeature, double theX,
76 /// Project the view point on the feature. The output coordinates belong to the feature
77 /// \param theFeature a feature
78 /// \param theSketch the sketch feature
79 /// \param thePoint a viewer point
80 /// \param theView the OCC view
81 /// \theX the output horizontal coordinate of a projected point
82 /// \theY the output vertical coordinate of a projected point
83 static void projectPointOnFeature(FeaturePtr theFeature, FeaturePtr theSketch, gp_Pnt& thePoint,
84 Handle_V3d_View theView, double& theX, double& theY);
87 /// Returns the feature point in the selection mode position.
88 /// \param theMode the current operation selection mode. The feature attribute depends on the mode
89 virtual boost::shared_ptr<GeomDataAPI_Point2D> featurePoint(const PartSet_SelectionMode& theMode);