- // Obtain all points of initial features and store them into separate lists
- // containing their translated copies.
- // Also all circles and arc collected too, because they will be constrained by equal radii.
- FeaturePtr aFeature;
- ResultConstructionPtr aRC;
- static const size_t MAX_POINTS = 3;
- std::vector<Slvs_hEntity> aPoints[MAX_POINTS]; // lists of points of features
- std::vector<Slvs_hEntity> anEntities; // list of translated entities
- std::list<ObjectPtr> anObjectList = aRefList->list();
- std::list<ObjectPtr>::iterator anObjectIter = anObjectList.begin();
- while (anObjectIter != anObjectList.end()) {
- for (size_t i = 0; i < MAX_POINTS; i++)
- aPoints[i].clear();
- anEntities.clear();
-
- for (size_t i = 0; i <= myNumberOfCopies && anObjectIter != anObjectList.end(); i++, anObjectIter++) {
- aFeature = ModelAPI_Feature::feature(*anObjectIter);
- if (!aFeature)
- continue;
- anEntityID = changeEntity(aFeature, aType);
- anEntities.push_back(anEntityID);
- Slvs_Entity anEntity = myStorage->getEntity(anEntityID);
- switch (aType) {
- case SLVS_E_POINT_IN_2D:
- case SLVS_E_POINT_IN_3D:
- aPoints[0].push_back(anEntityID);
- break;
- case SLVS_E_LINE_SEGMENT:
- aPoints[0].push_back(anEntity.point[0]); // start point of line
- aPoints[1].push_back(anEntity.point[1]); // end point of line
- break;
- case SLVS_E_CIRCLE:
- aPoints[0].push_back(anEntity.point[0]); // center of circle
- break;
- case SLVS_E_ARC_OF_CIRCLE:
- aPoints[0].push_back(anEntity.point[0]); // center of arc
- aPoints[1].push_back(anEntity.point[1]); // start point of arc
- aPoints[2].push_back(anEntity.point[2]); // end point of arc
- break;
- default:
- myErrorMsg = SketchSolver_Error::INCORRECT_ATTRIBUTE();
- return;
- }
- }