Salome HOME
CreateManyMesh, EditPrs, Presentation options, Scaling
[modules/visu.git] / src / VISUGUI / VisuGUI_CutPlanesDlg.cxx
1 //  VISU VISUGUI : GUI of VISU component
2 //
3 //  Copyright (C) 2003  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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
21 //
22 //
23 //
24 //  File   : VisuGUI_CutPlanesDlg.cxx
25 //  Author : Laurent CORNABE & Hubert ROLLAND
26 //  Module : VISU
27 //  $Header$
28
29 #include "VisuGUI_CutPlanesDlg.h"
30
31 #include "VisuGUI.h"
32 #include "VisuGUI_Tools.h"
33
34 #include "VISU_CutPlanes_i.hh"
35 #include "VISU_CutPlanesPL.hxx"
36
37 #include "OB_Browser.h"
38
39 #include "SVTK_ViewWindow.h"
40
41 #include "SalomeApp_Application.h"
42
43 #include "SUIT_Application.h"
44 #include "SUIT_Desktop.h"
45 #include "SUIT_ViewWindow.h"
46 #include "SUIT_ViewManager.h"
47
48 #include <qlayout.h>
49 #include <qcheckbox.h>
50 #include <qstyle.h>
51 #include <qstring.h>
52 #include <qvalidator.h>
53 #include <qlineedit.h>
54 #include <qtabwidget.h>
55
56 #include <vtkRenderer.h>
57 #include <vtkPolyData.h>
58 #include <vtkAppendPolyData.h>
59 #include <vtkDataSetMapper.h>
60
61 using namespace std;
62
63 //extern VisuGUI *visuGUI;
64
65 VisuGUI_CutPlanesPane::VisuGUI_CutPlanesPane (QWidget* theParent/*, SUIT_ViewManager* theMgr*/)
66      : QFrame(theParent), myPreviewActor(0)//, myMgr(theMgr)
67 {
68   QGridLayout* TopLayout = new QGridLayout( this );
69   TopLayout->setSpacing( 6 );
70   TopLayout->setMargin( 10 );
71
72   QButtonGroup* SelPlane = new QButtonGroup (tr("TXT_ORIENTATION"), this, "SelPlane");
73   //SelPlane->setTitle(tr("TXT_ORIENTATION"));
74   SelPlane->setColumnLayout(0, Qt::Vertical);
75   SelPlane->layout()->setSpacing( 0 );
76   SelPlane->layout()->setMargin( 0 );
77   QGridLayout* SelPlaneLayout = new QGridLayout( SelPlane->layout() );
78   SelPlaneLayout->setAlignment( Qt::AlignTop );
79   SelPlaneLayout->setSpacing( 6 );
80   SelPlaneLayout->setMargin( 11 );
81
82   RBxy = new QRadioButton (tr("PARALLEL_XOY"), SelPlane, "RBxy");
83   RByz = new QRadioButton (tr("PARALLEL_YOZ"), SelPlane, "RByz");
84   RBzx = new QRadioButton (tr("PARALLEL_ZOX"), SelPlane, "RBzx");
85   SelPlaneLayout->addWidget( RBxy, 0, 0 );
86   SelPlaneLayout->addWidget( RByz, 0, 1 );
87   SelPlaneLayout->addWidget( RBzx, 0, 2 );
88
89   QLabel* LabelPosi_3 = new QLabel (tr("LBL_NB_PLANS"), this, "LabelPosi_3");
90
91   nbPlan = new QSpinBox( 1, 100, 1, this, "nbPlan" );
92   nbPlan->setValue( 1 );
93   nbPlan->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
94
95   myPosTable = new QTable (this, "Positions of planes");
96   myPosTable->setMaximumHeight( 227 );
97   myPosTable->setMinimumWidth( 294 );
98   myPosTable->setNumCols(2);
99   myPosTable->setNumRows(0);
100   connect( myPosTable, SIGNAL(valueChanged(int, int)), this, SLOT(onValueChanged(int, int)) );
101
102   QHeader *th = myPosTable->horizontalHeader();
103   th->setLabel( 0, "Position" );
104   th->setLabel( 1, "Set default" );
105   th->setStyle("QStyle::CE_PushButton");
106
107   QGroupBox* GBrot = new QGroupBox (tr("LBL_ROTATION"), this, "GBrot");
108   GBrot->setColumnLayout(0, Qt::Vertical);
109   GBrot->layout()->setSpacing( 0 );
110   GBrot->layout()->setMargin( 0 );
111   QGridLayout* GBrotLayout = new QGridLayout( GBrot->layout() );
112   GBrotLayout->setAlignment( Qt::AlignTop );
113   GBrotLayout->setSpacing( 6 );
114   GBrotLayout->setMargin( 11 );
115
116   LabelRot1 = new QLabel (tr("LBL_ROT_X"), GBrot, "LabelRot1");
117   GBrotLayout->addWidget( LabelRot1, 0, 0 );
118
119   Rot1 = new QtxDblSpinBox( -180, 180, 10, GBrot );
120   Rot1->setValue( 0 );
121   Rot1->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
122   connect( Rot1, SIGNAL( valueChanged( double )), this, SLOT( onRotation( double ) ) );
123   GBrotLayout->addWidget( Rot1, 0, 1 );
124
125   LabelRot2 = new QLabel (tr("LBL_ROT_Y"), GBrot, "LabelRot2");
126   GBrotLayout->addWidget( LabelRot2, 1, 0 );
127
128   Rot2 = new QtxDblSpinBox( -180, 180, 10, GBrot );
129   Rot2->setValue( 0 );
130   Rot2->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
131   connect( Rot2, SIGNAL( valueChanged( double )), this, SLOT( onRotation( double ) ) );
132   GBrotLayout->addWidget( Rot2, 1, 1 );
133
134   QLabel* aPosLbl = new QLabel(tr( "LBL_POS" ), this);
135   myPosSpn = new QtxDblSpinBox( 0, 1, 0.1, this );
136
137   myPreviewCheck = new QCheckBox(tr("LBL_SHOW_PREVIEW"), this);
138   myPreviewCheck->setChecked(false);
139   connect( myPreviewCheck, SIGNAL( toggled( bool )), this, SLOT( onPreviewCheck( bool ) ) );
140
141   TopLayout->addMultiCellWidget( SelPlane, 0, 0, 0, 1 );
142   TopLayout->addMultiCellWidget( GBrot, 1, 1, 0, 1 );
143   TopLayout->addWidget( LabelPosi_3,   2, 0 );
144   TopLayout->addWidget( nbPlan,        2, 1 );
145   TopLayout->addMultiCellWidget( myPosTable, 3, 3, 0, 1 );
146   TopLayout->setRowStretch ( 3, 3 );
147   TopLayout->addWidget(aPosLbl, 4, 0 );
148   TopLayout->addWidget(myPosSpn, 4, 1 );
149   TopLayout->addMultiCellWidget( myPreviewCheck, 5, 5, 0, 1 );
150
151   // signals and slots connections
152   connect( SelPlane, SIGNAL( clicked( int )), this, SLOT( orientationChanged( int ) ) );
153   connect( nbPlan, SIGNAL( valueChanged( int )), this, SLOT( DrawTable( ) ) );
154   connect( myPosSpn, SIGNAL( valueChanged( double )), this, SLOT( DrawTable( ) ) );
155   connect( th, SIGNAL( clicked(int)), this, SLOT( setDefault(int) ) );
156
157   // default values
158   myCutPlanes = NULL;
159   hasInit = false;
160   X1 = 0; X2 = 0;
161   Y1 = 0; Y2 = 0;
162   Z1 = 0; Z2 = 0;
163   RByz->setChecked( true );
164
165 } // End of Constructor
166
167 VisuGUI_CutPlanesPane::~VisuGUI_CutPlanesPane()
168 {
169   deletePlanes();
170   if (myCutPlanes)
171     myCutPlanes->Destroy();
172   if (SVTK_ViewWindow* vf = VISU::GetViewWindow())
173     vf->Repaint();
174 }
175
176 void VisuGUI_CutPlanesPane::initFromPrsObject (VISU::CutPlanes_i* thePrs)
177 {
178   setNbPlanes(thePrs->GetNbPlanes());
179   setRotation(thePrs->GetRotateX()*180./PI, thePrs->GetRotateY()*180./PI);
180   setPlanePos(thePrs->GetOrientationType());
181   myPosSpn->setValue(thePrs->GetDisplacement());
182   hasInit = true;
183   // init table
184   myCutPlanes = new VISU::CutPlanes_i(thePrs->GetResult(),false);
185   myCutPlanes->SameAs(thePrs);
186   DrawTable();
187
188   // Draw Preview
189   if (myPreviewCheck->isChecked()) {
190     createPlanes();
191   }
192 }
193
194 void VisuGUI_CutPlanesPane::createPlanes()
195 {
196   if (VISU::GetViewWindow() == NULL) return;
197   if (myCutPlanes == NULL) return;
198   if (myPreviewActor != 0) return;
199
200   vtkAppendPolyData* aPolyData = myCutPlanes->GetCutPlanesPL()->GetAppendPolyData();
201   vtkDataSetMapper* aPlaneMapper = vtkDataSetMapper::New();
202   if (!aPolyData->GetOutput()->GetNumberOfCells()) {
203     onPreviewCheck(false);
204     return;
205   }
206   aPlaneMapper->SetInput(aPolyData->GetOutput());
207   aPlaneMapper->ScalarVisibilityOff();
208
209   myPreviewActor = SALOME_Actor::New();
210   myPreviewActor->PickableOff();
211   myPreviewActor->SetMapper(aPlaneMapper);
212   aPlaneMapper->Delete();
213   VISU::GetViewWindow()->AddActor(myPreviewActor);
214 }
215
216 int VisuGUI_CutPlanesPane::storeToPrsObject (VISU::CutPlanes_i* thePrs)
217 {
218   thePrs->SetOrientation(getOrientaion(), getRotation1()*PI/180., getRotation2()*PI/180.);
219   thePrs->SetNbPlanes(getNbPlanes());
220   thePrs->SetDisplacement(myPosSpn->value());
221   for (int i = 0; i < getNbPlanes(); ++i) {
222     QCheckTableItem* anItem = (QCheckTableItem*)myPosTable->item(i, 1);
223     if (!anItem)
224       break;
225     if (!anItem->isChecked())
226       thePrs->SetPlanePosition(i, myPosTable->text(i, 0).toDouble());
227     else
228       thePrs->SetDefault(i);
229   }
230   return 1;
231 }
232
233 /*!
234   Called when orientation is changed
235 */
236 void VisuGUI_CutPlanesPane::orientationChanged (int Id)
237 {
238   if (Id == 0) { // RBxy->isChecked()
239     LabelRot1->setText(tr("LBL_ROT_X"));
240     LabelRot2->setText(tr("LBL_ROT_Y"));
241   } else if (Id == 1) { // RByz->isChecked()
242     LabelRot1->setText(tr("LBL_ROT_Y"));
243     LabelRot2->setText(tr("LBL_ROT_Z"));
244   } else {
245     LabelRot1->setText(tr("LBL_ROT_Z"));
246     LabelRot2->setText(tr("LBL_ROT_X"));
247   }
248   DrawTable();
249 }
250
251 /*!
252   Sets planes orientation and position
253 */
254 void VisuGUI_CutPlanesPane::setPlanePos (const VISU::CutPlanes::Orientation orient)
255 {
256   if (orient == VISU::CutPlanes::XY)           // xy
257     {
258       RBxy->setChecked( true );
259       orientationChanged( 0 );
260     }
261   else if (orient == VISU::CutPlanes::YZ)       // yz
262     {
263       RByz->setChecked( true );
264       orientationChanged( 1 );
265     }
266   else                         // zx
267    {
268      RBzx->setChecked( true );
269      orientationChanged( 2 );
270    }
271
272 }
273
274 /*!
275   Gets planes orientation
276 */
277 VISU::CutPlanes::Orientation VisuGUI_CutPlanesPane::getOrientaion()
278 {
279   VISU::CutPlanes::Orientation orient;
280   if ( RBxy->isChecked() )     // xy
281     orient = VISU::CutPlanes::XY;
282   else if ( RByz->isChecked() )     // yz
283     orient = VISU::CutPlanes::YZ;
284   else if ( RBzx->isChecked() )     // zx
285     orient = VISU::CutPlanes::ZX;
286   return orient;
287 }
288
289 /*!
290   Sets planes rotation
291 */
292 void VisuGUI_CutPlanesPane::setRotation (const double r1, const double r2)
293 {
294   Rot1->setValue( r1 );
295   Rot2->setValue( r2 );
296 }
297
298 /*!
299   Draw the table of planes positions
300 */
301 void VisuGUI_CutPlanesPane::DrawTable()
302 {
303   if (myCutPlanes == NULL) return;
304   if (!hasInit) return;
305
306   int aNbRows = myPosTable->numRows();
307   int aNbPlanes = getNbPlanes();
308
309   myCutPlanes->SetOrientation(getOrientaion(),getRotation1()*PI/180.,getRotation2()*PI/180.);
310   myCutPlanes->SetNbPlanes(aNbPlanes);
311   myCutPlanes->SetDisplacement(myPosSpn->value());
312   if (aNbRows>0)
313     for (int i = 0; i < aNbRows; ++i) {
314       QCheckTableItem* aItem = (QCheckTableItem*)myPosTable->item( i, 1 );
315       if (aItem == 0) break;
316       if (!aItem->isChecked())
317         myCutPlanes->SetPlanePosition(i, myPosTable->text(i, 0).toDouble());
318     }
319
320   if (aNbPlanes > aNbRows)
321     myPosTable->insertRows(aNbRows, aNbPlanes - aNbRows );
322   else if (aNbPlanes < aNbRows)
323     myPosTable->setNumRows(aNbPlanes);
324
325   int aMin = (aNbRows < aNbPlanes)? aNbRows : aNbPlanes;
326   for (int i = 0; i<aMin; i++) {
327     myPosTable->setText(i, 0, QString::number(myCutPlanes->GetPlanePosition(i)));
328     ((QCheckTableItem*)myPosTable->item( i, 1 ))->setChecked(myCutPlanes->IsDefault(i));
329   }
330
331   QHeader *vh = myPosTable->verticalHeader();
332   QString str("Plane# %1");
333   for (int i=aMin; i<aNbPlanes; i++) {
334     VisuGUI_NumEditItem* aEditItem = new VisuGUI_NumEditItem(myPosTable,
335                                                              QTableItem::OnTyping,
336                                                              QString::number(myCutPlanes->GetPlanePosition(i)));
337     aEditItem->setReplaceable(false);
338     aEditItem->setEnabled(!myCutPlanes->IsDefault(i));
339     myPosTable->setItem(i, 0, aEditItem);
340
341     QCheckTableItem* aCheck = new QCheckTableItem(myPosTable, 0);
342     aCheck->setChecked(myCutPlanes->IsDefault(i));
343     aCheck->setReplaceable(false);
344     myPosTable->setItem(i, 1, aCheck);
345
346     vh->setLabel( i, str.arg(i+1) );
347   }
348
349   // Update preview
350   if (myPreviewCheck->isChecked()) {
351     if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) {
352       myCutPlanes->GetPL()->Update();
353       deletePlanes();
354       createPlanes();
355       vf->Repaint();
356     }
357   }
358 }
359
360 void VisuGUI_CutPlanesPane::setDefault (int all)
361 {
362   myPosTable->setCurrentCell(-1, 1);
363   myPosTable->clearSelection();
364   if (all == 0) return;
365   if (all == 1)
366     for (int i = 0; i < getNbPlanes(); ++i)
367       ((QCheckTableItem*)myPosTable->item( i, 1 ))->setChecked(true);
368
369   for (int i = 0; i < getNbPlanes(); ++i) {
370     if ( ((QCheckTableItem*)myPosTable->item( i, 1 ))->isChecked() ) {
371       myCutPlanes->SetDefault(i);
372       myPosTable->setText( i, 0, QString::number(myCutPlanes->GetPlanePosition(i)));
373       myPosTable->item( i, 0 )->setEnabled(false);
374     } else
375       myPosTable->item( i, 0 )->setEnabled(true);
376   }
377 }
378
379 void VisuGUI_CutPlanesPane::onValueChanged (int theRow, int theCol)
380 {
381   if (theCol == 0) {
382     QString aTxt = myPosTable->text(theRow, 0);
383     bool isChanged = !aTxt.isEmpty();
384     ((QCheckTableItem*)myPosTable->item(theRow, 1))->setChecked(!isChanged);
385
386     if (myPreviewCheck->isChecked()) {
387       //Update Preview
388       if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) {
389         myCutPlanes->SetPlanePosition( theRow, aTxt.toDouble());
390         myCutPlanes->GetPL()->Update();
391         deletePlanes();
392         createPlanes();
393         vf->Repaint();
394       }
395     }
396   } else {
397     bool isDefault = ((QCheckTableItem*)myPosTable->item(theRow, theCol))->isChecked();
398     if (isDefault) {
399       myCutPlanes->SetDefault(theRow);
400       myPosTable->setText(theRow, 0, QString::number(myCutPlanes->GetPlanePosition(theRow)));
401
402       if (myPreviewCheck->isChecked()) {
403         if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) {
404           //Update Preview
405           myCutPlanes->GetPL()->Update();
406           deletePlanes();
407           createPlanes();
408           vf->Repaint();
409         }
410       }
411     }
412     myPosTable->item(theRow, 0)->setEnabled(!isDefault);
413   }
414 }
415
416 void VisuGUI_CutPlanesPane::deletePlanes()
417 {
418   if (myPreviewActor == 0) return;
419   if (SVTK_ViewWindow* vf = VISU::GetViewWindow())
420     vf->RemoveActor(myPreviewActor);
421   myPreviewActor->Delete();
422   myPreviewActor = 0;
423 }
424
425 void VisuGUI_CutPlanesPane::onRotation (double theValue)
426 {
427   if (myCutPlanes == NULL) return;
428   if (myPreviewCheck->isChecked()) {
429     if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) {
430       myCutPlanes->SetOrientation(getOrientaion(),getRotation1()*PI/180.,getRotation2()*PI/180.);
431       myCutPlanes->GetPL()->Update();
432       deletePlanes();
433       createPlanes();
434       vf->Repaint();
435     }
436   }
437 }
438
439 void VisuGUI_CutPlanesPane::onPreviewCheck (bool thePreview)
440 {
441   if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) {
442     if (thePreview) {
443       storeToPrsObject(myCutPlanes);
444       myCutPlanes->GetPL()->Update();
445       createPlanes();
446       vf->onFitAll();
447     } else {
448       deletePlanes();
449       vf->Repaint();
450     }
451   }
452 }
453
454 //###################################################################
455
456
457
458 /*!
459   Constructor
460 */
461 VisuGUI_CutPlanesDlg::VisuGUI_CutPlanesDlg (QWidget* parent, bool theIsCreation, bool theIsModal)
462      : QDialog(parent, "VisuGUI_CutPlanesDlg", theIsModal, WStyle_Customize |
463                WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
464        //,myMgr(VisuGUI::application()->activeViewManager())
465 {
466   //myStudyWnd = myMgr->getActiveView();
467   if (!theIsModal) {
468     setWFlags(getWFlags() | WDestructiveClose);
469   }
470   setCaption("Cut Planes Definition");
471   setSizeGripEnabled(true);
472   myIsCreation = theIsCreation;
473
474   QVBoxLayout* TopLayout = new QVBoxLayout (this);
475   TopLayout->setSpacing(6);
476   TopLayout->setMargin(11);
477
478   // Tab pane
479   QTabWidget* aTabBox = new QTabWidget(this);
480   myCutPane = new VisuGUI_CutPlanesPane(this/*, myMgr*/);
481   aTabBox->addTab(myCutPane, "Cut Planes");
482   myScalarPane = new VisuGUI_ScalarBarPane(this, false);
483   myScalarPane->setMargin(5);
484   aTabBox->addTab(myScalarPane, "Scalar Bar");
485
486   TopLayout->addWidget(aTabBox);
487
488   QGroupBox* GroupButtons = new QGroupBox(this, "GroupButtons");
489   GroupButtons->setGeometry(QRect(10, 10, 281, 48));
490   GroupButtons->setTitle("");
491   GroupButtons->setColumnLayout(0, Qt::Vertical);
492   GroupButtons->layout()->setSpacing(0);
493   GroupButtons->layout()->setMargin(0);
494   QGridLayout* GroupButtonsLayout = new QGridLayout(GroupButtons->layout());
495   GroupButtonsLayout->setAlignment(Qt::AlignTop);
496   GroupButtonsLayout->setSpacing(6);
497   GroupButtonsLayout->setMargin(11);
498
499   QPushButton* buttonOk = new QPushButton(tr("&OK"), GroupButtons, "buttonOk");
500   buttonOk->setAutoDefault(TRUE);
501   buttonOk->setDefault(TRUE);
502   GroupButtonsLayout->addWidget(buttonOk, 0, 0);
503   GroupButtonsLayout->addItem(new QSpacerItem(5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 1);
504
505   QPushButton* buttonCancel = new QPushButton(tr("&Cancel"), GroupButtons, "buttonCancel");
506   buttonCancel->setAutoDefault(TRUE);
507   GroupButtonsLayout->addWidget(buttonCancel, 0, 2);
508
509   TopLayout->addWidget(GroupButtons);
510
511   connect(buttonOk,     SIGNAL(clicked()), this, SLOT(accept()));
512   connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
513   //connect(myMgr, SIGNAL(closeAllViews()), this, SLOT(reject()));
514   //connect(VisuGUI::application()->desktop(),
515   //        SIGNAL(windowActivated(SUIT_ViewWindow*)),
516   //        this, SLOT(onWindowActivated(SUIT_ViewWindow*)));
517 }
518
519 void VisuGUI_CutPlanesDlg::accept() {
520   if (myScalarPane->check())
521     QDialog::accept();
522 /*jfa tmp:
523   if (myScalarPane->check()) {
524     if (!isModal()) {
525       if (storeToPrsObject(myPrs)) {
526         if (myIsCreation) {
527           if (VISU::GetViewWindow() != NULL) {
528             try {
529             visuGUI->CreateActor(myPrs);
530             }
531             catch (...) {
532               reject();
533               return;
534             }
535             VISU::GetViewWindow()->onFitAll();
536           }
537         } else {
538           visuGUI->RecreateActor(myPrs);
539           if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) {
540             if (vf->getRenderer()->GetActors()->GetNumberOfItems() > 0) {
541               vf->getRenderer()->ResetCameraClippingRange();
542               vf->Repaint();
543             }
544           }
545         }
546       } else {
547         if (myIsCreation) {
548           visuGUI->DeletePresentation(myPrs);
549         }
550       }
551     }
552     QDialog::accept();
553   }
554 */
555 }
556
557 void VisuGUI_CutPlanesDlg::reject() {
558   //jfa tmp:if (myIsCreation && (!isModal())) {
559   //jfa tmp:  visuGUI->DeletePresentation(myPrs);
560   //jfa tmp:  VisuGUI::application()->objectBrowser()->updateTree();
561   //jfa tmp:}
562   QDialog::reject();
563 }
564
565 //void VisuGUI_CutPlanesDlg::onWindowActivated (SUIT_ViewWindow* theWnd)
566 //{
567 //  if (theWnd != myStudyWnd)
568 //    reject();
569 //}
570
571 //###################################################################
572
573 QWidget* VisuGUI_NumEditItem::createEditor() const
574 {
575   QLineEdit *editline = new QLineEdit(text(), table()->viewport());
576   QDoubleValidator *dvalidator = new QDoubleValidator(table()->viewport());
577   dvalidator->setDecimals(32);
578   editline->setValidator(dvalidator);
579   return editline;
580 }