1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: SolveSpaceSolver_Solver.h
4 // Created: 07 May 2014
5 // Author: Artem ZHIDKOV
7 #ifndef SolveSpaceSolver_Solver_H_
8 #define SolveSpaceSolver_Solver_H_
10 #include <SketchSolver_ISolver.h>
12 // Need to be defined before including SolveSpace to avoid additional dependences on Windows platform
13 #if defined(WIN32) && !defined(HAVE_C99_INTEGER_TYPES)
14 typedef unsigned int UINT32;
23 // Unknown constraint (for error reporting)
24 #define SLVS_C_UNKNOWN 0
25 // Fillet constraint identifier
26 #define SLVS_C_FILLET 100100
27 // Multi-rotation constraint identifier
28 #define SLVS_C_MULTI_ROTATION 100101
29 // Multi-translation constraint identifier
30 #define SLVS_C_MULTI_TRANSLATION 100102
32 #define SLVS_E_UNKNOWN 0
34 #define SLVS_G_UNKNOWN 0
35 // Group ID to store external objects
36 #define SLVS_G_OUTOFGROUP 1
38 /** \class SolveSpaceSolver_Solver
40 * \brief Performs high-level operations to solve sketch in SolveSpace.
42 class SolveSpaceSolver_Solver : public SketchSolver_ISolver
45 SolveSpaceSolver_Solver();
46 virtual ~SolveSpaceSolver_Solver();
48 /** \brief Change array of parameters
49 * \param[in] theParameters pointer to the array of parameters
50 * \param[in] theSize size of this array
52 void setParameters(Slvs_Param* theParameters, int theSize);
54 /** \brief Change array of entities
55 * \param[in] theEntities pointer to the array of entities
56 * \param[in] theSize size of this array
58 void setEntities(Slvs_Entity* theEntities, int theSize);
60 /** \brief Change array of constraints
61 * \param[in] theConstraints pointer to the array of constraints
62 * \param[in] theSize size of this array
64 void setConstraints(Slvs_Constraint* theConstraints, int theSize);
66 /** \brief Store the parameters of the point which was moved by user.
67 * The solver will watch this items to be constant
68 * \param[in] theDragged list of parameters (not more than 4) which should not be changed during solving
70 void setDraggedParameters(const Slvs_hParam* theDragged);
72 /** \brief Solve the set of equations
73 * \return identifier whether solution succeeded
75 virtual SketchSolver_SolveStatus solve();
78 Slvs_System myEquationsSystem; ///< set of equations for solving in SolveSpace