Back to index

salome-geom  6.5.0
TransformationGUI_MultiRotationDlg.cxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 //  File   : TransformationGUI_MultiRotationDlg.cxx
00023 //  Author : Damien COQUERET, Open CASCADE S.A.S.
00024 
00025 #include "TransformationGUI_MultiRotationDlg.h"
00026 
00027 #include <DlgRef.h>
00028 #include <GeometryGUI.h>
00029 #include <GEOMBase.h>
00030 
00031 #include <SUIT_Session.h>
00032 #include <SUIT_ResourceMgr.h>
00033 #include <SalomeApp_Application.h>
00034 #include <LightApp_SelectionMgr.h>
00035 
00036 // OCCT Includes
00037 #include <TopoDS_Shape.hxx>
00038 #include <TopoDS_Edge.hxx>
00039 #include <TopoDS.hxx>
00040 #include <TopExp.hxx>
00041 #include <TColStd_IndexedMapOfInteger.hxx>
00042 #include <TopTools_IndexedMapOfShape.hxx>
00043 
00044 #include <GEOMImpl_Types.hxx>
00045 
00046 //=================================================================================
00047 // class    : TransformationGUI_MultiRotationDlg()
00048 // purpose  : Constructs a TransformationGUI_MultiRotationDlg which is a child of 'parent', with the
00049 //            name 'name' and widget flags set to 'f'.
00050 //            The dialog will by default be modeless, unless you set 'modal' to
00051 //            TRUE to construct a modal dialog.
00052 //=================================================================================
00053 TransformationGUI_MultiRotationDlg::TransformationGUI_MultiRotationDlg
00054 (GeometryGUI* theGeometryGUI, QWidget* parent, bool modal, Qt::WindowFlags fl)
00055   : GEOMBase_Skeleton(theGeometryGUI, parent, modal, fl),
00056     myInitial(true)
00057 {
00058   SUIT_ResourceMgr* aResMgr = myGeomGUI->getApp()->resourceMgr();
00059   QPixmap image0 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_MULTIROTATION_SIMPLE")));
00060   QPixmap image1 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_MULTIROTATION_DOUBLE")));
00061   QPixmap image2 (aResMgr->loadPixmap("GEOM", tr("ICON_SELECT")));
00062 
00063   setWindowTitle(tr("GEOM_MULTIROTATION_TITLE"));
00064 
00065   /***************************************************************/
00066   mainFrame()->GroupConstructors->setTitle(tr("GEOM_MULTIROTATION"));
00067   mainFrame()->RadioButton1->setIcon(image0);
00068   mainFrame()->RadioButton2->setIcon(image1);
00069   mainFrame()->RadioButton3->setAttribute(Qt::WA_DeleteOnClose);
00070   mainFrame()->RadioButton3->close();
00071 
00072   GroupPoints = new DlgRef_2Sel1SpinInt(centralWidget());
00073   GroupPoints->GroupBox1->setTitle(tr("GEOM_MULTIROTATION_SIMPLE"));
00074   GroupPoints->TextLabel1->setText(tr("GEOM_MAIN_OBJECT"));
00075   GroupPoints->TextLabel2->setText(tr("GEOM_VECTOR"));
00076   GroupPoints->TextLabel3->setText(tr("GEOM_NB_TIMES"));
00077   GroupPoints->PushButton1->setIcon(image2);
00078   GroupPoints->PushButton2->setIcon(image2);
00079   GroupPoints->LineEdit1->setReadOnly(true);
00080   GroupPoints->LineEdit2->setReadOnly(true);
00081 
00082   GroupDimensions = new DlgRef_2Sel4Spin1Check(centralWidget());
00083   GroupDimensions->GroupBox1->setTitle(tr("GEOM_MULTIROTATION_DOUBLE"));
00084   GroupDimensions->TextLabel1->setText(tr("GEOM_MAIN_OBJECT"));
00085   GroupDimensions->TextLabel2->setText(tr("GEOM_VECTOR"));
00086   GroupDimensions->TextLabel3->setText(tr("GEOM_ANGLE"));
00087   GroupDimensions->TextLabel4->setText(tr("GEOM_NB_TIMES"));
00088   GroupDimensions->TextLabel5->setText(tr("GEOM_STEP"));
00089   GroupDimensions->TextLabel6->setText(tr("GEOM_NB_TIMES"));
00090   GroupDimensions->CheckButton1->setText(tr("GEOM_REVERSE"));
00091   GroupDimensions->PushButton1->setIcon(image2);
00092   GroupDimensions->PushButton2->setIcon(image2);
00093   GroupDimensions->LineEdit1->setReadOnly(true);
00094   GroupDimensions->LineEdit2->setReadOnly(true);
00095 
00096   QVBoxLayout* layout = new QVBoxLayout(centralWidget());
00097   layout->setMargin(0); layout->setSpacing(6);
00098   layout->addWidget(GroupPoints);
00099   layout->addWidget(GroupDimensions);
00100   /***************************************************************/
00101 
00102   setHelpFileName("multi_rotation_operation_page.html");
00103 
00104   Init();
00105 }
00106 
00107 //=================================================================================
00108 // function : ~TransformationGUI_MultiRotationDlg()
00109 // purpose  : Destroys the object and frees any allocated resources
00110 //=================================================================================
00111 TransformationGUI_MultiRotationDlg::~TransformationGUI_MultiRotationDlg()
00112 {
00113   // no need to delete child widgets, Qt does it all for us
00114 }
00115 
00116 //=================================================================================
00117 // function : Init()
00118 // purpose  :
00119 //=================================================================================
00120 void TransformationGUI_MultiRotationDlg::Init()
00121 {
00122   // Get setting of step value from file configuration
00123   SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
00124   double step = resMgr->doubleValue("Geometry", "SettingsGeomStep", 100);
00125 
00126   int SpecificStep1 = 5;
00127   int SpecificStep2 = 1;
00128   // init variables
00129   myAng = 45.0;
00130   myStep = 50.0;
00131   myNbTimes1 = myNbTimes2 = 2;
00132 
00133   // min, max, step and decimals for spin boxes & initial values
00134   initSpinBox(GroupPoints->SpinBox_DX, 1, 999, SpecificStep2);
00135   GroupPoints->SpinBox_DX->setValue(myNbTimes1);
00136 
00137   initSpinBox(GroupDimensions->SpinBox_DX1, COORD_MIN, COORD_MAX, SpecificStep1, "angle_precision" );
00138   initSpinBox(GroupDimensions->SpinBox_DY1, 1, 999, SpecificStep2);
00139   initSpinBox(GroupDimensions->SpinBox_DX2, COORD_MIN, COORD_MAX, step,"length_precision" );
00140   initSpinBox(GroupDimensions->SpinBox_DY2, 1, 999, SpecificStep2);
00141   GroupDimensions->SpinBox_DX1->setValue(myAng);
00142   GroupDimensions->SpinBox_DY1->setValue(myNbTimes1);
00143   GroupDimensions->SpinBox_DX2->setValue(myStep);
00144   GroupDimensions->SpinBox_DY2->setValue(myNbTimes2);
00145 
00146   GroupPoints->LineEdit1->setText("");
00147   GroupPoints->LineEdit2->setText("");
00148 
00149   GroupDimensions->LineEdit1->setText("");
00150   GroupDimensions->LineEdit2->setText("");
00151 
00152   myBase.nullify();
00153   myVector.nullify();
00154 
00155   mainFrame()->GroupBoxPublish->show();
00156 
00157   // signals and slots connections
00158   connect(buttonOk(),    SIGNAL(clicked()), this, SLOT(ClickOnOk()));
00159   connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply()));
00160 
00161   connect(this,          SIGNAL(constructorsClicked(int)), this, SLOT(ConstructorsClicked(int)));
00162 
00163   connect(GroupPoints->PushButton1,     SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
00164   connect(GroupPoints->PushButton2,     SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
00165   connect(GroupDimensions->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
00166   connect(GroupDimensions->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
00167 
00168   connect(GroupPoints->SpinBox_DX,      SIGNAL(valueChanged(int)),    this, SLOT(ValueChangedInSpinBox(int)));
00169   connect(GroupDimensions->SpinBox_DX1, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
00170   connect(GroupDimensions->SpinBox_DY1, SIGNAL(valueChanged(int)),    this, SLOT(ValueChangedInSpinBox(int)));
00171   connect(GroupDimensions->SpinBox_DX2, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
00172   connect(GroupDimensions->SpinBox_DY2, SIGNAL(valueChanged(int)),    this, SLOT(ValueChangedInSpinBox(int)));
00173 
00174   connect(GroupDimensions->SpinBox_DX1,SIGNAL(textChanged( const QString& )),
00175           this, SLOT(TextValueChangedInSpinBox( const QString& )));
00176 
00177   connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), this, SLOT(SetDoubleSpinBoxStep(double)));
00178 
00179   connect(GroupDimensions->CheckButton1, SIGNAL(toggled(bool)), this, SLOT(ReverseAngle()));
00180 
00181   initName(tr("GEOM_MULTIROTATION"));
00182 
00183   ConstructorsClicked(0);
00184 }
00185 
00186 //=================================================================================
00187 // function : SetDoubleSpinBoxStep()
00188 // purpose  : Double spin box management
00189 //=================================================================================
00190 void TransformationGUI_MultiRotationDlg::SetDoubleSpinBoxStep (double step)
00191 {
00192   GroupDimensions->SpinBox_DX2->setSingleStep(step);
00193 
00194   // san: Commented so as not to override specific step settings
00195   //GroupPoints->SpinBox_DX->setSingleStep((int)step);
00196   //GroupDimensions->SpinBox_DX1->setSingleStep(step);
00197   //GroupDimensions->SpinBox_DY1->setSingleStep((int)step);
00198   //GroupDimensions->SpinBox_DY2->setSingleStep((int)step);
00199 }
00200 
00201 //=================================================================================
00202 // function : ConstructorsClicked()
00203 // purpose  : Radio button management
00204 //=================================================================================
00205 void TransformationGUI_MultiRotationDlg::ConstructorsClicked (int constructorId)
00206 {
00207   disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
00208 
00209   switch (constructorId) {
00210   case 0: // Rotate simple
00211     {
00212       GroupDimensions->hide();
00213       GroupPoints->show();
00214 
00215       GroupPoints->LineEdit1->setText("");
00216       GroupPoints->LineEdit2->setText("");
00217       myBase.nullify();
00218       myVector.nullify();
00219 
00220       GroupPoints->SpinBox_DX->setValue(myNbTimes1);
00221 
00222       GroupPoints->PushButton1->click();
00223     }
00224     break;
00225   case 1: // Rotate double
00226     {
00227       GroupPoints->hide();
00228       GroupDimensions->show();
00229 
00230       GroupDimensions->LineEdit1->setText("");
00231       GroupDimensions->LineEdit2->setText("");
00232       myBase.nullify();
00233       myVector.nullify();
00234 
00235       GroupDimensions->SpinBox_DX1->setValue(myAng);
00236       GroupDimensions->SpinBox_DY1->setValue(myNbTimes1);
00237       GroupDimensions->SpinBox_DX2->setValue(myStep);
00238       GroupDimensions->SpinBox_DY2->setValue(myNbTimes2);
00239 
00240       GroupDimensions->PushButton1->click();
00241     }
00242     break;
00243   }
00244 
00245   qApp->processEvents();
00246   updateGeometry();
00247   resize(minimumSizeHint());
00248 
00249   if (myInitial) {
00250     myInitial = false;
00251     SelectionIntoArgument();
00252   }
00253   else {
00254     processPreview();
00255   }
00256 }
00257 
00258 //=================================================================================
00259 // function : ClickOnOk()
00260 // purpose  :
00261 //=================================================================================
00262 void TransformationGUI_MultiRotationDlg::ClickOnOk()
00263 {
00264   setIsApplyAndClose( true );
00265   if (ClickOnApply())
00266     ClickOnCancel();
00267 }
00268 
00269 //=================================================================================
00270 // function : ClickOnApply()
00271 // purpose  :
00272 //=================================================================================
00273 bool TransformationGUI_MultiRotationDlg::ClickOnApply()
00274 {
00275   if (!onAccept())
00276     return false;
00277 
00278   initName();
00279   // activate selection and connect selection manager
00280   ConstructorsClicked(getConstructorId());
00281   return true;
00282 }
00283 
00284 //=================================================================================
00285 // function : SelectionIntoArgument()
00286 // purpose  : Called when selection is changed or on dialog initialization or activation
00287 //=================================================================================
00288 void TransformationGUI_MultiRotationDlg::SelectionIntoArgument()
00289 {
00290   erasePreview();
00291 
00292   TopAbs_ShapeEnum aNeedType = ( myEditCurrentArgument == GroupPoints->LineEdit2 ||
00293                              myEditCurrentArgument == GroupDimensions->LineEdit2 ) ?
00294     TopAbs_EDGE : TopAbs_SHAPE;
00295   GEOM::GeomObjPtr aSelectedObject = getSelected( aNeedType );
00296   TopoDS_Shape aShape;
00297   if ( aSelectedObject && GEOMBase::GetShape( aSelectedObject.get(), aShape ) && !aShape.IsNull() ) {
00298     QString aName = GEOMBase::GetName( aSelectedObject.get() );
00299     myEditCurrentArgument->setText( aName );
00300     if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) {
00301       myBase = aSelectedObject;
00302       if ( !myVector )
00303        GroupPoints->PushButton2->click();
00304     }
00305     else if ( myEditCurrentArgument == GroupPoints->LineEdit2)  {
00306       myVector = aSelectedObject;
00307       if ( !myBase )
00308        GroupPoints->PushButton1->click();
00309     }
00310     else if ( myEditCurrentArgument == GroupDimensions->LineEdit1 ) {
00311       myBase = aSelectedObject;
00312       if ( !myVector )
00313        GroupDimensions->PushButton2->click();
00314     }
00315     else if ( myEditCurrentArgument == GroupDimensions->LineEdit2 ) {
00316       myVector = aSelectedObject;
00317       if ( !myBase )
00318        GroupDimensions->PushButton1->click();
00319     }
00320     
00321     // clear selection
00322     disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
00323     myGeomGUI->getApp()->selectionMgr()->clearSelected();
00324     connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
00325            this, SLOT(SelectionIntoArgument()));
00326   }
00327   else {
00328     if ( myEditCurrentArgument == GroupPoints->LineEdit1 ||
00329         myEditCurrentArgument == GroupDimensions->LineEdit1 )
00330       myBase.nullify();
00331     else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ||
00332              myEditCurrentArgument == GroupDimensions->LineEdit2 )
00333       myVector.nullify();
00334     myEditCurrentArgument->setText("");
00335   }
00336 
00337   processPreview();
00338 }
00339 
00340 //=================================================================================
00341 // function : SetEditCurrentArgument()
00342 // purpose  :
00343 //=================================================================================
00344 void TransformationGUI_MultiRotationDlg::SetEditCurrentArgument()
00345 {
00346   QPushButton* send = (QPushButton*)sender();
00347 
00348   disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
00349   globalSelection(GEOM_ALLSHAPES);
00350 
00351   if (send == GroupPoints->PushButton1) {
00352     myEditCurrentArgument = GroupPoints->LineEdit1;
00353 
00354     GroupPoints->PushButton2->setDown(false);
00355     GroupPoints->LineEdit2->setEnabled(false);
00356   }
00357   else if (send == GroupPoints->PushButton2) {
00358     myEditCurrentArgument = GroupPoints->LineEdit2;
00359 
00360     localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
00361 
00362     GroupPoints->PushButton1->setDown(false);
00363     GroupPoints->LineEdit1->setEnabled(false);
00364   }
00365   else if (send == GroupDimensions->PushButton1) {
00366     myEditCurrentArgument = GroupDimensions->LineEdit1;
00367 
00368     GroupDimensions->PushButton2->setDown(false);
00369     GroupDimensions->LineEdit2->setEnabled(false);
00370   }
00371   else if (send == GroupDimensions->PushButton2) {
00372     myEditCurrentArgument = GroupDimensions->LineEdit2;
00373 
00374     localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
00375 
00376     GroupDimensions->PushButton1->setDown(false);
00377     GroupDimensions->LineEdit1->setEnabled(false);
00378   }
00379   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
00380           this, SLOT(SelectionIntoArgument()));
00381 
00382   // enable line edit
00383   myEditCurrentArgument->setEnabled(true);
00384   myEditCurrentArgument->setFocus();
00385   // after setFocus(), because it will be setDown(false) when loses focus
00386   send->setDown(true);
00387 
00388   // seems we need it only to avoid preview disappearing, caused by selection mode change
00389   processPreview();
00390 }
00391 
00392 //=================================================================================
00393 // function : ActivateThisDialog()
00394 // purpose  :
00395 //=================================================================================
00396 void TransformationGUI_MultiRotationDlg::ActivateThisDialog()
00397 {
00398   GEOMBase_Skeleton::ActivateThisDialog();
00399   connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
00400            this, SLOT( SelectionIntoArgument() ) );
00401 
00402   ConstructorsClicked( getConstructorId() );
00403 }
00404 
00405 //=================================================================================
00406 // function : enterEvent()
00407 // purpose  :
00408 //=================================================================================
00409 void TransformationGUI_MultiRotationDlg::enterEvent (QEvent*)
00410 {
00411   if (!mainFrame()->GroupConstructors->isEnabled())
00412     ActivateThisDialog();
00413 }
00414 
00415 //=================================================================================
00416 // function : TextValueChangedInSpinBox()
00417 // purpose  :
00418 //=================================================================================
00419 void TransformationGUI_MultiRotationDlg::TextValueChangedInSpinBox(const QString& s){
00420   bool isDigit;
00421   s.toDouble(&isDigit);
00422   if(!isDigit)
00423     GroupDimensions->CheckButton1->setChecked(false);
00424   GroupDimensions->CheckButton1->setEnabled(isDigit);
00425 }
00426 
00427 //=================================================================================
00428 // function : ValueChangedInSpinBox()
00429 // purpose  :
00430 //=================================================================================
00431 void TransformationGUI_MultiRotationDlg::ValueChangedInSpinBox (double newValue)
00432 {
00433   QObject* send = (QObject*)sender();
00434 
00435   if (send == GroupDimensions->SpinBox_DX1)
00436     myAng = newValue;
00437   else if (send == GroupDimensions->SpinBox_DX2)
00438     myStep = newValue;
00439 
00440   processPreview();
00441 }
00442 
00443 //=================================================================================
00444 // function : ValueChangedInSpinBox()
00445 // purpose  :
00446 //=================================================================================
00447 void TransformationGUI_MultiRotationDlg::ValueChangedInSpinBox (int newValue)
00448 {
00449   QObject* send = (QObject*)sender();
00450 
00451   if (send == GroupPoints->SpinBox_DX || send == GroupDimensions->SpinBox_DY1)
00452     myNbTimes1 = newValue;
00453   else if (send == GroupDimensions->SpinBox_DY2)
00454     myNbTimes2 = newValue;
00455 
00456   processPreview();
00457 }
00458 
00459 //=================================================================================
00460 // function : ReverseAngle()
00461 // purpose  : 'state' not used here
00462 //=================================================================================
00463 void TransformationGUI_MultiRotationDlg::ReverseAngle()
00464 {
00465   myAng = -myAng;
00466 
00467   int aConstructorId = getConstructorId();
00468 
00469   if (aConstructorId == 1)
00470     GroupDimensions->SpinBox_DX1->setValue(myAng);
00471 
00472   processPreview();
00473 }
00474 
00475 //=================================================================================
00476 // function : createOperation
00477 // purpose  :
00478 //=================================================================================
00479 GEOM::GEOM_IOperations_ptr TransformationGUI_MultiRotationDlg::createOperation()
00480 {
00481   return getGeomEngine()->GetITransformOperations(getStudyId());
00482 }
00483 
00484 //=================================================================================
00485 // function : isValid
00486 // purpose  :
00487 //=================================================================================
00488 bool TransformationGUI_MultiRotationDlg::isValid (QString& msg)
00489 {
00490   bool ok = false;
00491   switch(getConstructorId()){
00492   case 0:
00493     ok = GroupPoints->SpinBox_DX->isValid( msg, !IsPreview() ) &&  myBase && myVector;
00494     break;
00495   case 1:
00496     ok = GroupDimensions->SpinBox_DX1->isValid( msg, !IsPreview() ) &&
00497          GroupDimensions->SpinBox_DY1->isValid( msg, !IsPreview() ) &&
00498          GroupDimensions->SpinBox_DX2->isValid( msg, !IsPreview() ) &&
00499          GroupDimensions->SpinBox_DY2->isValid( msg, !IsPreview() ) &&
00500          myBase && myVector;
00501     break;
00502   default:
00503     break;
00504   }
00505   return ok;
00506 }
00507 
00508 //=================================================================================
00509 // function : execute
00510 // purpose  :
00511 //=================================================================================
00512 bool TransformationGUI_MultiRotationDlg::execute (ObjectList& objects)
00513 {
00514   bool res = false;
00515 
00516   GEOM::GEOM_Object_var anObj;
00517   QStringList aParameters;
00518 
00519   GEOM::GEOM_ITransformOperations_var anOper = GEOM::GEOM_ITransformOperations::_narrow(getOperation());
00520 
00521   switch (getConstructorId()) {
00522   case 0:
00523     if ( myBase && myVector ) {
00524       anObj = anOper->MultiRotate1D(myBase.get(), myVector.get(), myNbTimes1);
00525       if(!IsPreview())
00526         aParameters<<GroupPoints->SpinBox_DX->text();
00527       res = true;
00528     }
00529     break;
00530   case 1:
00531     if ( myBase && myVector ) {
00532       anObj = anOper->MultiRotate2D(myBase.get(), myVector.get(), myAng, myNbTimes1, myStep, myNbTimes2);
00533       if(!IsPreview()) {
00534         aParameters<<GroupDimensions->SpinBox_DX1->text();
00535         aParameters<<GroupDimensions->SpinBox_DY1->text();
00536         aParameters<<GroupDimensions->SpinBox_DX2->text();
00537         aParameters<<GroupDimensions->SpinBox_DY2->text();
00538       }
00539       res = true;
00540     }
00541     break;
00542   }
00543 
00544   if (!anObj->_is_nil()) {
00545     if(!IsPreview())
00546       anObj->SetParameters(aParameters.join(":").toLatin1().constData());
00547     objects.push_back(anObj._retn());
00548   }
00549 
00550   return res;
00551 }
00552 
00553 //=================================================================================
00554 // function : addSubshapeToStudy
00555 // purpose  : virtual method to add new SubObjects if local selection
00556 //=================================================================================
00557 void TransformationGUI_MultiRotationDlg::addSubshapesToStudy()
00558 {
00559   switch (getConstructorId()) {
00560   case 0:
00561   case 1:
00562     GEOMBase::PublishSubObject( myVector.get() );
00563     break;
00564   default:
00565     break;
00566   }
00567 }
00568 
00569 //=================================================================================
00570 // function : restoreSubShapes
00571 // purpose  :
00572 //=================================================================================
00573 void TransformationGUI_MultiRotationDlg::restoreSubShapes (SALOMEDS::Study_ptr   theStudy,
00574                                                            SALOMEDS::SObject_ptr theSObject)
00575 {
00576   if (mainFrame()->CheckBoxRestoreSS->isChecked()) {
00577     // we pass here the first operation argument (object) through the list of arguments
00578     // because the rotation operation place its arguments in the data structure in another order,
00579     // and we need to point the first argument directly
00580     GEOM::ListOfGO_var anArgs = new GEOM::ListOfGO;
00581     anArgs->length(1);
00582     anArgs[0] = myBase.copy();
00583     getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, anArgs,
00584                                         /*theFindMethod=*/GEOM::FSM_MultiTransformed,
00585                                         /*theInheritFirstArg=*/true,
00586                                         mainFrame()->CheckBoxAddPrefix->isChecked());
00587   }
00588 }