1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: PlaneGCSSolver_Solver.h
4 // Created: 14 Dec 2014
5 // Author: Artem ZHIDKOV
7 #ifndef PlaneGCSSolver_Solver_H_
8 #define PlaneGCSSolver_Solver_H_
10 #include <SketchSolver_ISolver.h>
11 #include <PlaneGCSSolver_Defs.h>
13 ////// Need to be defined before including SolveSpace to avoid additional dependences on Windows platform
14 ////#if defined(WIN32) && !defined(HAVE_C99_INTEGER_TYPES)
15 ////typedef unsigned int UINT32;
17 ////#include <stdint.h>
19 ////#include <string.h>
25 * The main class that performs the high-level operations for connection to the PlaneGCS.
27 class PlaneGCSSolver_Solver : public SketchSolver_ISolver
30 PlaneGCSSolver_Solver() {}
31 ~PlaneGCSSolver_Solver();
33 /// \brief Clear system of equations
36 /// \brief Add constraint to the system of equations
37 void addConstraint(GCSConstraintPtr theConstraint);
39 /// \brief Remove constraint from the system of equations
40 void removeConstraint(GCSConstraintPtr theConstraint);
42 /// \brief Initialize list of unknowns
43 void setParameters(const GCS::VEC_pD& theParams)
44 { myParameters = theParams; }
46 /** \brief Solve the set of equations
47 * \return identifier whether solution succeeded
49 virtual SketchSolver_SolveStatus solve();
51 /// \brief Prepare for solving. Store initial values of parameters for undo
52 virtual void prepare()
55 /// \brief Revert solution to initial values
59 GCS::VEC_pD myParameters; ///< list of unknowns
60 std::set<GCS::Constraint*> myConstraints; ///< list of constraints already processed by the system
61 GCS::System myEquationSystem; ///< set of equations for solving in FreeGCS