From cecde338f2d540b911506916ec3a2d4787f6352e Mon Sep 17 00:00:00 2001 From: jfa Date: Wed, 23 Apr 2008 09:07:08 +0000 Subject: [PATCH] NPAL19657: EDF Color problem with rotation. --- .../TransformationGUI_RotationDlg.cxx | 13 +++++++++++-- .../TransformationGUI_RotationDlg.h | 1 + 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/TransformationGUI/TransformationGUI_RotationDlg.cxx b/src/TransformationGUI/TransformationGUI_RotationDlg.cxx index a5b4a97d6..c991cd9a6 100644 --- a/src/TransformationGUI/TransformationGUI_RotationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_RotationDlg.cxx @@ -462,6 +462,7 @@ bool TransformationGUI_RotationDlg::execute( ObjectList& objects ) if (toCreateCopy) for (int i = 0; i < myObjects.length(); i++) { + myCurrObject = myObjects[i]; anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )-> RotateCopy( myObjects[i], myAxis, GetAngle() * PI180 ); if ( !anObj->_is_nil() ) @@ -470,6 +471,7 @@ bool TransformationGUI_RotationDlg::execute( ObjectList& objects ) else for (int i = 0; i < myObjects.length(); i++) { + myCurrObject = myObjects[i]; anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )-> Rotate( myObjects[i], myAxis, GetAngle() * PI180 ); if ( !anObj->_is_nil() ) @@ -483,6 +485,7 @@ bool TransformationGUI_RotationDlg::execute( ObjectList& objects ) if (toCreateCopy) for (int i = 0; i < myObjects.length(); i++) { + myCurrObject = myObjects[i]; anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )-> RotateThreePointsCopy( myObjects[i], myCentPoint, myPoint1, myPoint2 ); if ( !anObj->_is_nil() ) @@ -491,6 +494,7 @@ bool TransformationGUI_RotationDlg::execute( ObjectList& objects ) else for (int i = 0; i < myObjects.length(); i++) { + myCurrObject = myObjects[i]; anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )-> RotateThreePoints( myObjects[i], myCentPoint, myPoint1, myPoint2 ); if ( !anObj->_is_nil() ) @@ -512,8 +516,13 @@ void TransformationGUI_RotationDlg::restoreSubShapes (SALOMEDS::Study_ptr theS SALOMEDS::SObject_ptr theSObject) { if (CheckBoxRestoreSS->isChecked()) { - // empty list of arguments means that all arguments should be restored - getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, GEOM::ListOfGO(), + // we pass here the first operation argument (object) through the list of arguments + // because the rotation operation place its arguments in the data structure in another order, + // and we need to point the first argument directly + GEOM::ListOfGO_var anArgs = new GEOM::ListOfGO; + anArgs->length(1); + anArgs[0] = myCurrObject; + getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, anArgs, /*theFindMethod=*/GEOM::FSM_Transformed, /*theInheritFirstArg=*/true); } diff --git a/src/TransformationGUI/TransformationGUI_RotationDlg.h b/src/TransformationGUI/TransformationGUI_RotationDlg.h index 80fd4aad0..7b89e22fe 100644 --- a/src/TransformationGUI/TransformationGUI_RotationDlg.h +++ b/src/TransformationGUI/TransformationGUI_RotationDlg.h @@ -58,6 +58,7 @@ private: double GetAngle() const; GEOM::ListOfGO myObjects; + GEOM::GEOM_Object_var myCurrObject; GEOM::GEOM_Object_var myAxis, myCentPoint, myPoint1, myPoint2; DlgRef_4Sel1Spin2Check* GroupPoints; -- 2.39.2