]> SALOME platform Git repositories - modules/shaper.git/blob - src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Tools.h
Salome HOME
Simplify sketcher model. Remove obsolete files and classes.
[modules/shaper.git] / src / SketchSolver / PlaneGCSSolver / PlaneGCSSolver_Tools.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:    PlaneGCSSolver_Tools.h
4 // Created: 01 Mar 2017
5 // Author:  Artem ZHIDKOV
6
7 #ifndef PlaneGCSSolver_Tools_H_
8 #define PlaneGCSSolver_Tools_H_
9
10 #include <SketchSolver_Constraint.h>
11 #include <SketchPlugin_Constraint.h>
12
13 #include <GeomAPI_Lin2d.h>
14 #include <GeomAPI_Pnt2d.h>
15
16 /** \namespace  PlaneGCSSolver_Tools
17  *  \ingroup    Plugins
18  *  \brief      Converter tools
19  */
20 namespace PlaneGCSSolver_Tools
21 {
22   /// \brief Creates a solver's constraint using given SketchPlugin constraint
23   ///        or returns empty pointer if not all attributes are correct
24   SolverConstraintPtr createConstraint(ConstraintPtr theConstraint);
25
26   /// \brief Creates temporary constraint to fix the feature after movement
27   SolverConstraintPtr createMovementConstraint(FeaturePtr theMovedFeature);
28
29   /// \brief Creates new constraint using given parameters
30   /// \param theConstraint [in]  original constraint
31   /// \param theType       [in]  type of constraint
32   /// \param theValue      [in]  numeric characteristic of constraint
33   ///                            (e.g. distance or radius) if applicable
34   /// \param theEntity1    [in]  first attribute of constraint
35   /// \param theEntity2    [in]  second attribute of constraint
36   /// \param theEntity3    [in]  third attribute of constraint
37   /// \param theEntity4    [in]  fourth attribute of constraint
38   /// \return Created wrapper of constraints applicable for specific solver.
39   ConstraintWrapperPtr createConstraint(ConstraintPtr theConstraint,
40                                         const SketchSolver_ConstraintType& theType,
41                                         const EntityWrapperPtr& theValue,
42                                         const EntityWrapperPtr& theEntity1,
43                                         const EntityWrapperPtr& theEntity2 = EntityWrapperPtr(),
44                                         const EntityWrapperPtr& theEntity3 = EntityWrapperPtr(),
45                                         const EntityWrapperPtr& theEntity4 = EntityWrapperPtr());
46
47   /// \brief Convert entity to point
48   /// \return empty pointer if the entity is not a point
49   std::shared_ptr<GeomAPI_Pnt2d> point(EntityWrapperPtr theEntity);
50   /// \brief Convert entity to line
51   /// \return empty pointer if the entity is not a line
52   std::shared_ptr<GeomAPI_Lin2d> line(EntityWrapperPtr theEntity);
53
54   /// \brief Convert entity to line
55   /// \return empty pointer if the entity is not a line
56   std::shared_ptr<GeomAPI_Lin2d> line(FeaturePtr theFeature);
57
58   /// \brief Check if two connected arcs have centers
59   ///        in same direction relatively to connection point
60   bool isArcArcTangencyInternal(EntityWrapperPtr theArc1,
61                                 EntityWrapperPtr theArc2);
62 };
63
64 #endif