Salome HOME
Issue #698 - Distance constraint on circle - crash
[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 <GeomAPI_Ax3.h>
14 #include <ModelAPI_Object.h>
15 #include <ModelAPI_Feature.h>
16 #include <string>
17
18 class GeomDataAPI_Point2D;
19
20 //#define MyTextHeight 20
21
22 namespace SketcherPrs_Tools {
23
24 /// Enumeration with modes for activation of selection custom presentations
25 enum SelectionModes {
26   /// Start of enumeration
27   Sel_Mode_First = 100, 
28   
29   /// Selection mode for all constraints exclude dimensions
30   Sel_Constraint,
31   
32   /// Selection mode for whole dimension
33   Sel_Dimension_All,
34   
35   /// Selection mode for line of dimension
36   Sel_Dimension_Line,
37
38   /// Selection mode foe text of dimension
39   Sel_Dimension_Text
40 };
41
42   SKETCHERPRS_EXPORT ObjectPtr getResult(ModelAPI_Feature* theFeature,
43                                          const std::string& theAttrName);
44
45   SKETCHERPRS_EXPORT std::shared_ptr<GeomAPI_Shape> getShape(ObjectPtr theObject);
46
47   SKETCHERPRS_EXPORT std::shared_ptr<GeomAPI_Pnt2d> getPoint(ModelAPI_Feature* theFeature,
48                                           const std::string& theAttrName);
49
50   SKETCHERPRS_EXPORT std::shared_ptr<GeomAPI_Pnt2d> getProjectionPoint(
51                         const FeaturePtr theLine,
52                         const std::shared_ptr<GeomAPI_Pnt2d>& thePoint);
53
54   SKETCHERPRS_EXPORT FeaturePtr getFeatureLine(DataPtr theData,
55                                                const std::string& theAttribute);
56
57   /// Obtain the point object from specified constraint parameter
58   SKETCHERPRS_EXPORT std::shared_ptr<GeomDataAPI_Point2D> getFeaturePoint(DataPtr theData,
59                                                        const std::string& theAttribute,
60                                                        const std::shared_ptr<GeomAPI_Ax3>& thePlane);
61
62   SKETCHERPRS_EXPORT double getArrowSize();
63
64   SKETCHERPRS_EXPORT void setArrowSize(double theSize);
65
66   SKETCHERPRS_EXPORT void setTextHeight(double theHeight);
67
68   SKETCHERPRS_EXPORT double getTextHeight();
69
70   SKETCHERPRS_EXPORT double getDefaultTextHeight();
71
72   SKETCHERPRS_EXPORT double getFlyoutDistance(const ModelAPI_Feature* theConstraint);
73
74   SKETCHERPRS_EXPORT std::shared_ptr<GeomAPI_Pnt> getAnchorPoint(
75                                               const ModelAPI_Feature* theConstraint,
76                                               const std::shared_ptr<GeomAPI_Ax3>& thePlane);
77 };
78
79 #endif