Salome HOME
Task 2.12. New entities: ellipses and arcs of ellipses (issue #3003)
[modules/shaper.git] / src / SketchSolver / PlaneGCSSolver / PlaneGCSSolver_Solver.h
index 8d8322714c26b1916c12ebd95eb5a57b9d0b6368..4fb2abce9eafd65f615cecdbf8d6941eb84a0430 100644 (file)
@@ -1,8 +1,21 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
-// File:    PlaneGCSSolver_Solver.h
-// Created: 14 Dec 2014
-// Author:  Artem ZHIDKOV
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
 
 #ifndef PlaneGCSSolver_Solver_H_
 #define PlaneGCSSolver_Solver_H_
@@ -21,6 +34,7 @@ public:
     STATUS_OK,
     STATUS_INCONSISTENT,
     STATUS_EMPTYSET,
+    STATUS_DEGENERATED,
     STATUS_FAILED, // set if no one other status is applicable
     STATUS_UNKNOWN // set for newly created groups
   };
@@ -32,13 +46,19 @@ public:
   void clear();
 
   /// \brief Add constraint to the system of equations
-  void addConstraint(GCSConstraintPtr theConstraint);
+  /// \param[in] theMultiConstraintID  ID of the multi constraint which may consists of
+  ///                                  several primitive constraints
+  /// \param[in] theConstraints        list of primitive constraints
+  void addConstraint(const ConstraintID& theMultiConstraintID,
+                     const std::list<GCSConstraintPtr>& theConstraints);
 
-  /// \brief Remove constraint from the system of equations
-  void removeConstraint(ConstraintID theID);
+  /// \brief Remove constraints from the system of equations
+  void removeConstraint(const ConstraintID& theID);
 
   /// \brief Initialize memory for new solver's parameter
   double* createParameter();
+  /// \brief Add parameters created elsewhere
+  void addParameters(const GCS::SET_pD& theParams);
   /// \brief Release memory occupied by parameters
   void removeParameters(const GCS::SET_pD& theParams);
 
@@ -57,13 +77,13 @@ public:
   bool isConflicting(const ConstraintID& theConstraint) const;
 
   /// \brief Check conflicting/redundant constraints and DoF
-  void diagnose();
+  void diagnose(const GCS::Algorithm& theAlgo = GCS::DogLeg);
 
   /// \brief Degrees of freedom
   int dof();
 
 private:
-  void collectConflicting();
+  void collectConflicting(bool withRedundant = true);
 
   /// \brief Add fictive constraint if the sketch contains temporary constraints only
   void addFictiveConstraintIfNecessary();