Salome HOME
Merge from V6_main 11/02/2013
[modules/geom.git] / src / BasicGUI / BasicGUI_CurveDlg.cxx
1 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21
22 // GEOM GEOMGUI : GUI for Geometry component
23 // File   : BasicGUI_CurveDlg.cxx
24 // Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
25
26 #include "BasicGUI_CurveDlg.h"
27 #include "BasicGUI_ParamCurveWidget.h"
28
29 #include <DlgRef.h>
30 #include <GeometryGUI.h>
31 #include <GEOMBase.h>
32
33 #include <SUIT_ResourceMgr.h>
34 #include <SUIT_Session.h>
35 #include <SalomeApp_Application.h>
36 #include <SalomeApp_Study.h>
37 #include <LightApp_SelectionMgr.h>
38
39 #include <SALOME_ListIteratorOfListIO.hxx>
40 #include <SALOME_ListIO.hxx>
41
42 #include <TopoDS_Shape.hxx>
43 #include <TopoDS.hxx>
44 #include <TopExp.hxx>
45 #include <TColStd_IndexedMapOfInteger.hxx>
46 #include <TopTools_IndexedMapOfShape.hxx>
47
48 #include <GEOMImpl_Types.hxx>
49
50 //=================================================================================
51 // class    : BasicGUI_CurveDlg()
52 // purpose  : Constructs a BasicGUI_CurveDlg which is a child of 'parent', with the
53 //            name 'name' and widget flags set to 'f'.
54 //            The dialog will by default be modeless, unless you set 'modal' to
55 //            TRUE to construct a modal dialog.
56 //=================================================================================
57 BasicGUI_CurveDlg::BasicGUI_CurveDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
58                                       bool modal, Qt::WindowFlags fl )
59   : GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
60 {
61   QPixmap image0 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_POLYLINE")));
62   QPixmap image2 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_SPLINE")));
63   QPixmap image3 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_BEZIER")));
64   QPixmap image1 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_SELECT")));
65
66   setWindowTitle(tr("GEOM_CURVE_TITLE"));
67
68   /***************************************************************/
69   mainFrame()->RadioButton1->setIcon(image0);
70   mainFrame()->RadioButton2->setIcon(image3);
71   mainFrame()->RadioButton3->setIcon(image2);
72
73   // Creation mode
74   QGroupBox* creationModeGroup = new QGroupBox (this);
75   QButtonGroup* bg = new QButtonGroup (this);
76
77   creationModeGroup->setTitle(tr("GEOM_CURVE_CRMODE"));
78   QHBoxLayout * creationModeLayout = new QHBoxLayout (creationModeGroup);
79   myBySelectionBtn = new QRadioButton (tr("GEOM_CURVE_SELECTION") ,creationModeGroup);
80   myAnaliticalBtn = new QRadioButton (tr("GEOM_CURVE_ANALITICAL") ,creationModeGroup);
81
82   bg->addButton(myBySelectionBtn);
83   bg->addButton(myAnaliticalBtn);
84
85   creationModeLayout->addWidget(myBySelectionBtn);
86   creationModeLayout->addWidget(myAnaliticalBtn);
87
88   // Points and flags
89   myGroupPoints = new DlgRef_1Sel3Check (centralWidget());
90
91   myGroupPoints->GroupBox1->setTitle(tr("GEOM_NODES"));
92   myGroupPoints->TextLabel1->setText(tr("GEOM_POINTS"));
93   myGroupPoints->PushButton1->setIcon(image1);
94   myGroupPoints->PushButton1->setDown(true);
95
96   myGroupPoints->LineEdit1->setReadOnly( true );
97
98   myGroupPoints->CheckButton1->setText( tr( "GEOM_IS_CLOSED" ) );
99   myGroupPoints->CheckButton1->setChecked(false);
100   //myGroupPoints->CheckButton1->hide();
101
102   myGroupPoints->CheckButton2->setText( tr( "GEOM_IS_REORDER" ) );
103   myGroupPoints->CheckButton2->setChecked(false);
104   myGroupPoints->CheckButton2->hide();
105
106   myGroupPoints->CheckButton3->hide();
107
108   // Parametrical mode
109   myGroupParams = new BasicGUI_ParamCurveWidget( centralWidget() );
110
111   // Tangents (only for Interpolation constructor and only not closed and no reordering)
112   myGroupTangents = new QGroupBox (this);
113   myGroupTangents->setCheckable(true);
114   myGroupTangents->setChecked(false);
115   myGroupTangents->setTitle(tr("GEOM_INTERPOL_TANGENTS"));
116
117   QGridLayout* tangentsLayout = new QGridLayout (myGroupTangents);
118
119   myPushBtnV1 = new QPushButton (myGroupTangents);
120   myPushBtnV2 = new QPushButton (myGroupTangents);
121   myPushBtnV1->setIcon(image1);
122   myPushBtnV2->setIcon(image1);
123
124   myLineEditV1 = new QLineEdit (myGroupTangents);
125   myLineEditV2 = new QLineEdit (myGroupTangents);
126   myLineEditV1->setReadOnly(true);
127   myLineEditV2->setReadOnly(true);
128
129   QLabel* aTextLabelV1 = new QLabel (myGroupTangents);
130   QLabel* aTextLabelV2 = new QLabel (myGroupTangents);
131   aTextLabelV1->setText(tr("GEOM_INTERPOL_FIRST_VEC"));
132   aTextLabelV2->setText(tr("GEOM_INTERPOL_LAST_VEC"));
133
134   tangentsLayout->addWidget(aTextLabelV1, 0, 0);
135   tangentsLayout->addWidget(myPushBtnV1 , 0, 1);
136   tangentsLayout->addWidget(myLineEditV1, 0, 2);
137   tangentsLayout->addWidget(aTextLabelV2, 1, 0);
138   tangentsLayout->addWidget(myPushBtnV2 , 1, 1);
139   tangentsLayout->addWidget(myLineEditV2, 1, 2);
140
141   // Layout
142   QVBoxLayout* layout = new QVBoxLayout (centralWidget());
143   layout->setMargin(0);
144   layout->setSpacing(6);
145   layout->addWidget(creationModeGroup);
146   layout->addWidget(myGroupPoints);
147   layout->addWidget(myGroupParams);
148   layout->addWidget(myGroupTangents);
149   /***************************************************************/
150
151   setHelpFileName("create_curve_page.html");
152
153   Init();
154 }
155
156 //=================================================================================
157 // function : ~BasicGUI_CurveDlg()
158 // purpose  : Destroys the object and frees any allocated resources
159 //=================================================================================
160 BasicGUI_CurveDlg::~BasicGUI_CurveDlg()
161 {
162 }
163
164 //=================================================================================
165 // function : Init()
166 // purpose  :
167 //=================================================================================
168 void BasicGUI_CurveDlg::Init()
169 {
170   /* init variables */
171   showOnlyPreviewControl();
172   myBySelectionBtn->setChecked(true);
173
174   /* Get setting of step value from file configuration */
175   SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
176   double step = resMgr ? resMgr->doubleValue( "Geometry", "SettingsGeomStep", 10. ) : 10.;
177
178   double aMax( 100. ), aMin( 0.0 );
179
180   /* min, max, step and decimals for spin boxes & initial values */
181   initSpinBox( myGroupParams->myPMin, COORD_MIN, COORD_MAX, step, "length_precision" );
182   initSpinBox( myGroupParams->myPMax, COORD_MIN, COORD_MAX, step, "length_precision" );
183   myGroupParams->myPStep->setValue( 10 );
184   myGroupParams->myPStep->setMaximum( 999 );
185   myGroupParams->myPStep->setSingleStep( 10 );
186   myGroupParams->myPMin->setValue( aMin );
187   myGroupParams->myPMax->setValue( aMax );
188   myGroupParams->myPStep->setValue( step );
189   myGroupParams->myXExpr->setText("t");
190   myGroupParams->myYExpr->setText("t");
191   myGroupParams->myZExpr->setText("t");
192
193   myGroupParams->hide();
194
195   /* signals and slots connections */
196   connect(myGeomGUI,     SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
197   connect(myGeomGUI,     SIGNAL(SignalCloseAllDialogs()),        this, SLOT(ClickOnCancel()));
198
199   connect(buttonOk(),    SIGNAL(clicked()),                      this, SLOT(ClickOnOk()));
200   connect(buttonApply(), SIGNAL(clicked()),                      this, SLOT(ClickOnApply()));
201
202   connect(this,          SIGNAL(constructorsClicked(int)),       this, SLOT(ConstructorsClicked(int)));
203
204   connect(myGroupPoints->PushButton1,  SIGNAL(clicked()),        this, SLOT(SetEditCurrentArgument()));
205   connect(myPushBtnV1,                 SIGNAL(clicked()),        this, SLOT(SetEditCurrentArgument()));
206   connect(myPushBtnV2,                 SIGNAL(clicked()),        this, SLOT(SetEditCurrentArgument()));
207
208   connect(myGroupPoints->CheckButton1, SIGNAL(toggled(bool)),    this, SLOT(CheckButtonToggled()));
209   connect(myGroupPoints->CheckButton2, SIGNAL(toggled(bool)),    this, SLOT(CheckButtonToggled()));
210   connect(myGroupTangents,             SIGNAL(toggled(bool)),    this, SLOT(CheckButtonToggled()));
211
212   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
213           this, SLOT(SelectionIntoArgument()));
214
215   connect(myBySelectionBtn,       SIGNAL(clicked()),             this, SLOT(CreationModeChanged()));
216   connect(myAnaliticalBtn,        SIGNAL(clicked()),             this, SLOT(CreationModeChanged()));
217
218   connect(myGroupParams->myPMin,  SIGNAL(valueChanged(double)),  this, SLOT(ValueChangedInSpinBox(double)));
219   connect(myGroupParams->myPMax,  SIGNAL(valueChanged(double)),  this, SLOT(ValueChangedInSpinBox(double)));
220   connect(myGroupParams->myPStep, SIGNAL(valueChanged(int)),     this, SLOT(ValueChangedInSpinBox(int)));
221
222   connect(myGroupParams->myXExpr, SIGNAL(editingFinished()),     this, SLOT(OnEditingFinished()));
223   connect(myGroupParams->myYExpr, SIGNAL(editingFinished()),     this, SLOT(OnEditingFinished()));
224   connect(myGroupParams->myZExpr, SIGNAL(editingFinished()),     this, SLOT(OnEditingFinished()));
225
226   initName(tr("GEOM_CURVE"));
227   //resize(100, 100);
228   ConstructorsClicked(0);
229 }
230
231 //=================================================================================
232 // function : ConstructorsClicked()
233 // purpose  :
234 //=================================================================================
235 void BasicGUI_CurveDlg::ConstructorsClicked (int id)
236 {
237   QString aTitle = tr(id == 0 ? "GEOM_POLYLINE" : id == 1 ? "GEOM_BEZIER" : "GEOM_INTERPOL");
238   mainFrame()->GroupConstructors->setTitle(aTitle);
239
240   if (id == 0) { // polyline (wire)
241     myGroupPoints->CheckButton1->setText( tr( "GEOM_BUILD_CLOSED_WIRE" ) );
242     myGroupPoints->CheckButton2->hide();
243     myGroupTangents->hide();
244   }
245   else if (id == 1) { // bezier
246     myGroupPoints->CheckButton1->setText( tr( "GEOM_IS_CLOSED" ) );
247     myGroupPoints->CheckButton2->hide();
248     myGroupTangents->hide();
249   }
250   else { // b-spline
251     myGroupPoints->CheckButton1->setText( tr( "GEOM_IS_CLOSED" ) );
252     myGroupPoints->CheckButton2->show();
253     myGroupTangents->setVisible(myBySelectionBtn->isChecked());
254   }
255
256   myPoints.clear();
257   myVec1.nullify();
258   myVec2.nullify();
259
260   myGroupPoints->LineEdit1->setText("");
261   myLineEditV1->setText("");
262   myLineEditV2->setText("");
263
264   qApp->processEvents();
265   updateGeometry();
266   resize(minimumSizeHint());
267
268   myGroupPoints->PushButton1->click();
269 }
270
271 //=================================================================================
272 // function : SetEditCurrentArgument()
273 // purpose  :
274 //=================================================================================
275 void BasicGUI_CurveDlg::SetEditCurrentArgument()
276 {
277   disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
278
279   globalSelection(); // close local contexts, if any
280
281   if (sender() == myGroupPoints->PushButton1) {
282     myEditCurrentArgument = myGroupPoints->LineEdit1;
283     localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
284   }
285   else if (sender() == myPushBtnV1) {
286     myEditCurrentArgument = myLineEditV1;
287     localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
288   }
289   else if (sender() == myPushBtnV2) {
290     myEditCurrentArgument = myLineEditV2;
291     localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
292   }
293
294   myEditCurrentArgument->setFocus();
295
296   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
297           this, SLOT(SelectionIntoArgument()));
298
299   SelectionIntoArgument();
300 }
301
302 //=================================================================================
303 // function : CheckButtonToggled()
304 // purpose  :
305 //=================================================================================
306 void BasicGUI_CurveDlg::CheckButtonToggled()
307 {
308   if (sender() == myGroupTangents) {
309     if (myGroupTangents->isChecked())
310       myPushBtnV1->click();
311     else
312       myGroupPoints->PushButton1->click();
313   }
314   else {
315     if (getConstructorId() == 2) { // Interpolation
316       bool disableTangents = (myGroupPoints->CheckButton1->isChecked() ||
317                               myGroupPoints->CheckButton2->isChecked());
318       myGroupTangents->setEnabled(!disableTangents);
319     }
320     processPreview();
321   }
322 }
323
324 //=================================================================================
325 // function : ClickOnOk()
326 // purpose  :
327 //=================================================================================
328 void BasicGUI_CurveDlg::ClickOnOk()
329 {
330   setIsApplyAndClose(true);
331   if (ClickOnApply())
332     ClickOnCancel();
333 }
334
335 //=================================================================================
336 // function : ClickOnApply()
337 // purpose  :
338 //=================================================================================
339 bool BasicGUI_CurveDlg::ClickOnApply()
340 {
341   if (!onAccept())
342     return false;
343
344   initName();
345   ConstructorsClicked(getConstructorId());
346   return true;
347 }
348
349 //=================================================================================
350 // function : SelectionIntoArgument()
351 // purpose  : Called when selection as changed or other case
352 //=================================================================================
353 static void synchronize (QList<GEOM::GeomObjPtr>& left, QList<GEOM::GeomObjPtr>& right)
354 {
355   // 1. remove items from the "left" list that are not in the "right" list
356   QMutableListIterator<GEOM::GeomObjPtr> it1 (left);
357   while (it1.hasNext()) {
358     GEOM::GeomObjPtr o1 = it1.next();
359     bool found = false;
360     QMutableListIterator<GEOM::GeomObjPtr> it2( right );
361     while ( it2.hasNext() && !found )
362       found = o1 == it2.next();
363     if ( !found )
364       it1.remove();
365   }
366   // 2. add items from the "right" list that are not in the "left" list (to keep selection order)
367   it1 = right;
368   while ( it1.hasNext() ) {
369     GEOM::GeomObjPtr o1 = it1.next();
370     bool found = false;
371     QMutableListIterator<GEOM::GeomObjPtr> it2( left );
372     while ( it2.hasNext() && !found )
373       found = o1 == it2.next();
374     if ( !found )
375       left << o1;
376   }
377 }
378
379 void BasicGUI_CurveDlg::SelectionIntoArgument()
380 {
381   myEditCurrentArgument->setText("");
382
383   if (myEditCurrentArgument == myGroupPoints->LineEdit1) {
384     QList<GEOM::GeomObjPtr> points = getSelected(TopAbs_VERTEX, -1);
385     synchronize(myPoints, points);
386     if (!myPoints.isEmpty())
387       myGroupPoints->LineEdit1->setText(QString::number(myPoints.count()) + "_" +
388                                         tr("GEOM_POINT") + tr("_S_"));
389   }
390   else {
391     QList<GEOM::GeomObjPtr> vecs = getSelected(TopAbs_EDGE, -1);
392     if (vecs.count() != 1) {
393       if      (myEditCurrentArgument == myLineEditV1) myVec1.nullify();
394       else if (myEditCurrentArgument == myLineEditV2) myVec2.nullify();
395     }
396     else {
397       if (myEditCurrentArgument == myLineEditV1) {
398         myVec1 = vecs.first();
399       }
400       else if (myEditCurrentArgument == myLineEditV2) {
401         myVec2 = vecs.first();
402       }
403       QString aName = GEOMBase::GetName(vecs.first().get());
404       myEditCurrentArgument->setText(aName);
405     }
406   }
407
408   processPreview();
409 }
410
411 //=================================================================================
412 // function : ActivateThisDialog()
413 // purpose  :
414 //=================================================================================
415 void BasicGUI_CurveDlg::ActivateThisDialog()
416 {
417   GEOMBase_Skeleton::ActivateThisDialog();
418
419   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
420            this, SLOT(SelectionIntoArgument()));
421
422   ConstructorsClicked(getConstructorId());
423 }
424
425 //=================================================================================
426 // function : DeactivateActiveDialog()
427 // purpose  : public slot to deactivate if active
428 //=================================================================================
429 void BasicGUI_CurveDlg::DeactivateActiveDialog()
430 {
431   // myGeomGUI->SetState( -1 );
432   GEOMBase_Skeleton::DeactivateActiveDialog();
433 }
434
435 //=================================================================================
436 // function : enterEvent()
437 // purpose  :
438 //=================================================================================
439 void BasicGUI_CurveDlg::enterEvent (QEvent*)
440 {
441   if (!mainFrame()->GroupConstructors->isEnabled())
442     ActivateThisDialog();
443 }
444
445 //=================================================================================
446 // function : createOperation
447 // purpose  :
448 //=================================================================================
449 GEOM::GEOM_IOperations_ptr BasicGUI_CurveDlg::createOperation()
450 {
451   return myGeomGUI->GetGeomGen()->GetICurvesOperations(getStudyId());
452 }
453
454 //=================================================================================
455 // function : isValid
456 // purpose  :
457 //=================================================================================
458 bool BasicGUI_CurveDlg::isValid (QString& msg)
459 {
460   if (myBySelectionBtn->isChecked()) {
461     bool ok = true;
462     if (getConstructorId() == 2) { // Interpolation
463       bool disableTangents = (myGroupPoints->CheckButton1->isChecked() ||
464                               myGroupPoints->CheckButton2->isChecked());
465       if (!disableTangents && myGroupTangents->isChecked()) {
466         ok = (myVec1 && myVec2);
467         if (!ok) msg = tr("GEOM_BOTH_TANGENTS_REQUIRED");
468       }
469     }
470     return ok && myPoints.count() > 1;
471   }
472   else {
473     bool ok = myGroupParams->myPMin->isValid( msg, !IsPreview() ) &&
474               myGroupParams->myPMax->isValid( msg, !IsPreview() ) &&
475               myGroupParams->myPStep->isValid( msg, !IsPreview() );
476     ok &= !myGroupParams->myXExpr->text().isEmpty();
477     ok &= !myGroupParams->myYExpr->text().isEmpty();
478     ok &= !myGroupParams->myZExpr->text().isEmpty();
479     return ok;
480   }
481 }
482
483 //=================================================================================
484 // function : execute
485 // purpose  :
486 //=================================================================================
487 bool BasicGUI_CurveDlg::execute (ObjectList& objects)
488 {
489   bool res = false;
490
491   GEOM::GEOM_Object_var anObj;
492
493   GEOM::GEOM_ICurvesOperations_var anOper = GEOM::GEOM_ICurvesOperations::_narrow(getOperation());
494
495   GEOM::ListOfGO_var points = new GEOM::ListOfGO();
496   points->length(myPoints.count());
497   for (int i = 0; i < myPoints.count(); i++)
498     points[i] = myPoints[i].copy();
499
500   switch (getConstructorId()) {
501   case 0 :
502     if (myBySelectionBtn->isChecked())
503       anObj = anOper->MakePolyline(points.in(), myGroupPoints->CheckButton1->isChecked());
504     else
505       anObj = anOper->MakeCurveParametricNew(qPrintable(myGroupParams->myXExpr->text()),
506                                              qPrintable(myGroupParams->myYExpr->text()),
507                                              qPrintable(myGroupParams->myZExpr->text()),
508                                              myGroupParams->myPMin->value(),
509                                              myGroupParams->myPMax->value(),
510                                              myGroupParams->myPStep->value(),
511                                              GEOM::Polyline);
512     res = true;
513     break;
514   case 1 :
515     if (myBySelectionBtn->isChecked())
516       anObj = anOper->MakeSplineBezier(points.in(), myGroupPoints->CheckButton1->isChecked());
517     else
518       anObj = anOper->MakeCurveParametricNew(qPrintable(myGroupParams->myXExpr->text()),
519                                              qPrintable(myGroupParams->myYExpr->text()),
520                                              qPrintable(myGroupParams->myZExpr->text()),
521                                              myGroupParams->myPMin->value(),
522                                              myGroupParams->myPMax->value(),
523                                              myGroupParams->myPStep->value(),
524                                              GEOM::Bezier);
525     res = true;
526     break;
527   case 2 :
528     if (myBySelectionBtn->isChecked()) {
529       bool disableTangents = (myGroupPoints->CheckButton1->isChecked() ||
530                               myGroupPoints->CheckButton2->isChecked());
531       if (!disableTangents && myGroupTangents->isChecked()) {
532         anObj = anOper->MakeSplineInterpolWithTangents(points.in(), myVec1.get(), myVec2.get());
533       }
534       else
535         anObj = anOper->MakeSplineInterpolation(points.in(), myGroupPoints->CheckButton1->isChecked(),
536                                                 myGroupPoints->CheckButton2->isChecked());
537     }
538     else
539       anObj = anOper->MakeCurveParametricNew(qPrintable(myGroupParams->myXExpr->text()),
540                                              qPrintable(myGroupParams->myYExpr->text()),
541                                              qPrintable(myGroupParams->myZExpr->text()),
542                                              myGroupParams->myPMin->value(),
543                                              myGroupParams->myPMax->value(),
544                                              myGroupParams->myPStep->value(),
545                                              GEOM::Interpolation);
546     res = true;
547     break;
548   }
549
550   if (!anObj->_is_nil()) {
551     if (myAnaliticalBtn->isChecked() && !IsPreview()) {
552       QStringList aParameters;
553       aParameters<<myGroupParams->myPMin->text();
554       aParameters<<myGroupParams->myPMax->text();
555       aParameters<<myGroupParams->myPStep->text();
556       anObj->SetParameters(aParameters.join(":").toLatin1().constData());
557     }
558     objects.push_back(anObj._retn());
559   }
560
561   return res;
562 }
563
564 //=================================================================================
565 // function : addSubshapesToStudy
566 // purpose  : virtual method to add new SubObjects if local selection
567 //=================================================================================
568 void BasicGUI_CurveDlg::addSubshapesToStudy()
569 {
570   for ( int i = 0; i < myPoints.count(); i++ )
571     GEOMBase::PublishSubObject( myPoints[i].get() );
572 }
573
574 //=================================================================================
575 // function : CreationModeChanged
576 // purpose  :
577 //=================================================================================
578 void BasicGUI_CurveDlg::CreationModeChanged()
579 {
580   const QObject* s = sender();
581   myGroupPoints->setVisible(myBySelectionBtn == s);
582   myGroupParams->setVisible(myBySelectionBtn != s);
583
584   ConstructorsClicked(getConstructorId());
585 }
586
587 //=================================================================================
588 // function : ValueChangedInSpinBox()
589 // purpose  :
590 //=================================================================================
591 void BasicGUI_CurveDlg::ValueChangedInSpinBox (double/*theValue*/)
592 {
593   processPreview();
594 }
595
596 //=================================================================================
597 // function : ValueChangedInSpinBox()
598 // purpose  :
599 //=================================================================================
600 void BasicGUI_CurveDlg::ValueChangedInSpinBox (int/*theValue*/)
601 {
602   processPreview();
603 }
604
605 //=================================================================================
606 // function : OnEditingFinished()
607 // purpose  :
608 //=================================================================================
609 void BasicGUI_CurveDlg::OnEditingFinished()
610 {
611   processPreview();
612 }