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 void resetAttribute(SketchPlugin_Feature* theFeature, const std::string& theId);
36 /// Creates coincidence or tangent constraint.
37 /// \param[in] theFeature to get selected attribute or object
38 /// \param[in] theId ID of attribute where selection is.
39 /// \param[in] theObject object for constraint
40 /// \param[in] theIsCanBeTangent if true constraint can be tangent or coincidence, depending on
41 /// the selection in the attribute with passed ID.
42 void createConstraint(SketchPlugin_Feature* theFeature,
43 const std::string& theId,
44 const AttributePtr theAttr,
45 const ObjectPtr theObject,
46 const bool theIsCanBeTangent);
47 }; // namespace SketchPlugin_Tools
49 #endif // SKETCHPLUGIN_TOOLS_H_