Back to index

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