+}
+
+//=================================================================================
+// function : execute
+// purpose :
+//=================================================================================
+bool TransformationGUI_TranslationDlg::execute( ObjectList& objects )
+{
+ bool res = false;
+ bool toCreateCopy = IsPreview() || GroupPoints->CheckBox1->isChecked();
+
+ GEOM::GEOM_Object_var anObj;
+
+ switch ( getConstructorId() ) {
+ case 0:
+ {
+ double dx = GroupPoints->SpinBox1->value();
+ double dy = GroupPoints->SpinBox2->value();
+ double dz = GroupPoints->SpinBox3->value();
+
+ if ( toCreateCopy ) {
+ for ( int i = 0; i < myObjects.length(); i++ ) {
+ anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->TranslateDXDYDZCopy( myObjects[i], dx, dy, dz );
+ if ( !anObj->_is_nil() )
+ objects.push_back( anObj._retn() );
+ }
+ }
+ else {
+ for ( int i = 0; i < myObjects.length(); i++ ) {
+ anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->TranslateDXDYDZ( myObjects[i], dx, dy, dz );
+ if ( !anObj->_is_nil() )
+ objects.push_back( anObj._retn() );
+ }
+ }
+ res = true;
+ break;
+ }
+ case 1:
+ {
+ if ( toCreateCopy ) {
+ for ( int i = 0; i < myObjects.length(); i++ ) {
+ anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->TranslateTwoPointsCopy( myObjects[i], myPoint1, myPoint2 );
+ if ( !anObj->_is_nil() )
+ objects.push_back( anObj._retn() );
+ }
+ }
+ else {
+ for ( int i = 0; i < myObjects.length(); i++ ) {
+ anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->TranslateTwoPoints( myObjects[i], myPoint1, myPoint2 );
+ if ( !anObj->_is_nil() )
+ objects.push_back( anObj._retn() );
+ }
+ }
+ res = true;
+ break;
+ }
+ 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;
+ }
+ }
+
+ return res;
+}
+
+
+//=================================================================================
+// function : CreateCopyModeChanged()
+// purpose :
+//=================================================================================
+void TransformationGUI_TranslationDlg::CreateCopyModeChanged( bool isCreateCopy )
+{
+ mainFrame()->GroupBoxName->setEnabled( isCreateCopy );
+}
+
+//=================================================================================
+// function : addSubshapeToStudy
+// purpose : virtual method to add new SubObjects if local selection
+//=================================================================================
+void TransformationGUI_TranslationDlg::addSubshapesToStudy()
+{
+ bool toCreateCopy = IsPreview() || GroupPoints->CheckBox1->isChecked();
+ if ( toCreateCopy ) {
+ QMap<QString, GEOM::GEOM_Object_var> objMap;
+
+ switch ( getConstructorId() ) {
+ case 0:
+ return;
+ case 1:
+ objMap[GroupPoints->LineEdit2->text()] = myPoint1;
+ objMap[GroupPoints->LineEdit3->text()] = myPoint2;
+ break;
+ case 2:
+ objMap[GroupPoints->LineEdit2->text()] = myVector;
+ break;
+ }
+ addSubshapesToFather( objMap );