- case 2:
- {
- if (toCreateCopy)
- for (int i = 0; i < myObjects.length(); i++)
- {
- anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->TranslateVectorCopy( myObjects[i], myVector );
- if ( !anObj->_is_nil() )
- objects.push_back( anObj._retn() );
- }
- else
- for (int i = 0; i < myObjects.length(); i++)
- {
- anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->TranslateVector( myObjects[i], myVector );
- if ( !anObj->_is_nil() )
- objects.push_back( anObj._retn() );
- }
- res = true;
- break;
+ res = true;
+ break;
+ }
+ case 1:
+ {
+ if (toCreateCopy) {
+ for (int i = 0; i < myObjects.length(); i++) {
+ myCurrObject = myObjects[i];
+ anObj = anOper->TranslateTwoPointsCopy(myObjects[i], myPoint1, myPoint2);
+ if (!anObj->_is_nil())
+ objects.push_back(anObj._retn());
+ }
+ }
+ else {
+ for (int i = 0; i < myObjects.length(); i++) {
+ myCurrObject = myObjects[i];
+ anObj = anOper->TranslateTwoPoints(myObjects[i], myPoint1, myPoint2);
+ if (!anObj->_is_nil())
+ objects.push_back(anObj._retn());
+ }
+ }
+ res = true;
+ break;
+ }
+ case 2:
+ {
+ QStringList aParameters;
+ aParameters<<GroupPoints->SpinBox3->text();
+ bool byDistance = GroupPoints->CheckBox1->isChecked();
+ if (byDistance) {
+ double aDistance = GroupPoints->SpinBox3->value();
+ for (int i = 0; i < myObjects.length(); i++) {
+ myCurrObject = myObjects[i];
+ anObj = anOper->TranslateVectorDistance(myObjects[i], myVector, aDistance, toCreateCopy);
+ if (!anObj->_is_nil()) {
+ if(!IsPreview()) {
+ anObj->SetParameters(aParameters.join(":").toLatin1().constData());
+ if (!toCreateCopy)
+ updateAttributes(anObj, aParameters);
+ }
+ objects.push_back(anObj._retn());
+ }
+ }
+ }
+ else {
+ if (toCreateCopy) {
+ for (int i = 0; i < myObjects.length(); i++) {
+ myCurrObject = myObjects[i];
+ anObj = anOper->TranslateVectorCopy(myObjects[i], myVector);
+ if (!anObj->_is_nil())
+ objects.push_back(anObj._retn());
+ }
+ }
+ else {
+ for (int i = 0; i < myObjects.length(); i++) {
+ myCurrObject = myObjects[i];
+ anObj = anOper->TranslateVector(myObjects[i], myVector);
+ if (!anObj->_is_nil())
+ objects.push_back(anObj._retn());
+ }
+ }