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>
14 #include <GeomDataAPI_Point2D.h>
16 class SketchPlugin_Feature;
18 namespace SketchPlugin_Tools {
20 /// Clears text expressions for all attributes of the feature
21 void clearExpressions(FeaturePtr theFeature);
23 /// \return coincidence point
24 /// \param[in] theStartCoin coincidence feature
25 std::shared_ptr<GeomAPI_Pnt2d> getCoincidencePoint(const FeaturePtr theStartCoin);
27 /// Find all Coincident constraints referred to the feature or its attribute
28 std::set<FeaturePtr> findCoincidentConstraints(const FeaturePtr& theFeature);
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);
38 /// Find all features the point is coincident to.
39 std::set<FeaturePtr> findFeaturesCoincidentToPoint(const AttributePoint2DPtr& thePoint);
41 void resetAttribute(SketchPlugin_Feature* theFeature, const std::string& theId);
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
56 #endif // SKETCHPLUGIN_TOOLS_H_