]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_FeatureBuilder.cpp
Salome HOME
Fix incorrect processing of the copied entities after the "Multi" constraint has...
[modules/shaper.git] / src / SketchSolver / PlaneGCSSolver / PlaneGCSSolver_FeatureBuilder.cpp
index e9cf468a9aa7e8c1ab2c9dac0f8b7212172a6634..035d6c895d6741453d427900f13e20e8c3c060f4 100644 (file)
@@ -25,8 +25,7 @@ static bool isAttributeApplicable(const std::string& theAttrName,
 static EntityWrapperPtr createLine(const AttributeEntityMap& theAttributes);
 static EntityWrapperPtr createCircle(const AttributeEntityMap& theAttributes);
 static EntityWrapperPtr createArc(const AttributeEntityMap&    theAttributes,
-                                  PlaneGCSSolver_Storage*      theStorage,
-                                  std::list<GCSConstraintPtr>& theArcConstraints);
+                                  PlaneGCSSolver_Storage*      theStorage);
 
 
 PlaneGCSSolver_FeatureBuilder::PlaneGCSSolver_FeatureBuilder(
@@ -76,7 +75,7 @@ EntityWrapperPtr PlaneGCSSolver_FeatureBuilder::createFeature(FeaturePtr theFeat
     aResult = createCircle(myAttributes);
   // Arc
   else if (aFeatureKind == SketchPlugin_Arc::ID())
-    aResult = createArc(myAttributes, myStorage, myFeatureConstraints);
+    aResult = createArc(myAttributes, myStorage);
   // Point (it has low probability to be an attribute of constraint, so it is checked at the end)
   else if (aFeatureKind == SketchPlugin_Point::ID() ||
            aFeatureKind == SketchPlugin_IntersectionPoint::ID()) {
@@ -147,8 +146,7 @@ static double* createParameter(PlaneGCSSolver_Storage* theStorage)
 }
 
 EntityWrapperPtr createArc(const AttributeEntityMap&    theAttributes,
-                           PlaneGCSSolver_Storage*      theStorage,
-                           std::list<GCSConstraintPtr>& theArcConstraints)
+                           PlaneGCSSolver_Storage*      theStorage)
 {
   std::shared_ptr<GCS::Arc> aNewArc(new GCS::Arc);
 
@@ -189,20 +187,6 @@ EntityWrapperPtr createArc(const AttributeEntityMap&    theAttributes,
       new GeomAPI_Dir2d((*aNewArc->end.x) - aCenter->x(), (*aNewArc->end.y) - aCenter->y()));
   *aNewArc->endAngle = OX->angle(aDir);
 
-  if (theStorage) {
-    // Additional constaints to fix arc's extra DoF (if the arc is not external):
-    // 1. distances from center till start and end points are equal to radius
-    theArcConstraints.push_back(GCSConstraintPtr(new GCS::ConstraintP2PDistance(
-        aNewArc->center, aNewArc->start, aNewArc->rad)));
-    theArcConstraints.push_back(GCSConstraintPtr(new GCS::ConstraintP2PDistance(
-        aNewArc->center, aNewArc->end, aNewArc->rad)));
-    // 2. angles of start and end points should be equal to the arc angles
-    theArcConstraints.push_back(GCSConstraintPtr(new GCS::ConstraintP2PAngle(
-        aNewArc->center, aNewArc->start, aNewArc->startAngle)));
-    theArcConstraints.push_back(GCSConstraintPtr(new GCS::ConstraintP2PAngle(
-        aNewArc->center, aNewArc->end, aNewArc->endAngle)));
-  }
-
   return EntityWrapperPtr(new PlaneGCSSolver_EdgeWrapper(aNewArc));
 }