NPAL19657: EDF Color problem with rotation.

This commit is contained in:
jfa 2008-04-23 09:07:08 +00:00
parent 0c1468045b
commit cecde338f2
2 changed files with 12 additions and 2 deletions

View File

@ -462,6 +462,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];
anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )-> anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->
RotateCopy( myObjects[i], myAxis, GetAngle() * PI180 ); RotateCopy( myObjects[i], myAxis, GetAngle() * PI180 );
if ( !anObj->_is_nil() ) if ( !anObj->_is_nil() )
@ -470,6 +471,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];
anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )-> anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->
Rotate( myObjects[i], myAxis, GetAngle() * PI180 ); Rotate( myObjects[i], myAxis, GetAngle() * PI180 );
if ( !anObj->_is_nil() ) if ( !anObj->_is_nil() )
@ -483,6 +485,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];
anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )-> anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->
RotateThreePointsCopy( myObjects[i], myCentPoint, myPoint1, myPoint2 ); RotateThreePointsCopy( myObjects[i], myCentPoint, myPoint1, myPoint2 );
if ( !anObj->_is_nil() ) if ( !anObj->_is_nil() )
@ -491,6 +494,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];
anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )-> anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->
RotateThreePoints( myObjects[i], myCentPoint, myPoint1, myPoint2 ); RotateThreePoints( myObjects[i], myCentPoint, myPoint1, myPoint2 );
if ( !anObj->_is_nil() ) if ( !anObj->_is_nil() )
@ -512,8 +516,13 @@ void TransformationGUI_RotationDlg::restoreSubShapes (SALOMEDS::Study_ptr theS
SALOMEDS::SObject_ptr theSObject) SALOMEDS::SObject_ptr theSObject)
{ {
if (CheckBoxRestoreSS->isChecked()) { if (CheckBoxRestoreSS->isChecked()) {
// empty list of arguments means that all arguments should be restored // we pass here the first operation argument (object) through the list of arguments
getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, GEOM::ListOfGO(), // 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, /*theFindMethod=*/GEOM::FSM_Transformed,
/*theInheritFirstArg=*/true); /*theInheritFirstArg=*/true);
} }

View File

@ -58,6 +58,7 @@ private:
double GetAngle() const; double GetAngle() const;
GEOM::ListOfGO myObjects; GEOM::ListOfGO myObjects;
GEOM::GEOM_Object_var myCurrObject;
GEOM::GEOM_Object_var myAxis, myCentPoint, myPoint1, myPoint2; GEOM::GEOM_Object_var myAxis, myCentPoint, myPoint1, myPoint2;
DlgRef_4Sel1Spin2Check* GroupPoints; DlgRef_4Sel1Spin2Check* GroupPoints;