- // Set the rotation center unchanged during constraint recalculation
- Slvs_Constraint aConstraint;
- if (!myStorage->isPointFixed(myRotationCenter, aConstraint.h, true)) {
- aConstraint = Slvs_MakeConstraint(
- SLVS_E_UNKNOWN, myGroup->getId(), SLVS_C_WHERE_DRAGGED, myGroup->getWorkplaneId(), 0.0,
- myRotationCenter, SLVS_E_UNKNOWN, SLVS_E_UNKNOWN, SLVS_E_UNKNOWN);
- aConstraint.h = myStorage->addConstraint(aConstraint);
- mySlvsConstraints.push_back(aConstraint.h);
- }
-
- // Keep all objects unchanged (only initial object may be changed by user)
- myCircsAndCopies.clear();
- std::vector<std::vector<Slvs_hEntity> >::const_iterator anEntIt = anEntitiesAndCopies.begin();
- std::vector<Slvs_hEntity>::const_iterator aCpIt;
- for (; anEntIt != anEntitiesAndCopies.end(); ++anEntIt) {
- std::vector<Slvs_hEntity> aCircs;
- aCpIt = anEntIt->begin();
- // Obtain initial points
- Slvs_Entity anInitial = myStorage->getEntity(*aCpIt);
- if (anInitial.type == SLVS_E_POINT_IN_2D || anInitial.type == SLVS_E_POINT_IN_3D)
- myInitialPoints.insert(anInitial.h);
- else {
- for (int i = 0; i < 4 && anInitial.point[i] != SLVS_E_UNKNOWN; i++)
- myInitialPoints.insert(anInitial.point[i]);
- }
-
- // Fix the copies
- for (++aCpIt; aCpIt != anEntIt->end(); ++aCpIt) {
- const Slvs_Entity& anEntity = myStorage->getEntity(*aCpIt);
- std::vector<Slvs_hConstraint> aNewConstr;
- if (anEntity.type == SLVS_E_CIRCLE) {
- aCircs.push_back(anEntity.distance);
- // for circles we fix only center
- aNewConstr = myStorage->fixEntity(anEntity.point[0]);
- } else
- aNewConstr = myStorage->fixEntity(*aCpIt);
- mySlvsConstraints.insert(mySlvsConstraints.end(), aNewConstr.begin(), aNewConstr.end());
- }