Salome HOME
00a2e96630948e82c01f8d29523879ae78e0f760
[modules/shaper.git] / src / SketcherPrs / SketcherPrs_Tools.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        SketcherPrs_Tools.h
4 // Created:     10 March 2015
5 // Author:      Vitaly SMETANNIKOV
6
7 #ifndef SketcherPrs_Tools_H
8 #define SketcherPrs_Tools_H
9
10 #include "SketcherPrs.h"
11 #include <GeomAPI_Shape.h>
12 #include <GeomAPI_Pnt2d.h>
13 #include <ModelAPI_Object.h>
14 #include <ModelAPI_Feature.h>
15 #include <string>
16
17 class GeomDataAPI_Point2D;
18
19 #define MyTextHeight 20
20
21 namespace SketcherPrs_Tools {
22
23 /// Enumeration with modes for activation of selection custom presentations
24 enum SelectionModes {
25   /// Start of enumeration
26   Sel_Mode_First = 100, 
27   
28   /// Selection mode for all constraints exclude dimensions
29   Sel_Constraint,
30   
31   /// Selection mode for whole dimension
32   Sel_Dimension_All,
33   
34   /// Selection mode for line of dimension
35   Sel_Dimension_Line,
36
37   /// Selection mode foe text of dimension
38   Sel_Dimension_Text
39 };
40
41   SKETCHERPRS_EXPORT ObjectPtr getResult(ModelAPI_Feature* theFeature,
42                                          const std::string& theAttrName);
43
44   SKETCHERPRS_EXPORT std::shared_ptr<GeomAPI_Shape> getShape(ObjectPtr theObject);
45
46   SKETCHERPRS_EXPORT std::shared_ptr<GeomAPI_Pnt2d> getPoint(ModelAPI_Feature* theFeature,
47                                           const std::string& theAttrName);
48
49   SKETCHERPRS_EXPORT std::shared_ptr<GeomAPI_Pnt2d> getProjectionPoint(
50                         const FeaturePtr theLine,
51                         const std::shared_ptr<GeomAPI_Pnt2d>& thePoint);
52
53   SKETCHERPRS_EXPORT FeaturePtr getFeatureLine(DataPtr theData,
54                                                const std::string& theAttribute);
55
56   /// Obtain the point object from specified constraint parameter
57   SKETCHERPRS_EXPORT std::shared_ptr<GeomDataAPI_Point2D> getFeaturePoint(DataPtr theData,
58                                                        const std::string& theAttribute);
59
60   SKETCHERPRS_EXPORT double getArrowSize();
61
62   SKETCHERPRS_EXPORT void setArrowSize(double theSize);
63 };
64
65 #endif