SHAPER  9.15.0
SketcherPrs_Tools.h
1 // Copyright (C) 2014-2025 CEA, EDF
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 
20 #ifndef SketcherPrs_Tools_H
21 #define SketcherPrs_Tools_H
22 
23 #include "SketcherPrs.h"
24 #include <GeomAPI_Shape.h>
25 #include <GeomAPI_Pnt2d.h>
26 #include <GeomAPI_Ax3.h>
27 #include <ModelAPI_Object.h>
28 #include <ModelAPI_Attribute.h>
29 #include <ModelAPI_Feature.h>
30 #include <ModelAPI_CompositeFeature.h>
31 #include <ModelAPI_Result.h>
32 #include <string>
33 
34 #include <Events_Loop.h>
35 #include <Events_Message.h>
36 
38 
39 namespace SketcherPrs_Tools {
40 
42  enum ParameterStyle {
43  ParameterValue,
44  ParameterText
45  };
46 
49  SKETCHERPRS_EXPORT void setParameterStyle(ParameterStyle theStyle);
50 
52  SKETCHERPRS_EXPORT ParameterStyle parameterStyle();
53 
55  enum SelectionModes {
57  Sel_Mode_First = 100,
58 
60  Sel_Constraint,
61 
63  Sel_Dimension_All,
64 
66  Sel_Dimension_Line,
67 
69  Sel_Dimension_Text,
70 
72  Sel_Sketch_Face,
73 
75  Sel_Sketch_Wire
76  };
77 
79  enum AngleType{
80  ANGLE_DIRECT,
81  ANGLE_COMPLEMENTARY,
82  ANGLE_BACKWARD
83  };
84 
86  enum LocationType{
87  LOCATION_RIGHT,
88  LOCATION_AUTOMATIC,
89  LOCATION_LEFT
90  };
91 
94 
98  SKETCHERPRS_EXPORT AttributePtr getAttribute(ModelAPI_Feature* theFeature,
99  const std::string& theAttrName);
100 
104  SKETCHERPRS_EXPORT ObjectPtr getResult(ModelAPI_Feature* theFeature,
105  const std::string& theAttrName);
106 
109  SKETCHERPRS_EXPORT std::shared_ptr<GeomAPI_Shape> getShape(ObjectPtr theObject);
110 
111 
115  SKETCHERPRS_EXPORT std::shared_ptr<GeomAPI_Pnt2d> getPoint(ModelAPI_Feature* theFeature,
116  const std::string& theAttrName);
117 
118 
122  SKETCHERPRS_EXPORT std::shared_ptr<GeomAPI_Pnt2d> getProjectionPoint(
123  const FeaturePtr theLine,
124  const std::shared_ptr<GeomAPI_Pnt2d>& thePoint);
125 
126  SKETCHERPRS_EXPORT FeaturePtr getFeatureLine(DataPtr theData,
127  const std::string& theAttribute);
128 
133  SKETCHERPRS_EXPORT std::shared_ptr<GeomDataAPI_Point2D> getFeaturePoint(DataPtr theData,
134  const std::string& theAttribute,
135  const std::shared_ptr<GeomAPI_Ax3>& thePlane);
136 
140  SKETCHERPRS_EXPORT std::list<ResultPtr> getFreePoints(const CompositeFeaturePtr& theSketch);
141 
143  SKETCHERPRS_EXPORT double getArrowSize();
144 
147  SKETCHERPRS_EXPORT void setArrowSize(double theSize);
148 
150  SKETCHERPRS_EXPORT int getDefaultArrowSize();
151 
153  SKETCHERPRS_EXPORT int getConfigArrowSize();
154 
157  SKETCHERPRS_EXPORT void setTextHeight(double theHeight);
158 
160  SKETCHERPRS_EXPORT double getTextHeight();
161 
163  SKETCHERPRS_EXPORT double getDefaultTextHeight();
164 
166  SKETCHERPRS_EXPORT double getConfigTextHeight();
167 
170  SKETCHERPRS_EXPORT double getFlyoutDistance(const ModelAPI_Feature* theConstraint);
171 
173  SKETCHERPRS_EXPORT std::shared_ptr<GeomAPI_Pnt> getAnchorPoint(
174  const ModelAPI_Feature* theConstraint,
175  const std::shared_ptr<GeomAPI_Ax3>& thePlane);
176 
180  SKETCHERPRS_EXPORT void sendEmptyPresentationError(ModelAPI_Feature* theFeature,
181  const std::string theError);
182 
183  SKETCHERPRS_EXPORT void setPixelRatio(const double theRatio);
184 
185  SKETCHERPRS_EXPORT double pixelRatio();
186 };
187 
188 #endif
Attribute that contains 2D point coordinates.
Definition: GeomDataAPI_Point2D.h:37
Feature function that represents the particular functionality of this operation.
Definition: ModelAPI_Feature.h:41