1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: PlaneGCSSolver_Tools.h
4 // Created: 01 Mar 2017
5 // Author: Artem ZHIDKOV
7 #ifndef PlaneGCSSolver_Tools_H_
8 #define PlaneGCSSolver_Tools_H_
10 #include <SketchSolver_Constraint.h>
11 #include <SketchPlugin_Constraint.h>
13 #include <GeomAPI_Lin2d.h>
14 #include <GeomAPI_Pnt2d.h>
16 /** \namespace PlaneGCSSolver_Tools
18 * \brief Converter tools
20 namespace PlaneGCSSolver_Tools
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);
26 /// \brief Creates temporary constraint to fix the feature after movement
27 SolverConstraintPtr createMovementConstraint(FeaturePtr theMovedFeature);
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());
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);
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);