X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FTransformationGUI%2FTransformationGUI_RotationDlg.cxx;h=7e9617f3d280aab893d2c4bd3f5800af86efe453;hb=2735fef8fc422fd39a59490e6bb22f2a650d5f5e;hp=6373aff8a75c34da60af69743015b7d7633386aa;hpb=5b3622aa2363853841fd5b4205c78a715bfee4a4;p=modules%2Fgeom.git diff --git a/src/TransformationGUI/TransformationGUI_RotationDlg.cxx b/src/TransformationGUI/TransformationGUI_RotationDlg.cxx index 6373aff8a..7e9617f3d 100644 --- a/src/TransformationGUI/TransformationGUI_RotationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_RotationDlg.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -6,7 +6,7 @@ // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -275,52 +275,52 @@ void TransformationGUI_RotationDlg::SelectionIntoArgument() QString aName = GEOMBase::GetName( aSelectedObject.get() ); myEditCurrentArgument->setText( aName ); if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) { - if ( getConstructorId() == 0 ) { - myAxis = aSelectedObject; - if ( myObjects.isEmpty() ) - GroupPoints->PushButton1->click(); - } - else if ( getConstructorId() == 1 ) { - myCentPoint = aSelectedObject; - if ( !myPoint1 ) - GroupPoints->PushButton4->click(); - else if ( !myPoint2 ) - GroupPoints->PushButton5->click(); - else if ( myObjects.isEmpty() ) - GroupPoints->PushButton1->click(); - } + if ( getConstructorId() == 0 ) { + myAxis = aSelectedObject; + if ( myObjects.isEmpty() ) + GroupPoints->PushButton1->click(); + } + else if ( getConstructorId() == 1 ) { + myCentPoint = aSelectedObject; + if ( !myPoint1 ) + GroupPoints->PushButton4->click(); + else if ( !myPoint2 ) + GroupPoints->PushButton5->click(); + else if ( myObjects.isEmpty() ) + GroupPoints->PushButton1->click(); + } } else if ( myEditCurrentArgument == GroupPoints->LineEdit4 ) { - myPoint1 = aSelectedObject; - if ( !myPoint2 ) - GroupPoints->PushButton5->click(); - else if ( myObjects.isEmpty() ) - GroupPoints->PushButton1->click(); - else if ( !myCentPoint ) - GroupPoints->PushButton2->click(); + myPoint1 = aSelectedObject; + if ( !myPoint2 ) + GroupPoints->PushButton5->click(); + else if ( myObjects.isEmpty() ) + GroupPoints->PushButton1->click(); + else if ( !myCentPoint ) + GroupPoints->PushButton2->click(); } else if ( myEditCurrentArgument == GroupPoints->LineEdit5 ) { - myPoint2 = aSelectedObject; - if ( myObjects.isEmpty() ) - GroupPoints->PushButton1->click(); - else if ( !myCentPoint ) - GroupPoints->PushButton2->click(); - else if ( !myPoint1 ) - GroupPoints->PushButton4->click(); + myPoint2 = aSelectedObject; + if ( myObjects.isEmpty() ) + GroupPoints->PushButton1->click(); + else if ( !myCentPoint ) + GroupPoints->PushButton2->click(); + else if ( !myPoint1 ) + GroupPoints->PushButton4->click(); } } else { if (myEditCurrentArgument == GroupPoints->LineEdit2 ) { - if ( getConstructorId() == 0 ) - myAxis.nullify(); - else if ( getConstructorId() == 1 ) - myCentPoint.nullify(); + if ( getConstructorId() == 0 ) + myAxis.nullify(); + else if ( getConstructorId() == 1 ) + myCentPoint.nullify(); } else if ( myEditCurrentArgument == GroupPoints->LineEdit4 ) { - myPoint1.nullify(); + myPoint1.nullify(); } else if ( myEditCurrentArgument == GroupPoints->LineEdit5 ) { - myPoint2.nullify(); + myPoint2.nullify(); } myEditCurrentArgument->setText(""); } @@ -361,9 +361,9 @@ void TransformationGUI_RotationDlg::SetEditCurrentArgument() GroupPoints->LineEdit5->setEnabled(false); if (getConstructorId() == 0) - localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE); + localSelection(TopAbs_EDGE); else - localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX); + localSelection(TopAbs_VERTEX); } else if (send == GroupPoints->PushButton4) { myEditCurrentArgument = GroupPoints->LineEdit4; @@ -375,7 +375,7 @@ void TransformationGUI_RotationDlg::SetEditCurrentArgument() GroupPoints->LineEdit2->setEnabled(false); GroupPoints->LineEdit5->setEnabled(false); - localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX); + localSelection(TopAbs_VERTEX); } else if (send == GroupPoints->PushButton5) { myEditCurrentArgument = GroupPoints->LineEdit5; @@ -387,7 +387,7 @@ void TransformationGUI_RotationDlg::SetEditCurrentArgument() GroupPoints->LineEdit2->setEnabled(false); GroupPoints->LineEdit4->setEnabled(false); - localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX); + localSelection(TopAbs_VERTEX); } connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); @@ -616,3 +616,17 @@ void TransformationGUI_RotationDlg::addSubshapesToStudy() } } } + +//================================================================================= +// function : getSourceObjects +// purpose : virtual method to get source objects +//================================================================================= +QList TransformationGUI_RotationDlg::getSourceObjects() +{ + QList res; + if ( GroupPoints->CheckButton1->isChecked() ) { + res.append(myObjects); + res << myAxis << myCentPoint << myPoint1 << myPoint2; + } + return res; +}