Salome HOME
Second phase of SketchSolver refactoring
[modules/shaper.git] / src / SketchSolver / PlaneGCSSolver / PlaneGCSSolver_Solver.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:    PlaneGCSSolver_Solver.h
4 // Created: 14 Dec 2014
5 // Author:  Artem ZHIDKOV
6
7 #ifndef PlaneGCSSolver_Solver_H_
8 #define PlaneGCSSolver_Solver_H_
9
10 #include <SketchSolver_ISolver.h>
11 #include <PlaneGCSSolver_Defs.h>
12
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;
16 ////#else
17 ////#include <stdint.h>
18 ////#endif
19 ////#include <string.h>
20 #include <GCS.h>
21
22 ////#include <vector>
23
24 /**
25  * The main class that performs the high-level operations for connection to the PlaneGCS.
26  */
27 class PlaneGCSSolver_Solver : public SketchSolver_ISolver
28 {
29 public:
30   PlaneGCSSolver_Solver() {}
31   ~PlaneGCSSolver_Solver();
32
33   /// \brief Clear system of equations
34   void clear();
35
36   /// \brief Add constraint to the system of equations
37   void addConstraint(GCSConstraintPtr theConstraint);
38
39   /// \brief Remove constraint from the system of equations
40   void removeConstraint(GCSConstraintPtr theConstraint);
41
42   /// \brief Initialize list of unknowns
43   void setParameters(const GCS::VEC_pD& theParams)
44   { myParameters = theParams; }
45
46   /** \brief Solve the set of equations
47    *  \return identifier whether solution succeeded
48    */
49   virtual SketchSolver_SolveStatus solve();
50
51 private:
52   GCS::VEC_pD                myParameters;     ///< list of unknowns
53   std::set<GCS::Constraint*> myConstraints;    ///< list of constraints already processed by the system
54   GCS::System                myEquationSystem; ///< set of equations for solving in FreeGCS
55 };
56
57 #endif