Fix memory leaks

This commit is contained in:
vsr 2009-09-21 12:54:44 +00:00
parent ee26d6488a
commit d068bb8b46
8 changed files with 62 additions and 76 deletions

View File

@ -411,21 +411,21 @@ bool TransformationGUI_MirrorDlg::execute (ObjectList& objects)
GEOM::GEOM_Object_var anObj; GEOM::GEOM_Object_var anObj;
GEOM::GEOM_ITransformOperations_var anOper = GEOM::GEOM_ITransformOperations::_narrow(getOperation());
switch (getConstructorId()) { switch (getConstructorId()) {
case 0: case 0:
{ {
if (toCreateCopy) { if (toCreateCopy) {
for (int i = 0; i < myObjects.length(); i++) { for (int i = 0; i < myObjects.length(); i++) {
anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())-> anObj = anOper->MirrorPointCopy(myObjects[i], myArgument);
MirrorPointCopy(myObjects[i], myArgument);
if (!anObj->_is_nil()) if (!anObj->_is_nil())
objects.push_back(anObj._retn()); objects.push_back(anObj._retn());
} }
} }
else { else {
for (int i = 0; i < myObjects.length(); i++) { for (int i = 0; i < myObjects.length(); i++) {
anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())-> anObj = anOper->MirrorPoint(myObjects[i], myArgument);
MirrorPoint(myObjects[i], myArgument);
if (!anObj->_is_nil()) if (!anObj->_is_nil())
objects.push_back(anObj._retn()); objects.push_back(anObj._retn());
} }
@ -437,16 +437,14 @@ bool TransformationGUI_MirrorDlg::execute (ObjectList& objects)
{ {
if (toCreateCopy) { if (toCreateCopy) {
for (int i = 0; i < myObjects.length(); i++) { for (int i = 0; i < myObjects.length(); i++) {
anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())-> anObj = anOper->MirrorAxisCopy(myObjects[i], myArgument);
MirrorAxisCopy(myObjects[i], myArgument);
if (!anObj->_is_nil()) if (!anObj->_is_nil())
objects.push_back(anObj._retn()); objects.push_back(anObj._retn());
} }
} }
else { else {
for (int i = 0; i < myObjects.length(); i++) { for (int i = 0; i < myObjects.length(); i++) {
anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())-> anObj = anOper->MirrorAxis(myObjects[i], myArgument);
MirrorAxis(myObjects[i], myArgument);
if (!anObj->_is_nil()) if (!anObj->_is_nil())
objects.push_back(anObj._retn()); objects.push_back(anObj._retn());
} }
@ -458,16 +456,14 @@ bool TransformationGUI_MirrorDlg::execute (ObjectList& objects)
{ {
if (toCreateCopy) { if (toCreateCopy) {
for (int i = 0; i < myObjects.length(); i++) { for (int i = 0; i < myObjects.length(); i++) {
anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())-> anObj = anOper->MirrorPlaneCopy(myObjects[i], myArgument);
MirrorPlaneCopy(myObjects[i], myArgument);
if (!anObj->_is_nil()) if (!anObj->_is_nil())
objects.push_back(anObj._retn()); objects.push_back(anObj._retn());
} }
} }
else { else {
for (int i = 0; i < myObjects.length(); i++) { for (int i = 0; i < myObjects.length(); i++) {
anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())-> anObj = anOper->MirrorPlane(myObjects[i], myArgument);
MirrorPlane(myObjects[i], myArgument);
if (!anObj->_is_nil()) if (!anObj->_is_nil())
objects.push_back(anObj._retn()); objects.push_back(anObj._retn());
} }

View File

@ -565,11 +565,12 @@ bool TransformationGUI_MultiRotationDlg::execute (ObjectList& objects)
GEOM::GEOM_Object_var anObj; GEOM::GEOM_Object_var anObj;
QStringList aParameters; QStringList aParameters;
GEOM::GEOM_ITransformOperations_var anOper = GEOM::GEOM_ITransformOperations::_narrow(getOperation());
switch (getConstructorId()) { switch (getConstructorId()) {
case 0: case 0:
if (!CORBA::is_nil(myBase) && !CORBA::is_nil(myVector)) { if (!CORBA::is_nil(myBase) && !CORBA::is_nil(myVector)) {
anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())-> anObj = anOper->MultiRotate1D(myBase, myVector, myNbTimes1);
MultiRotate1D(myBase, myVector, myNbTimes1);
if(!IsPreview()) if(!IsPreview())
aParameters<<GroupPoints->SpinBox_DX->text(); aParameters<<GroupPoints->SpinBox_DX->text();
res = true; res = true;
@ -577,8 +578,7 @@ bool TransformationGUI_MultiRotationDlg::execute (ObjectList& objects)
break; break;
case 1: case 1:
if (!CORBA::is_nil(myBase) && !CORBA::is_nil(myVector)) { if (!CORBA::is_nil(myBase) && !CORBA::is_nil(myVector)) {
anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())-> anObj = anOper->MultiRotate2D(myBase, myVector, myAng, myNbTimes1, myStep, myNbTimes2);
MultiRotate2D(myBase, myVector, myAng, myNbTimes1, myStep, myNbTimes2);
if(!IsPreview()) { if(!IsPreview()) {
aParameters<<GroupDimensions->SpinBox_DX1->text(); aParameters<<GroupDimensions->SpinBox_DX1->text();
aParameters<<GroupDimensions->SpinBox_DY1->text(); aParameters<<GroupDimensions->SpinBox_DY1->text();
@ -592,7 +592,7 @@ bool TransformationGUI_MultiRotationDlg::execute (ObjectList& objects)
if (!anObj->_is_nil()) { if (!anObj->_is_nil()) {
if(!IsPreview()) if(!IsPreview())
anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters)); anObj->SetParameters(aParameters.join(":").toLatin1().constData());
objects.push_back(anObj._retn()); objects.push_back(anObj._retn());
} }

View File

@ -670,11 +670,12 @@ bool TransformationGUI_MultiTranslationDlg::execute (ObjectList& objects)
QStringList aParameters; QStringList aParameters;
GEOM::GEOM_ITransformOperations_var anOper = GEOM::GEOM_ITransformOperations::_narrow(getOperation());
switch (getConstructorId()) { switch (getConstructorId()) {
case 0: case 0:
if (!CORBA::is_nil(myBase) && !CORBA::is_nil(myVectorU)) { if (!CORBA::is_nil(myBase) && !CORBA::is_nil(myVectorU)) {
anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())-> anObj = anOper->MultiTranslate1D(myBase, myVectorU, myStepU, myNbTimesU);
MultiTranslate1D(myBase, myVectorU, myStepU, myNbTimesU);
if(!IsPreview()) { if(!IsPreview()) {
aParameters<<GroupPoints->SpinBox_DX->text(); aParameters<<GroupPoints->SpinBox_DX->text();
aParameters<<GroupPoints->SpinBox_DY->text(); aParameters<<GroupPoints->SpinBox_DY->text();
@ -685,9 +686,9 @@ bool TransformationGUI_MultiTranslationDlg::execute (ObjectList& objects)
case 1: case 1:
if (!CORBA::is_nil(myBase) && !CORBA::is_nil(myVectorU) && if (!CORBA::is_nil(myBase) && !CORBA::is_nil(myVectorU) &&
!CORBA::is_nil(myVectorV)) { !CORBA::is_nil(myVectorV)) {
anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())-> anObj = anOper->MultiTranslate2D(myBase,
MultiTranslate2D(myBase, myVectorU, myStepU, myNbTimesU, myVectorU, myStepU, myNbTimesU,
myVectorV, myStepV, myNbTimesV); myVectorV, myStepV, myNbTimesV);
if(!IsPreview()) { if(!IsPreview()) {
aParameters<<GroupDimensions->SpinBox_DX1->text(); aParameters<<GroupDimensions->SpinBox_DX1->text();
aParameters<<GroupDimensions->SpinBox_DY1->text(); aParameters<<GroupDimensions->SpinBox_DY1->text();
@ -701,7 +702,7 @@ bool TransformationGUI_MultiTranslationDlg::execute (ObjectList& objects)
if (!anObj->_is_nil()) { if (!anObj->_is_nil()) {
if(!IsPreview()) if(!IsPreview())
anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters)); anObj->SetParameters(aParameters.join(":").toLatin1().constData());
objects.push_back(anObj._retn()); objects.push_back(anObj._retn());
} }

View File

@ -292,10 +292,12 @@ bool TransformationGUI_OffsetDlg::execute( ObjectList& objects )
GEOM::GEOM_Object_var anObj; GEOM::GEOM_Object_var anObj;
GEOM::GEOM_ITransformOperations_var anOper = GEOM::GEOM_ITransformOperations::_narrow(getOperation());
if ( GroupPoints->CheckButton1->isChecked() || IsPreview() ) { if ( GroupPoints->CheckButton1->isChecked() || IsPreview() ) {
for ( int i = 0; i < myObjects.length(); i++ ) { for ( int i = 0; i < myObjects.length(); i++ ) {
anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->OffsetShapeCopy( myObjects[i], GetOffset() ); anObj = anOper->OffsetShapeCopy( myObjects[i], GetOffset() );
if ( !anObj->_is_nil() ) { if ( !anObj->_is_nil() ) {
if(!IsPreview()) { if(!IsPreview()) {
anObj->SetParameters(GroupPoints->SpinBox_DX->text().toLatin1().constData()); anObj->SetParameters(GroupPoints->SpinBox_DX->text().toLatin1().constData());
@ -306,7 +308,7 @@ bool TransformationGUI_OffsetDlg::execute( ObjectList& objects )
} }
else { else {
for ( int i = 0; i < myObjects.length(); i++ ) { for ( int i = 0; i < myObjects.length(); i++ ) {
anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->OffsetShape( myObjects[i], GetOffset() ); anObj = anOper->OffsetShape( myObjects[i], GetOffset() );
if ( !anObj->_is_nil() ) if ( !anObj->_is_nil() )
objects.push_back( anObj._retn() ); objects.push_back( anObj._retn() );
} }

View File

@ -607,16 +607,15 @@ bool TransformationGUI_PositionDlg::execute (ObjectList& objects)
bool toCreateCopy = IsPreview() || Group1->CheckButton1->isChecked(); bool toCreateCopy = IsPreview() || Group1->CheckButton1->isChecked();
GEOM::GEOM_Object_var anObj; GEOM::GEOM_Object_var anObj;
GEOM::GEOM_ITransformOperations_var anOper = GEOM::GEOM_ITransformOperations::_narrow(getOperation());
switch (getConstructorId()) { switch (getConstructorId()) {
case 0: case 0:
{ {
for (int i = 0; i < myObjects.length(); i++) { for (int i = 0; i < myObjects.length(); i++) {
if (toCreateCopy) anObj = toCreateCopy ?
anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())-> anOper->PositionShapeCopy(myObjects[i], myObjects[i], myEndLCS) :
PositionShapeCopy(myObjects[i], myObjects[i], myEndLCS); anOper->PositionShape(myObjects[i], myObjects[i], myEndLCS);
else
anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())->
PositionShape(myObjects[i], myObjects[i], myEndLCS);
if (!anObj->_is_nil()) if (!anObj->_is_nil())
objects.push_back(anObj._retn()); objects.push_back(anObj._retn());
@ -628,11 +627,9 @@ bool TransformationGUI_PositionDlg::execute (ObjectList& objects)
{ {
for (int i = 0; i < myObjects.length(); i++) { for (int i = 0; i < myObjects.length(); i++) {
if (toCreateCopy) if (toCreateCopy)
anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())-> anObj = toCreateCopy ?
PositionShapeCopy(myObjects[i], myStartLCS, myEndLCS); anOper->PositionShapeCopy(myObjects[i], myStartLCS, myEndLCS) :
else anOper->PositionShape(myObjects[i], myStartLCS, myEndLCS);
anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())->
PositionShape(myObjects[i], myStartLCS, myEndLCS);
if (!anObj->_is_nil()) if (!anObj->_is_nil())
objects.push_back(anObj._retn()); objects.push_back(anObj._retn());
} }
@ -644,8 +641,7 @@ bool TransformationGUI_PositionDlg::execute (ObjectList& objects)
double aDistance = Group1->SpinBox_DX->value(); double aDistance = Group1->SpinBox_DX->value();
bool toReverse = Group1->CheckButton3->isChecked(); bool toReverse = Group1->CheckButton3->isChecked();
for (int i = 0; i < myObjects.length(); i++) { for (int i = 0; i < myObjects.length(); i++) {
anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())-> anObj = anOper->PositionAlongPath(myObjects[i], myPath, aDistance, toCreateCopy, toReverse);
PositionAlongPath(myObjects[i], myPath, aDistance, toCreateCopy, toReverse);
if (!anObj->_is_nil()) if (!anObj->_is_nil())
objects.push_back(anObj._retn()); objects.push_back(anObj._retn());
} }

View File

@ -537,6 +537,8 @@ bool TransformationGUI_RotationDlg::execute (ObjectList& objects)
GEOM::GEOM_Object_var anObj; GEOM::GEOM_Object_var anObj;
GEOM::GEOM_ITransformOperations_var anOper = GEOM::GEOM_ITransformOperations::_narrow(getOperation());
switch (getConstructorId()) { switch (getConstructorId()) {
case 0: case 0:
{ {
@ -545,11 +547,10 @@ bool TransformationGUI_RotationDlg::execute (ObjectList& objects)
if (toCreateCopy) { if (toCreateCopy) {
for (int i = 0; i < myObjects.length(); i++) { for (int i = 0; i < myObjects.length(); i++) {
myCurrObject = myObjects[i]; myCurrObject = myObjects[i];
anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())-> anObj = anOper->RotateCopy(myObjects[i], myAxis, GetAngle() * PI180);
RotateCopy(myObjects[i], myAxis, GetAngle() * PI180);
if (!anObj->_is_nil()) { if (!anObj->_is_nil()) {
if(!IsPreview()) { if(!IsPreview()) {
anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters)); anObj->SetParameters(aParameters.join(":").toLatin1().constData());
} }
objects.push_back(anObj._retn()); objects.push_back(anObj._retn());
} }
@ -558,11 +559,10 @@ bool TransformationGUI_RotationDlg::execute (ObjectList& objects)
else { else {
for (int i = 0; i < myObjects.length(); i++) { for (int i = 0; i < myObjects.length(); i++) {
myCurrObject = myObjects[i]; myCurrObject = myObjects[i];
anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())-> anObj = anOper->Rotate(myObjects[i], myAxis, GetAngle() * PI180);
Rotate(myObjects[i], myAxis, GetAngle() * PI180);
if (!anObj->_is_nil()) { if (!anObj->_is_nil()) {
if(!IsPreview()) { if(!IsPreview()) {
anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters)); anObj->SetParameters(aParameters.join(":").toLatin1().constData());
updateAttributes(anObj, aParameters); updateAttributes(anObj, aParameters);
} }
objects.push_back(anObj._retn()); objects.push_back(anObj._retn());
@ -577,8 +577,7 @@ bool TransformationGUI_RotationDlg::execute (ObjectList& objects)
if (toCreateCopy) { if (toCreateCopy) {
for (int i = 0; i < myObjects.length(); i++) { for (int i = 0; i < myObjects.length(); i++) {
myCurrObject = myObjects[i]; myCurrObject = myObjects[i];
anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())-> anObj = anOper->RotateThreePointsCopy(myObjects[i], myCentPoint, myPoint1, myPoint2);
RotateThreePointsCopy(myObjects[i], myCentPoint, myPoint1, myPoint2);
if (!anObj->_is_nil()) if (!anObj->_is_nil())
objects.push_back(anObj._retn()); objects.push_back(anObj._retn());
} }
@ -586,8 +585,7 @@ bool TransformationGUI_RotationDlg::execute (ObjectList& objects)
else { else {
for (int i = 0; i < myObjects.length(); i++) { for (int i = 0; i < myObjects.length(); i++) {
myCurrObject = myObjects[i]; myCurrObject = myObjects[i];
anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())-> anObj = anOper->RotateThreePoints(myObjects[i], myCentPoint, myPoint1, myPoint2);
RotateThreePoints(myObjects[i], myCentPoint, myPoint1, myPoint2);
if (!anObj->_is_nil()) if (!anObj->_is_nil())
objects.push_back(anObj._retn()); objects.push_back(anObj._retn());
} }

View File

@ -488,6 +488,8 @@ bool TransformationGUI_ScaleDlg::execute (ObjectList& objects)
GEOM::GEOM_Object_var anObj; GEOM::GEOM_Object_var anObj;
GEOM::GEOM_ITransformOperations_var anOper = GEOM::GEOM_ITransformOperations::_narrow(getOperation());
switch (getConstructorId()) switch (getConstructorId())
{ {
case 0: case 0:
@ -496,8 +498,7 @@ bool TransformationGUI_ScaleDlg::execute (ObjectList& objects)
{ {
for (int i = 0; i < myObjects.length(); i++) for (int i = 0; i < myObjects.length(); i++)
{ {
anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())-> anObj = anOper->ScaleShapeCopy(myObjects[i], myPoint, SpinBox_FX->value());
ScaleShapeCopy(myObjects[i], myPoint, SpinBox_FX->value());
if (!anObj->_is_nil()) { if (!anObj->_is_nil()) {
if(!IsPreview()) if(!IsPreview())
anObj->SetParameters(SpinBox_FX->text().toLatin1().constData()); anObj->SetParameters(SpinBox_FX->text().toLatin1().constData());
@ -509,8 +510,7 @@ bool TransformationGUI_ScaleDlg::execute (ObjectList& objects)
{ {
for (int i = 0; i < myObjects.length(); i++) for (int i = 0; i < myObjects.length(); i++)
{ {
anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())-> anObj = anOper->ScaleShape(myObjects[i], myPoint, SpinBox_FX->value());
ScaleShape(myObjects[i], myPoint, SpinBox_FX->value());
if (!anObj->_is_nil()) if (!anObj->_is_nil())
objects.push_back(anObj._retn()); objects.push_back(anObj._retn());
} }
@ -523,16 +523,15 @@ bool TransformationGUI_ScaleDlg::execute (ObjectList& objects)
{ {
for (int i = 0; i < myObjects.length(); i++) for (int i = 0; i < myObjects.length(); i++)
{ {
anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())-> anObj = anOper->ScaleShapeAlongAxesCopy(myObjects[i], myPoint, SpinBox_FX->value(),
ScaleShapeAlongAxesCopy(myObjects[i], myPoint, SpinBox_FX->value(), SpinBox_FY->value(), SpinBox_FZ->value());
SpinBox_FY->value(), SpinBox_FZ->value());
if (!anObj->_is_nil()) if (!anObj->_is_nil())
if(!IsPreview()) { if(!IsPreview()) {
QStringList aParameters; QStringList aParameters;
aParameters<<SpinBox_FX->text(); aParameters<<SpinBox_FX->text();
aParameters<<SpinBox_FY->text(); aParameters<<SpinBox_FY->text();
aParameters<<SpinBox_FZ->text(); aParameters<<SpinBox_FZ->text();
anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters)); anObj->SetParameters(aParameters.join(":").toLatin1().constData());
} }
objects.push_back(anObj._retn()); objects.push_back(anObj._retn());
} }
@ -541,9 +540,8 @@ bool TransformationGUI_ScaleDlg::execute (ObjectList& objects)
{ {
for (int i = 0; i < myObjects.length(); i++) for (int i = 0; i < myObjects.length(); i++)
{ {
anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())-> anObj = anOper->ScaleShapeAlongAxes(myObjects[i], myPoint, SpinBox_FX->value(),
ScaleShapeAlongAxes(myObjects[i], myPoint, SpinBox_FX->value(), SpinBox_FY->value(), SpinBox_FZ->value());
SpinBox_FY->value(), SpinBox_FZ->value());
if (!anObj->_is_nil()) if (!anObj->_is_nil())
objects.push_back(anObj._retn()); objects.push_back(anObj._retn());
} }

View File

@ -554,6 +554,8 @@ bool TransformationGUI_TranslationDlg::execute (ObjectList& objects)
GEOM::GEOM_Object_var anObj; GEOM::GEOM_Object_var anObj;
GEOM::GEOM_ITransformOperations_var anOper = GEOM::GEOM_ITransformOperations::_narrow(getOperation());
switch (getConstructorId()) { switch (getConstructorId()) {
case 0: case 0:
{ {
@ -569,11 +571,10 @@ bool TransformationGUI_TranslationDlg::execute (ObjectList& objects)
if (toCreateCopy) { if (toCreateCopy) {
for (int i = 0; i < myObjects.length(); i++) { for (int i = 0; i < myObjects.length(); i++) {
myCurrObject = myObjects[i]; myCurrObject = myObjects[i];
anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())-> anObj = anOper->TranslateDXDYDZCopy(myObjects[i], dx, dy, dz);
TranslateDXDYDZCopy(myObjects[i], dx, dy, dz);
if (!anObj->_is_nil()) { if (!anObj->_is_nil()) {
if(!IsPreview()) if(!IsPreview())
anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters)); anObj->SetParameters(aParameters.join(":").toLatin1().constData());
objects.push_back(anObj._retn()); objects.push_back(anObj._retn());
} }
} }
@ -581,11 +582,10 @@ bool TransformationGUI_TranslationDlg::execute (ObjectList& objects)
else { else {
for (int i = 0; i < myObjects.length(); i++) { for (int i = 0; i < myObjects.length(); i++) {
myCurrObject = myObjects[i]; myCurrObject = myObjects[i];
anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())-> anObj = anOper->TranslateDXDYDZ(myObjects[i], dx, dy, dz);
TranslateDXDYDZ(myObjects[i], dx, dy, dz);
if (!anObj->_is_nil()) { if (!anObj->_is_nil()) {
if(!IsPreview()) { if(!IsPreview()) {
anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters)); anObj->SetParameters(aParameters.join(":").toLatin1().constData());
updateAttributes(anObj, aParameters); updateAttributes(anObj, aParameters);
} }
objects.push_back(anObj._retn()); objects.push_back(anObj._retn());
@ -600,8 +600,7 @@ bool TransformationGUI_TranslationDlg::execute (ObjectList& objects)
if (toCreateCopy) { if (toCreateCopy) {
for (int i = 0; i < myObjects.length(); i++) { for (int i = 0; i < myObjects.length(); i++) {
myCurrObject = myObjects[i]; myCurrObject = myObjects[i];
anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())-> anObj = anOper->TranslateTwoPointsCopy(myObjects[i], myPoint1, myPoint2);
TranslateTwoPointsCopy(myObjects[i], myPoint1, myPoint2);
if (!anObj->_is_nil()) if (!anObj->_is_nil())
objects.push_back(anObj._retn()); objects.push_back(anObj._retn());
} }
@ -609,8 +608,7 @@ bool TransformationGUI_TranslationDlg::execute (ObjectList& objects)
else { else {
for (int i = 0; i < myObjects.length(); i++) { for (int i = 0; i < myObjects.length(); i++) {
myCurrObject = myObjects[i]; myCurrObject = myObjects[i];
anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())-> anObj = anOper->TranslateTwoPoints(myObjects[i], myPoint1, myPoint2);
TranslateTwoPoints(myObjects[i], myPoint1, myPoint2);
if (!anObj->_is_nil()) if (!anObj->_is_nil())
objects.push_back(anObj._retn()); objects.push_back(anObj._retn());
} }
@ -627,11 +625,10 @@ bool TransformationGUI_TranslationDlg::execute (ObjectList& objects)
double aDistance = GroupPoints->SpinBox3->value(); double aDistance = GroupPoints->SpinBox3->value();
for (int i = 0; i < myObjects.length(); i++) { for (int i = 0; i < myObjects.length(); i++) {
myCurrObject = myObjects[i]; myCurrObject = myObjects[i];
anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())-> anObj = anOper->TranslateVectorDistance(myObjects[i], myVector, aDistance, toCreateCopy);
TranslateVectorDistance(myObjects[i], myVector, aDistance, toCreateCopy);
if (!anObj->_is_nil()) { if (!anObj->_is_nil()) {
if(!IsPreview()) { if(!IsPreview()) {
anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters)); anObj->SetParameters(aParameters.join(":").toLatin1().constData());
if (!toCreateCopy) if (!toCreateCopy)
updateAttributes(anObj, aParameters); updateAttributes(anObj, aParameters);
} }
@ -643,8 +640,7 @@ bool TransformationGUI_TranslationDlg::execute (ObjectList& objects)
if (toCreateCopy) { if (toCreateCopy) {
for (int i = 0; i < myObjects.length(); i++) { for (int i = 0; i < myObjects.length(); i++) {
myCurrObject = myObjects[i]; myCurrObject = myObjects[i];
anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())-> anObj = anOper->TranslateVectorCopy(myObjects[i], myVector);
TranslateVectorCopy(myObjects[i], myVector);
if (!anObj->_is_nil()) if (!anObj->_is_nil())
objects.push_back(anObj._retn()); objects.push_back(anObj._retn());
} }
@ -652,8 +648,7 @@ bool TransformationGUI_TranslationDlg::execute (ObjectList& objects)
else { else {
for (int i = 0; i < myObjects.length(); i++) { for (int i = 0; i < myObjects.length(); i++) {
myCurrObject = myObjects[i]; myCurrObject = myObjects[i];
anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())-> anObj = anOper->TranslateVector(myObjects[i], myVector);
TranslateVector(myObjects[i], myVector);
if (!anObj->_is_nil()) if (!anObj->_is_nil())
objects.push_back(anObj._retn()); objects.push_back(anObj._retn());
} }