Salome HOME
Issue #2024: Redesign of circle and arc of circle
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_Tools.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:        SketchPlugin_Tools.h
4 // Created:     07 July 2015
5 // Author:      Sergey POKHODENKO
6
7 #ifndef SKETCHPLUGIN_TOOLS_H_
8 #define SKETCHPLUGIN_TOOLS_H_
9
10 #include <GeomAPI_Pnt2d.h>
11
12 #include <ModelAPI_Feature.h>
13 #include <ModelAPI_Attribute.h>
14 #include <GeomDataAPI_Point2D.h>
15
16 class SketchPlugin_Feature;
17
18 namespace SketchPlugin_Tools {
19
20 /// Clears text expressions for all attributes of the feature
21 void clearExpressions(FeaturePtr theFeature);
22
23 /// \return coincidence point
24 /// \param[in] theStartCoin coincidence feature
25 std::shared_ptr<GeomAPI_Pnt2d> getCoincidencePoint(const FeaturePtr theStartCoin);
26
27 /// Find all Coincident constraints referred to the feature or its attribute
28 std::set<FeaturePtr> findCoincidentConstraints(const FeaturePtr& theFeature);
29
30 /// Finds lines coincident at point
31 /// \param[in] theStartCoin coincidence feature
32 /// \param[in] theAttr attribute name
33 /// \param[out] theList list of lines
34 void findCoincidences(const FeaturePtr theStartCoin,
35                       const std::string& theAttr,
36                       std::set<FeaturePtr>& theList);
37
38 /// Find all features the point is coincident to.
39 std::set<FeaturePtr> findFeaturesCoincidentToPoint(const AttributePoint2DPtr& thePoint);
40
41 void resetAttribute(SketchPlugin_Feature* theFeature, const std::string& theId);
42
43 /// Creates coincidence or tangent constraint.
44 /// \param[in] theFeature to get selected attribute or object
45 /// \param[in] theId ID of attribute where selection is.
46 /// \param[in] theObject object for constraint
47 /// \param[in] theIsCanBeTangent if true constraint can be tangent or coincidence, depending on
48 ///                              the selection in the attribute with passed ID.
49 void createConstraint(SketchPlugin_Feature* theFeature,
50                       const std::string& theId,
51                       const AttributePtr theAttr,
52                       const ObjectPtr theObject,
53                       const bool theIsCanBeTangent);
54 }; // namespace SketchPlugin_Tools
55
56 #endif // SKETCHPLUGIN_TOOLS_H_