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>
16 * The main class that performs the high-level operations for connection to the PlaneGCS.
18 class PlaneGCSSolver_Solver : public SketchSolver_ISolver
21 PlaneGCSSolver_Solver() {}
22 ~PlaneGCSSolver_Solver();
24 /// \brief Clear system of equations
27 /// \brief Add constraint to the system of equations
28 void addConstraint(GCSConstraintPtr theConstraint);
30 /// \brief Remove constraint from the system of equations
31 void removeConstraint(GCSConstraintPtr theConstraint);
33 /// \brief Initialize list of unknowns
34 void setParameters(const GCS::VEC_pD& theParams)
35 { myParameters = theParams; }
37 /** \brief Solve the set of equations
38 * \return identifier whether solution succeeded
40 virtual SketchSolver_SolveStatus solve();
42 /// \brief Prepare for solving. Store initial values of parameters for undo
43 virtual void prepare()
46 /// \brief Revert solution to initial values
50 GCS::VEC_pD myParameters; ///< list of unknowns
51 std::set<GCS::Constraint*> myConstraints; ///< list of constraints already processed by the system
52 GCS::System myEquationSystem; ///< set of equations for solving in FreeGCS