1 // File: SketchSolver_Solver.h
2 // Created: 07 May 2014
3 // Author: Artem ZHIDKOV
5 #ifndef SketchSolver_Solver_Headerfile
6 #define SketchSolver_Solver_Headerfile
8 #include "SketchSolver.h"
10 // Need to be defined before including SolveSpace to avoid additional dependances on Windows platform
11 #if defined(WIN32) && !defined(HAVE_C99_INTEGER_TYPES)
12 typedef unsigned int UINT32;
22 #define SLVS_RESULT_EMPTY_SET -1
24 // Unknown constraint (for error reporting)
25 #define SLVS_C_UNKNOWN 0
27 #define SLVS_E_UNKNOWN 0
30 class SketchSolver_Solver
33 SketchSolver_Solver();
34 ~SketchSolver_Solver();
36 /** \brief Initialize the ID of the group
38 inline void setGroupID(Slvs_hGroup theGroupID)
39 { myGroupID = theGroupID; }
41 /** \brief Change array of parameters
42 * \param[in] theParameters vector of parameters
44 void setParameters(const std::vector<Slvs_Param>& theParameters);
46 /** \brief Change array of entities
47 * \param[in] theEntities vector of entities
49 void setEntities(const std::vector<Slvs_Entity>& theEntities);
51 /** \brief Change array of constraints
52 * \param[in] theConstraints vector of constraints
54 void setConstraints(const std::vector<Slvs_Constraint>& theConstraints);
56 /** \brief Solve the set of equations
57 * \return identifier whether solution succeeded
61 /** \brief Updates the list of parameters by calculated values
62 * \param[in,out] theParameters parameters to be updated
63 * \return \c true if parameters are updated correctly
65 bool getResult(std::vector<Slvs_Param>& theParameters);
68 Slvs_hGroup myGroupID; ///< identifier of the group to be solved
69 Slvs_System myEquationsSystem; ///< set of equations for solving in SolveSpace