]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Update for properly work with Length constraint
authorazv <azv@opencascade.com>
Thu, 9 Apr 2015 05:25:57 +0000 (08:25 +0300)
committerazv <azv@opencascade.com>
Thu, 9 Apr 2015 05:26:28 +0000 (08:26 +0300)
src/SketchSolver/SketchSolver_ConstraintLength.cpp
src/SketchSolver/SketchSolver_ConstraintLength.h
src/SketchSolver/SketchSolver_Storage.cpp

index 3d1d1bf22e6426e664c8a6d1b9256c0ebccbefeb..bf519342b2a2de8f74f28683e25e6265a73ecf89 100644 (file)
@@ -34,3 +34,9 @@ void SketchSolver_ConstraintLength::process()
   adjustConstraint();
 }
 
+void SketchSolver_ConstraintLength::adjustConstraint()
+{
+  // No need to store the line, which length is constrained
+  myFeatureMap.clear();
+}
+
index 5d0583752c2dd4634de75fd37299732a3e992e66..7f91d7e3a33c74ccd37939b715a4dc8877788311 100644 (file)
@@ -27,6 +27,10 @@ public:
 protected:
   /// \brief Converts SketchPlugin constraint to a list of SolveSpace constraints
   virtual void process();
+
+  /// \brief This method is used in derived objects to check consistence of constraint.
+  ///        E.g. the distance between line and point may be signed.
+  virtual void adjustConstraint();
 };
 
 #endif
index 1690d7d561d37b5a4040b46b3ba2583fe7522168..d4a5171322ad5701bd990264cbe94c8185c8c901 100644 (file)
@@ -151,19 +151,13 @@ bool SketchSolver_Storage::removeEntity(const Slvs_hEntity& theEntityID)
       if (anEntIter->distance == theEntityID)
         return false;
     }
-    std::set<Slvs_hEntity> anEntAndSubs;
-    anEntAndSubs.insert(theEntityID);
-    for (int i = 0; i < 4; i++)
-      if (myEntities[aPos].point[i] != SLVS_E_UNKNOWN)
-        anEntAndSubs.insert(myEntities[aPos].point[i]);
-
     std::vector<Slvs_Constraint>::const_iterator aConstrIter = myConstraints.begin();
     for (; aConstrIter != myConstraints.end(); aConstrIter++) {
       Slvs_hEntity anEntIDs[6] = {aConstrIter->ptA, aConstrIter->ptB,
           aConstrIter->entityA, aConstrIter->entityB,
           aConstrIter->entityC, aConstrIter->entityD};
       for (int i = 0; i < 6; i++)
-        if (anEntAndSubs.find(anEntIDs[i]) != anEntAndSubs.end())
+        if (anEntIDs[i] == theEntityID)
           return false;
     }
     // The entity is not used, remove it and its parameters