]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix compilation errors in solvers.
authorazv <azv@opencascade.com>
Tue, 22 Dec 2015 13:39:29 +0000 (16:39 +0300)
committerazv <azv@opencascade.com>
Tue, 22 Dec 2015 13:39:29 +0000 (16:39 +0300)
Make SolveSpace solver default.

src/Config/plugins.xml
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Builder.cpp
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Builder.h
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Solver.cpp
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Solver.h
src/SketchSolver/SketchSolver_Builder.h
src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_Builder.cpp
src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_Builder.h

index 9b0e0cf5fec33838f6d323452f434708b8b4f9fa..77422df32a05c015f4b32078b0df1e316665ec86 100644 (file)
@@ -11,8 +11,8 @@
   <plugin script="addons_Features" configuration="addons_Features.xml"/>
   <plugin script="ConnectorPlugin" configuration="plugin-Connector.xml" dependency="Geometry"/>
   <plugin library="ParametersPlugin" configuration="plugin-Parameters.xml"/>
-<!--  <plugin library="SolveSpaceSolver"/> -->
-  <plugin library="PlaneGCSSolver"/>
+  <plugin library="SolveSpaceSolver"/>
+<!--  <plugin library="PlaneGCSSolver"/> -->
   <plugin library="GeomValidators"/>
   <plugin library="DFBrowser" internal="true"/>
 </plugins>
index f74db8d2ed1b9cb17c5513938171aab02bcd6cbc..135eebd94a796711ce066fd9986be419ce6cbaa2 100644 (file)
@@ -263,6 +263,7 @@ std::list<ConstraintWrapperPtr> PlaneGCSSolver_Builder::createConstraint(
     const EntityID& theSketchID,
     const SketchSolver_ConstraintType& theType,
     const double& theValue,
+    const bool theFullValue,
     const EntityWrapperPtr& thePoint1,
     const EntityWrapperPtr& thePoint2,
     const std::list<EntityWrapperPtr>& theTrsfEnt) const
@@ -284,6 +285,7 @@ std::list<ConstraintWrapperPtr> PlaneGCSSolver_Builder::createConstraint(
   aResult->setEntities(aConstrAttrList);
   if (anAngleParam)
     aResult->setValueParameter(anAngleParam);
+  aResult->setIsFullValue(theFullValue);
   return std::list<ConstraintWrapperPtr>(1, aResult);
 }
 
index ef511e3ea57e901027b019e5019f3c70858ef208..fe959858b80e997ac067854be4613f65f058c777 100644 (file)
@@ -65,6 +65,7 @@ public:
   /// \param theSketchID   [in]  sketch the constraint belongs to
   /// \param theType       [in]  type of constraint
   /// \param theValue      [in]  numeric characteristic of constraint (angle for multi-rotation) if applicable
+  /// \param theFullValue  [in]  indicates theValue shows full translation delta/rotation angle or delta/angle between neighbor entities
   /// \param thePoint1     [in]  center for multi-rotation or start point for multi-translation
   /// \param thePoint2     [in]  end point for multi-translation (empty for multi-rotation)
   /// \param theTrsfEnt    [in]  list of transformed entities
@@ -74,6 +75,7 @@ public:
                      const EntityID& theSketchID,
                      const SketchSolver_ConstraintType& theType,
                      const double& theValue,
+                     const bool theFullValue,
                      const EntityWrapperPtr& thePoint1,
                      const EntityWrapperPtr& thePoint2,
                      const std::list<EntityWrapperPtr>& theTrsfEnt) const;
index 71f6d87b339cdec01b1cdbfd2fbb0724a067a7e4..2d95d783d7aff23895f28100361290d2bf3ceb93 100644 (file)
@@ -59,9 +59,13 @@ SketchSolver_SolveStatus PlaneGCSSolver_Solver::solve()
   if (aResult == GCS::Success) {
     myEquationSystem.applySolution();
     aStatus = STATUS_OK;
-  } else {
-    myEquationSystem.undoSolution();
+  } else
     aStatus = STATUS_FAILED;
-  }
+
   return aStatus;
 }
+
+void PlaneGCSSolver_Solver::undo()
+{
+  myEquationSystem.undoSolution();
+}
index 605a9779442d8a3c46d26fe5d5a26b3a05b44d51..ea31e1443e9bf80592027a50f741cc51c957a027 100644 (file)
@@ -48,6 +48,13 @@ public:
    */
   virtual SketchSolver_SolveStatus solve();
 
+  /// \brief Prepare for solving. Store initial values of parameters for undo
+  virtual void prepare()
+  { /* do nothing */ }
+
+  /// \brief Revert solution to initial values
+  virtual void undo();
+
 private:
   GCS::VEC_pD                myParameters;     ///< list of unknowns
   std::set<GCS::Constraint*> myConstraints;    ///< list of constraints already processed by the system
index 1595950154d4ecac69ce967984b3508696822463..e7e6f5cf04b89eed2763a54350213349a2402a2e 100644 (file)
@@ -65,6 +65,7 @@ public:
   /// \param theSketchID   [in]  sketch the constraint belongs to
   /// \param theType       [in]  type of constraint
   /// \param theValue      [in]  numeric characteristic of constraint (angle for multi-rotation) if applicable
+  /// \param theFullValue  [in]  indicates theValue shows full translation delta/rotation angle or delta/angle between neighbor entities
   /// \param thePoint1     [in]  center for multi-rotation or start point for multi-translation
   /// \param thePoint2     [in]  end point for multi-translation (empty for multi-rotation)
   /// \param theTrsfEnt    [in]  list of transformed entities
@@ -74,7 +75,7 @@ public:
                      const EntityID& theSketchID,
                      const SketchSolver_ConstraintType& theType,
                      const double& theValue,
-                     const bool& theFullValue,
+                     const bool theFullValue,
                      const EntityWrapperPtr& thePoint1,
                      const EntityWrapperPtr& thePoint2,
                      const std::list<EntityWrapperPtr>& theTrsfEnt) const = 0;
index 9b1105e248e0872fd79ae040498ef29ad6531765..21bd5f536ca096e45b94513ee4737f5b4ad06965 100644 (file)
@@ -134,7 +134,7 @@ std::list<ConstraintWrapperPtr> SolveSpaceSolver_Builder::createConstraint(
     const EntityID& theSketchID,
     const SketchSolver_ConstraintType& theType,
     const double& theValue,
-    const bool& theFullValue,
+    const bool theFullValue,
     const EntityWrapperPtr& thePoint1,
     const EntityWrapperPtr& thePoint2,
     const std::list<EntityWrapperPtr>& theTrsfEnt) const
index 2f8e61be9931e9fee665be38601d36c237d6bb6e..d71a5662d61170f40bd35bb15404e625071d2005 100644 (file)
@@ -63,6 +63,7 @@ public:
   /// \param theSketchID   [in]  sketch the constraint belongs to
   /// \param theType       [in]  type of constraint
   /// \param theValue      [in]  numeric characteristic of constraint (angle for multi-rotation) if applicable
+  /// \param theFullValue  [in]  indicates theValue shows full translation delta/rotation angle or delta/angle between neighbor entities
   /// \param thePoint1     [in]  center for multi-rotation or start point for multi-translation
   /// \param thePoint2     [in]  end point for multi-translation (empty for multi-rotation)
   /// \param theTrsfEnt    [in]  list of transformed entities
@@ -72,7 +73,7 @@ public:
                      const EntityID& theSketchID,
                      const SketchSolver_ConstraintType& theType,
                      const double& theValue,
-                     const bool& theFullValue,
+                     const bool theFullValue,
                      const EntityWrapperPtr& thePoint1,
                      const EntityWrapperPtr& thePoint2,
                      const std::list<EntityWrapperPtr>& theTrsfEnt) const;