Salome HOME
be15c46a0970b0f1a73e091a11db56fa72acf99c
[modules/shaper.git] / src / SketchSolver / SketchSolver_ConstraintMirror.cpp
1 #include <SketchSolver_ConstraintMirror.h>
2 #include <SketchSolver_Error.h>
3 #include <SketchSolver_Manager.h>
4
5 ////#include <ModelAPI_AttributeDouble.h>
6 ////#include <ModelAPI_AttributeRefAttr.h>
7 #include <ModelAPI_AttributeRefList.h>
8 ////#include <ModelAPI_ResultConstruction.h>
9 ////
10 ////#include <GeomAPI_Dir2d.h>
11 ////#include <GeomAPI_XY.h>
12 ////
13 ////#include <cmath>
14
15 void SketchSolver_ConstraintMirror::getAttributes(
16     EntityWrapperPtr& theMirrorLine,
17     std::vector<EntityWrapperPtr>& theBaseEntities,
18     std::vector<EntityWrapperPtr>& theMirrorEntities)
19 {
20   AttributePtr aMirLineAttr = myBaseConstraint->attribute(SketchPlugin_Constraint::ENTITY_A());
21   AttributeRefAttrPtr aMirLineRefAttr =
22       std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(aMirLineAttr);
23   if (!aMirLineRefAttr || !aMirLineRefAttr->isInitialized() || !aMirLineRefAttr->isObject()) {
24     myErrorMsg = SketchSolver_Error::NOT_INITIALIZED();
25     return;
26   }
27
28   myType = TYPE(myBaseConstraint);
29   myStorage->update(aMirLineAttr, myGroupID);
30   theMirrorLine = myStorage->entity(aMirLineAttr);
31
32   // Create SolveSpace entity for all features
33   AttributeRefListPtr aBaseRefList = std::dynamic_pointer_cast<ModelAPI_AttributeRefList>(
34       myBaseConstraint->attribute(SketchPlugin_Constraint::ENTITY_B()));
35   AttributeRefListPtr aMirroredRefList = std::dynamic_pointer_cast<ModelAPI_AttributeRefList>(
36       myBaseConstraint->attribute(SketchPlugin_Constraint::ENTITY_C()));
37   myNumberOfObjects = aMirroredRefList->size();
38   if (!aBaseRefList || !aMirroredRefList) {
39     myErrorMsg = SketchSolver_Error::INCORRECT_MIRROR_ATTRIBUTE();
40     return;
41   }
42
43   std::list<ObjectPtr> aBaseList = aBaseRefList->list();
44   std::list<ObjectPtr> aMirroredList = aMirroredRefList->list();
45
46   FeaturePtr aFeature;
47   for (int i = 0; i < 2; i++) {
48     std::list<ObjectPtr>::iterator anIter = i == 0 ? aBaseList.begin() : aMirroredList.begin();
49     std::list<ObjectPtr>::iterator aEndIter = i == 0 ? aBaseList.end() : aMirroredList.end();
50     std::vector<EntityWrapperPtr>* aList = i == 0 ? &theBaseEntities : & theMirrorEntities;
51     for ( ; anIter != aEndIter; anIter++) {
52       aFeature = ModelAPI_Feature::feature(*anIter);
53       if (!aFeature)
54         continue;
55
56 ////      anEntity = changeEntity(aFeature, aType);
57 ////      // Sort entities by their type
58 ////      std::vector<Slvs_Entity>::iterator anIt = aList->begin();
59 ////      for (; anIt != aList->end(); anIt++)
60 ////        if (aType < anIt->type)
61 ////          break;
62 //////      aList->push_back(myStorage->getEntity(anEntity));
63 ////      aList->insert(anIt, myStorage->getEntity(anEntity));
64       myStorage->update(aFeature, myGroupID);
65       aList->push_back(myStorage->entity(aFeature));
66     }
67   }
68
69   if (theBaseEntities.size() > theMirrorEntities.size())
70     myErrorMsg = SketchSolver_Error::NOT_INITIALIZED();
71 }
72
73 void SketchSolver_ConstraintMirror::process()
74 {
75   cleanErrorMsg();
76   if (!myBaseConstraint || !myStorage || myGroupID == GID_UNKNOWN) {
77     // Not enough parameters are assigned
78     return;
79   }
80 ////  if (!mySlvsConstraints.empty()) // some data is changed, update constraint
81 ////    update(myBaseConstraint);
82
83   EntityWrapperPtr aMirrorLine;
84   std::vector<EntityWrapperPtr> aBaseList;
85   std::vector<EntityWrapperPtr> aMirrorList;
86   getAttributes(aMirrorLine, aBaseList, aMirrorList);
87   if (!myErrorMsg.empty())
88     return;
89
90   if (aBaseList.size() != aMirrorList.size()) {
91     myErrorMsg = SketchSolver_Error::INCORRECT_MIRROR_ATTRIBUTE();
92     return;
93   }
94
95   std::list<ConstraintWrapperPtr> aNewConstraints;
96   SketchSolver_ConstraintType aConstrType = getType();
97   BuilderPtr aBuilder = SketchSolver_Manager::instance()->builder();
98   std::list<ConstraintWrapperPtr> aMirConstrList;
99
100   std::vector<EntityWrapperPtr>::iterator aBIt = aBaseList.begin();
101   std::vector<EntityWrapperPtr>::iterator aMIt = aMirrorList.begin();
102   for (; aBIt != aBaseList.end(); ++aBIt, ++aMIt) {
103     if ((*aBIt)->type() == ENTITY_ARC) {
104       // add new points on arcs and mirror them
105       EntityWrapperPtr aBasePnt = myStorage->calculateMiddlePoint(*aBIt, 0.5);
106       EntityWrapperPtr aMirrPnt = myStorage->calculateMiddlePoint(*aMIt, 0.5);
107       // point on base arc
108       aNewConstraints = aBuilder->createConstraint(myBaseConstraint, myGroupID, mySketchID,
109           CONSTRAINT_PT_ON_CIRCLE, 0.0, aBasePnt, EntityWrapperPtr(), *aBIt);
110       aMirConstrList.insert(aMirConstrList.end(), aNewConstraints.begin(), aNewConstraints.end());
111       // point on mirrored arc
112       aNewConstraints = aBuilder->createConstraint(myBaseConstraint, myGroupID, mySketchID,
113           CONSTRAINT_PT_ON_CIRCLE, 0.0, aMirrPnt, EntityWrapperPtr(), *aMIt);
114       aMirConstrList.insert(aMirConstrList.end(), aNewConstraints.begin(), aNewConstraints.end());
115       // mirror these points
116       aNewConstraints = aBuilder->createConstraint(myBaseConstraint, myGroupID, mySketchID,
117           aConstrType, 0.0, aBasePnt, aMirrPnt, aMirrorLine);
118       aMirConstrList.insert(aMirConstrList.end(), aNewConstraints.begin(), aNewConstraints.end());
119     }
120     aNewConstraints = aBuilder->createConstraint(
121         myBaseConstraint, myGroupID, mySketchID, aConstrType,
122         0.0, *aBIt, *aMIt, aMirrorLine);
123     aMirConstrList.insert(aMirConstrList.end(), aNewConstraints.begin(), aNewConstraints.end());
124   }
125
126   myStorage->addConstraint(myBaseConstraint, aMirConstrList);
127 }
128
129
130 void SketchSolver_ConstraintMirror::update()
131 {
132   cleanErrorMsg();
133   AttributeRefListPtr aMirroredRefList = std::dynamic_pointer_cast<ModelAPI_AttributeRefList>(
134     myBaseConstraint->attribute(SketchPlugin_Constraint::ENTITY_C()));
135   if (aMirroredRefList->size() != myNumberOfObjects) {
136     remove();
137     process();
138     return;
139   }
140   SketchSolver_Constraint::update();
141 }
142
143 ////bool SketchSolver_ConstraintMirror::remove(ConstraintPtr theConstraint)
144 ////{
145 ////  cleanErrorMsg();
146 ////  if (theConstraint && theConstraint != myBaseConstraint)
147 ////    return false;
148 ////  bool isFullyRemoved = true;
149 ////  std::vector<Slvs_hEntity>::iterator aCIter = mySlvsConstraints.begin();
150 ////  for (; aCIter != mySlvsConstraints.end(); aCIter++)
151 ////   isFullyRemoved = myStorage->removeConstraint(*aCIter) && isFullyRemoved;
152 ////  mySlvsConstraints.clear();
153 ////
154 ////  std::map<FeaturePtr, Slvs_hEntity>::iterator aFeatIt = myFeatureMap.begin();
155 ////  for (; aFeatIt != myFeatureMap.end(); aFeatIt++)
156 ////    myStorage->removeEntity(aFeatIt->second);
157 ////
158 ////  if (isFullyRemoved) {
159 ////    myFeatureMap.clear();
160 ////    myAttributeMap.clear();
161 ////    myValueMap.clear();
162 ////  } else
163 ////    cleanRemovedEntities();
164 ////  return true;
165 ////}
166 ////
167 ////bool SketchSolver_ConstraintMirror::checkAttributesChanged(ConstraintPtr theConstraint)
168 ////{
169 ////  // First of all, check the mirror line is changed.
170 ////  // It may be changed to one of mirrored lines, which is already in this constraint
171 ////  // (this case is not marked as attribute changing)
172 ////  ConstraintPtr aConstraint = theConstraint ? theConstraint : myBaseConstraint;
173 ////  AttributeRefAttrPtr aRefAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(
174 ////      aConstraint->attribute(SketchPlugin_Constraint::ENTITY_A()));
175 ////  if (!aRefAttr || !aRefAttr->isObject() || !aRefAttr->object())
176 ////    return true;
177 ////  FeaturePtr aMirrorLine = ModelAPI_Feature::feature(aRefAttr->object());
178 ////  if (!aMirrorLine)
179 ////    return true;
180 ////
181 ////  std::map<FeaturePtr, Slvs_hEntity>::iterator aMirrorIter = myFeatureMap.find(aMirrorLine);
182 ////  if (aMirrorIter == myFeatureMap.end())
183 ////    return true;
184 ////
185 ////  // Check the entity is not used as mirror line
186 ////  std::vector<Slvs_hConstraint>::iterator aCIter = mySlvsConstraints.begin();
187 ////  for (; aCIter != mySlvsConstraints.end(); aCIter++) {
188 ////    Slvs_Constraint aMirrorConstr = myStorage->getConstraint(*aCIter);
189 ////    if (aMirrorConstr.type != SLVS_C_SYMMETRIC_LINE)
190 ////      continue;
191 ////    if (aMirrorConstr.entityA != aMirrorIter->second)
192 ////      return true;
193 ////    else break; // check just one symmetric constraint
194 ////  }
195 ////
196 ////  // Base verification
197 ////  return SketchSolver_Constraint::checkAttributesChanged(theConstraint);
198 ////}
199
200 ////void SketchSolver_ConstraintMirror::makeMirrorEntity(
201 ////    const Slvs_Entity& theBase,
202 ////    const Slvs_Entity& theMirror,
203 ////    const double theMirrorLine[]) const
204 ////{
205 ////  Slvs_hEntity aBasePoint[4];
206 ////  Slvs_hEntity aMirrorPoint[4];
207 ////  for (int i = 0; i < 4; i++) {
208 ////    aBasePoint[i] = theBase.point[i];
209 ////    aMirrorPoint[i] = theMirror.point[i];
210 ////  }
211 ////  if (theBase.type == SLVS_E_ARC_OF_CIRCLE) {
212 ////    Slvs_hEntity aTmp = aMirrorPoint[2];
213 ////    aMirrorPoint[2] = aMirrorPoint[1];
214 ////    aMirrorPoint[1] = aTmp;
215 ////    adjustArcPoints(theBase);
216 ////  }
217 ////  if (theBase.type == SLVS_E_POINT_IN_2D || theBase.type == SLVS_E_POINT_IN_3D) {
218 ////    aBasePoint[0] = theBase.h;
219 ////    aMirrorPoint[0] = theMirror.h;
220 ////  }
221 ////
222 ////  // Mirror line parameters
223 ////  std::shared_ptr<GeomAPI_XY> aLinePoints[2];
224 ////  for (int i = 0; i < 2; i++)
225 ////    aLinePoints[i] = std::shared_ptr<GeomAPI_XY>(
226 ////        new GeomAPI_XY(theMirrorLine[2*i], theMirrorLine[2*i+1]));
227 ////  // direction of a mirror line
228 ////  std::shared_ptr<GeomAPI_Dir2d> aDir = std::shared_ptr<GeomAPI_Dir2d>(
229 ////    new GeomAPI_Dir2d(aLinePoints[1]->added(aLinePoints[0]->multiplied(-1.0))));
230 ////  // orthogonal direction
231 ////  aDir = std::shared_ptr<GeomAPI_Dir2d>(new GeomAPI_Dir2d(aDir->y(), -aDir->x()));
232 ////
233 ////  Slvs_hConstraint aFixed; // transient variable
234 ////  for (int i = 0; i < 4; i++) {
235 ////    if (aBasePoint[i] == SLVS_E_UNKNOWN || aMirrorPoint[i] == SLVS_E_UNKNOWN)
236 ////      continue;
237 ////    // check the mirror point is not fixed
238 ////    if (myStorage->isPointFixed(aMirrorPoint[i], aFixed, true))
239 ////      continue;
240 ////
241 ////    Slvs_Entity aPointEnt = myStorage->getEntity(aBasePoint[i]);
242 ////    double aBaseX = myStorage->getParameter(aPointEnt.param[0]).val;
243 ////    double aBaseY = myStorage->getParameter(aPointEnt.param[1]).val;
244 ////    std::shared_ptr<GeomAPI_XY> aPoint = std::shared_ptr<GeomAPI_XY>(new GeomAPI_XY(aBaseX, aBaseY));
245 ////
246 ////    std::shared_ptr<GeomAPI_XY> aVec = std::shared_ptr<GeomAPI_XY>(
247 ////        new GeomAPI_XY(aPoint->x() - aLinePoints[0]->x(), aPoint->y() - aLinePoints[0]->y()));
248 ////    double aDist = aVec->dot(aDir->xy());
249 ////    aPoint = aPoint->added(aDir->xy()->multiplied(-2.0 * aDist));
250 ////
251 ////    Slvs_Entity aMirrorEnt = myStorage->getEntity(aMirrorPoint[i]);
252 ////    Slvs_Param aParam = Slvs_MakeParam(aMirrorEnt.param[0], myGroup->getId(), aPoint->x());
253 ////    myStorage->updateParameter(aParam);
254 ////    aParam = Slvs_MakeParam(aMirrorEnt.param[1], myGroup->getId(), aPoint->y());
255 ////    myStorage->updateParameter(aParam);
256 ////  }
257 ////}
258 ////
259 ////void SketchSolver_ConstraintMirror::adjustArcPoints(const Slvs_Entity& theArc) const
260 ////{
261 ////  Slvs_Param aParam;
262 ////  Slvs_Entity aPoint;
263 ////  double anArcParams[3][2];
264 ////  for (int i = 0; i < 3; i++) {
265 ////    aPoint = myStorage->getEntity(theArc.point[i]);
266 ////    for (int j = 0; j < 2; j++) {
267 ////      aParam = myStorage->getParameter(aPoint.param[j]);
268 ////      anArcParams[i][j] = aParam.val;
269 ////      if (i > 0)
270 ////        anArcParams[i][j] -= anArcParams[0][j];
271 ////    }
272 ////  }
273 ////  double aRad2 = anArcParams[1][0] * anArcParams[1][0] + anArcParams[1][1] * anArcParams[1][1];
274 ////  double aDist2 = anArcParams[2][0] * anArcParams[2][0] + anArcParams[2][1] * anArcParams[2][1];
275 ////  if (std::fabs(aRad2 - aDist2) < tolerance)
276 ////    return; // nothing to update (last point already on the arc)
277 ////  if (aDist2 < tolerance)
278 ////    return; // unable to update
279 ////  double aCoeff = std::sqrt(aRad2 / aDist2);
280 ////  anArcParams[2][0] *= aCoeff;
281 ////  anArcParams[2][1] *= aCoeff;
282 ////
283 ////  // Update last point
284 ////  aPoint = myStorage->getEntity(theArc.point[2]);
285 ////  for (int i = 0; i < 2; i++) {
286 ////    aParam = Slvs_MakeParam(aPoint.param[i], myGroup->getId(),
287 ////        anArcParams[0][i] + anArcParams[2][i]);
288 ////    myStorage->updateParameter(aParam);
289 ////  }
290 ////}
291
292 void SketchSolver_ConstraintMirror::adjustConstraint()
293 {
294   BuilderPtr aBuilder = SketchSolver_Manager::instance()->builder();
295
296   const std::list<ConstraintWrapperPtr>& aConstraints = myStorage->constraint(myBaseConstraint);
297   std::list<ConstraintWrapperPtr>::const_iterator aCIt = aConstraints.begin();
298   for (; aCIt != aConstraints.end(); ++aCIt)
299     if ((*aCIt)->type() == CONSTRAINT_SYMMETRIC)
300       aBuilder->adjustConstraint(*aCIt);
301
302 ////  AttributeRefAttrPtr aMirLineAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(
303 ////      myBaseConstraint->attribute(SketchPlugin_Constraint::ENTITY_A()));
304 ////  if (!aMirLineAttr || !aMirLineAttr->isInitialized() || !aMirLineAttr->isObject()) {
305 ////    myErrorMsg = SketchSolver_Error::NOT_INITIALIZED();
306 ////    return;
307 ////  }
308 ////  ResultConstructionPtr aRC =
309 ////      std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aMirLineAttr->object());
310 ////  FeaturePtr aFeature = aRC ? aRC->document()->feature(aRC) :
311 ////    std::dynamic_pointer_cast<ModelAPI_Feature>(aMirLineAttr->object());
312 ////  std::map<FeaturePtr, Slvs_hEntity>::iterator aMirLineIter = myFeatureMap.find(aFeature);
313 ////  if (aMirLineIter == myFeatureMap.end())
314 ////    return;
315 ////  Slvs_Entity aMirrorLine = myStorage->getEntity(aMirLineIter->second);
316 ////
317 ////  Slvs_Constraint aMirror;
318 ////  double aStartEnd[4];
319 ////  for (int i = 0; i < 2; i++) {
320 ////    Slvs_Entity aPoint = myStorage->getEntity(aMirrorLine.point[i]);
321 ////    for (int j = 0; j < 2; j++)
322 ////      aStartEnd[2*i+j] = myStorage->getParameter(aPoint.param[j]).val;
323 ////  }
324 ////
325 ////  // Calculate length of the mirror line and create temporary constraint
326 ////  double aLength = sqrt((aStartEnd[2] - aStartEnd[0]) * (aStartEnd[2] - aStartEnd[0]) +
327 ////                        (aStartEnd[3] - aStartEnd[1]) * (aStartEnd[3] - aStartEnd[1]));
328 ////  if (aLength < tolerance) {
329 ////    if (myMirrorLineLength < 1.0)
330 ////      myMirrorLineLength = 1.0;
331 ////  } else
332 ////    myMirrorLineLength = aLength;
333 ////  std::list<Slvs_Constraint> aDist = myStorage->getConstraintsByType(SLVS_C_PT_PT_DISTANCE);
334 ////  std::list<Slvs_Constraint>::const_iterator aDIt = aDist.begin();
335 ////  for (; aDIt != aDist.end(); ++aDIt)
336 ////    if ((aDIt->ptA == aMirrorLine.point[0] && aDIt->ptB == aMirrorLine.point[1]) ||
337 ////        (aDIt->ptA == aMirrorLine.point[1] && aDIt->ptB == aMirrorLine.point[0]))
338 ////      break; // length of mirror line is already set
339 ////  if (aDIt == aDist.end()) {
340 ////    // check the points of mirror line is not fixed
341 ////    Slvs_hConstraint aFixed;
342 ////    if (!myStorage->isPointFixed(aMirrorLine.point[0], aFixed, true) ||
343 ////        !myStorage->isPointFixed(aMirrorLine.point[1], aFixed, true)) {
344 ////      // Add length constraint
345 ////      aMirror = Slvs_MakeConstraint(SLVS_E_UNKNOWN, myGroup->getId(), SLVS_C_PT_PT_DISTANCE,
346 ////          myGroup->getWorkplaneId(), aLength, aMirrorLine.point[0], aMirrorLine.point[1],
347 ////          SLVS_E_UNKNOWN, SLVS_E_UNKNOWN);
348 ////      aMirror.h = myStorage->addConstraint(aMirror);
349 ////      myStorage->addTemporaryConstraint(aMirror.h);
350 ////    }
351 ////  }
352 ////
353 ////  // Search mirror between middle points on the arcs and recompute their coordinates
354 ////  std::map<Slvs_hEntity, Slvs_hEntity> aPointsOnCircles;
355 ////  std::list<Slvs_Constraint> aMirrorPonCirc;
356 ////  std::list<Slvs_Constraint> aPonCirc = myStorage->getConstraintsByType(SLVS_C_PT_ON_CIRCLE);
357 ////  std::vector<Slvs_hConstraint>::iterator aConstrIter = mySlvsConstraints.begin();
358 ////  for (; aConstrIter != mySlvsConstraints.end(); aConstrIter++) {
359 ////    aMirror = myStorage->getConstraint(*aConstrIter);
360 ////    if (aMirror.type != SLVS_C_SYMMETRIC_LINE)
361 ////      continue;
362 ////    if (aMirror.entityA != aMirrorLine.h)
363 ////      continue; // don't update another Mirror constraints
364 ////    Slvs_Constraint aPonCircA, aPonCircB;
365 ////    aPonCircA.h = SLVS_E_UNKNOWN;
366 ////    aPonCircB.h = SLVS_E_UNKNOWN;
367 ////    std::list<Slvs_Constraint>::iterator aPtIter = aPonCirc.begin();
368 ////    for (; aPtIter != aPonCirc.end(); aPtIter++) {
369 ////      if (aMirror.ptA == aPtIter->ptA)
370 ////        aPonCircA = *aPtIter;
371 ////      if (aMirror.ptB == aPtIter->ptA)
372 ////        aPonCircB = *aPtIter;
373 ////    }
374 ////    if (aPonCircA.h == SLVS_E_UNKNOWN || aPonCircB.h == SLVS_E_UNKNOWN)
375 ////      continue;
376 ////    aMirrorPonCirc.push_back(aMirror);
377 ////    // Store point IDs to avoid their recalculation twice
378 ////    aPointsOnCircles[aPonCircA.ptA] = aPonCircA.entityA;
379 ////    aPointsOnCircles[aPonCircB.ptA] = aPonCircB.entityA;
380 ////  }
381 ////
382 ////  // Recalculate positions of mirroring points
383 ////  std::list<Slvs_Constraint> aMirrorList = myStorage->getConstraintsByType(SLVS_C_SYMMETRIC_LINE);
384 ////  std::list<Slvs_Constraint>::iterator aMirIter = aMirrorList.begin();
385 ////  for (; aMirIter != aMirrorList.end(); aMirIter++) {
386 ////    if (aMirIter->entityA != aMirrorLine.h)
387 ////      continue; // don't update another Mirror constraints
388 ////    if (aPointsOnCircles.find(aMirIter->ptA) != aPointsOnCircles.end())
389 ////      continue; // Avoid mirroring points on circles
390 ////    Slvs_Entity aBase = myStorage->getEntity(aMirIter->ptA);
391 ////    Slvs_Entity aMirror = myStorage->getEntity(aMirIter->ptB);
392 ////    makeMirrorEntity(aBase, aMirror, aStartEnd);
393 ////  }
394 ////
395 ////  bool aNeedToResolve = myStorage->isNeedToResolve();
396 ////  for (aMirIter = aMirrorPonCirc.begin(); aMirIter != aMirrorPonCirc.end(); aMirIter++) {
397 ////    // Make centers of arcs symmetric
398 ////    Slvs_Entity aBaseArc = myStorage->getEntity(aPointsOnCircles[aMirIter->ptA]);
399 ////    Slvs_Entity aBasePoint = myStorage->getEntity(aBaseArc.point[0]);
400 ////    Slvs_Entity aMirrorArc = myStorage->getEntity(aPointsOnCircles[aMirIter->ptB]);
401 ////    Slvs_Entity aMirrorPoint = myStorage->getEntity(aMirrorArc.point[0]);
402 ////    makeMirrorEntity(aBasePoint, aMirrorPoint, aStartEnd);
403 ////    // Calculate middle point for base arc and mirrored point on mirror arc
404 ////    aBasePoint = myStorage->getEntity(aMirIter->ptA);
405 ////    Slvs_Param aParamX = myStorage->getParameter(aBasePoint.param[0]);
406 ////    Slvs_Param aParamY = myStorage->getParameter(aBasePoint.param[1]);
407 ////    calculateMiddlePoint(aBaseArc, 0.5, aParamX.val, aParamY.val);
408 ////    myStorage->updateParameter(aParamX);
409 ////    myStorage->updateParameter(aParamY);
410 ////    aMirrorPoint = myStorage->getEntity(aMirIter->ptB);
411 ////    aParamX = myStorage->getParameter(aMirrorPoint.param[0]);
412 ////    aParamY = myStorage->getParameter(aMirrorPoint.param[1]);
413 ////    calculateMiddlePoint(aMirrorArc, 0.5, aParamX.val, aParamY.val);
414 ////    myStorage->updateParameter(aParamX);
415 ////    myStorage->updateParameter(aParamY);
416 ////  }
417 ////  // Restore previous value to avoid looped recalculations of sketch
418 ////  myStorage->setNeedToResolve(aNeedToResolve);
419 }