1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 // File: SketchPlugin_Tools.h
4 // Created: 07 July 2015
5 // Author: Sergey POKHODENKO
7 #ifndef SKETCHPLUGIN_TOOLS_H_
8 #define SKETCHPLUGIN_TOOLS_H_
10 #include <GeomAPI_Pnt2d.h>
12 #include <ModelAPI_Feature.h>
13 #include <ModelAPI_Attribute.h>
15 class SketchPlugin_Feature;
17 namespace SketchPlugin_Tools {
19 /// Clears text expressions for all attributes of the feature
20 void clearExpressions(FeaturePtr theFeature);
22 /// \return coincidence point
23 /// \param[in] theStartCoin coincidence feature
24 std::shared_ptr<GeomAPI_Pnt2d> getCoincidencePoint(const FeaturePtr theStartCoin);
26 /// Finds lines coincident at point
27 /// \param[in] theStartCoin coincidence feature
28 /// \param[in] theAttr attribute name
29 /// \param[out] theList list of lines
30 void findCoincidences(const FeaturePtr theStartCoin,
31 const std::string& theAttr,
32 std::set<FeaturePtr>& theList);
34 /// Creates coincidence or tangent constraint.
35 /// \param[in] theFeature to get selected attribute or object
36 /// \param[in] theId ID of attribute where selection is.
37 /// \param[in] theObject object for constraint
38 /// \param[in] theIsCanBeTangent if true constraint can be tangent or coincidence, depending on
39 /// the selection in the attribute with passed ID.
40 void createConstraint(SketchPlugin_Feature* theFeature,
41 const std::string& theId,
42 const AttributePtr theAttr,
43 const ObjectPtr theObject,
44 const bool theIsCanBeTangent);
45 }; // namespace SketchPlugin_Tools
47 #endif // SKETCHPLUGIN_TOOLS_H_