Salome HOME
Merge Dev_2.1.0 with PythonAPI branch
[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
15 namespace SketchPlugin_Tools {
16
17 /// Clears text expressions for all attributes of the feature 
18 void clearExpressions(FeaturePtr theFeature);
19
20 /// \return coincidence point
21 /// \param[in] theStartCoin coincidence feature
22 std::shared_ptr<GeomAPI_Pnt2d> getCoincidencePoint(const FeaturePtr theStartCoin);
23
24 /// Finds lines coincident at point
25 /// \param[in] theStartCoin coincidence feature
26 /// \param[in] theAttr attribute name
27 /// \param[out] theList list of lines
28 void findCoincidences(const FeaturePtr theStartCoin,
29                       const std::string& theAttr,
30                       std::set<FeaturePtr>& theList);
31
32 /// Changes the second attribute value to be multiplied or divided by the given value.
33 /// \param theFirstAngleAttribute the source attribute
34 /// \param theSecondAngleAttribute the changed attribute
35 /// \param theValue a value for modification
36 /// \param toMultiply a type of modification
37 void updateMultiAttribute(const AttributePtr& theFirstAngleAttribute,
38                           const AttributePtr& theSecondAngleAttribute,
39                           const int& theValue,
40                           const bool toMultiply);
41
42 /// Changes the second attribute value to be multiplied or divided by the given value.
43 /// \param theFirstAngleAttribute the source attribute
44 /// \param theSecondAngleAttribute the changed attribute
45 /// \param theValue a value for modification
46 /// \param toMultiply a type of modification
47 void updateMultiAttribute(const AttributePtr& theFirstAttribute,
48                           const AttributePtr& theSecondAttribute,
49                           const AttributePtr& theModifiedAttribute,
50                           const int& theValue,
51                           const bool toMultiply);
52
53 }; // namespace SketchPlugin_Tools
54
55 #endif // SKETCHPLUGIN_TOOLS_H_