Salome HOME
Fix pb with labels of rotation spin boxes (bad update after switch from IJK pane...
[modules/visu.git] / src / VISUGUI / VisuGUI_Selection.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_Selection.cxx
25 //  Author : Laurent CORNABE & Hubert ROLLAND
26 //  Module : VISU
27 //  $Header$
28
29 #include "VisuGUI_Selection.h"
30
31 #include "VisuGUI.h"
32 #include "VisuGUI_Tools.h"
33
34 #include "VISU_Actor.h"
35 #include "VISU_PrsObject_i.hh"
36 #include "VISU_Prs3d_i.hh"
37 #include "VISU_PipeLine.hxx"
38
39 #include "SalomeApp_Study.h"
40 #include "SalomeApp_Application.h"
41 #include "SalomeApp_SelectionMgr.h"
42 #include "SalomeApp_VTKSelector.h"
43
44 #include "SUIT_MessageBox.h"
45 #include "SUIT_ViewWindow.h"
46 #include "SUIT_Session.h"
47
48 #include "SALOME_ListIO.hxx"
49 #include "SALOME_ListIteratorOfListIO.hxx"
50
51 #include "SVTK_ViewWindow.h"
52 #include "SVTK_ViewModel.h"
53 #include "SVTK_Selector.h"
54
55 #include "utilities.h"
56
57 // OCCT Includes
58 #include <TColStd_IndexedMapOfInteger.hxx>
59 #include <TColStd_MapOfInteger.hxx>
60
61 // QT Includes
62 #include <qstring.h>
63 #include <qlabel.h>
64 #include <qspinbox.h>
65 #include <qlistbox.h>
66 #include <qlayout.h>
67 #include <qhbuttongroup.h>
68 #include <qradiobutton.h>
69 #include <qvalidator.h>
70 #include <qpushbutton.h>
71 #include <qwidgetstack.h>
72 #include <qvbox.h>
73 #include <qgroupbox.h>
74 #include <qlineedit.h>
75 #include <qvalidator.h>
76 #include <qtable.h>
77 #include <qlistview.h>
78
79 // VTK Includes
80 #include <vtkDataSetMapper.h>
81 #include <vtkDataSet.h>
82 #include <vtkPointData.h>
83 #include <vtkCellData.h>
84 #include <vtkCell.h>
85
86 // STL Includes
87 #include <map>
88
89 using namespace std;
90
91 static VisuGUI_SelectionDlg* mySelectionDlg = NULL;
92
93 VisuGUI_SelectionDlg::VisuGUI_SelectionDlg (QWidget* parent)
94      : QDialog(parent, 0, false, WStyle_Customize | WStyle_NormalBorder |
95                WStyle_Title | WStyle_SysMenu | WDestructiveClose),
96        mySelectionMgr(NULL)
97 {
98   if (mySelectionDlg)
99     mySelectionDlg->close(true);
100
101   setCaption( "Data on elements" );
102   setSizeGripEnabled( TRUE );
103
104   QGridLayout* TopLayout = new QGridLayout(this);
105   TopLayout->setSpacing(6);
106   TopLayout->setMargin(11);
107   TopLayout->setRowStretch(0, 0);
108   TopLayout->setRowStretch(1, 0);
109   TopLayout->setRowStretch(2, 1);
110   TopLayout->setRowStretch(3, 0);
111
112   QHButtonGroup* aTypeBox = new QHButtonGroup("Selection", this);
113
114   QRadioButton* aPointBtn = new QRadioButton("Point", aTypeBox);
115   QRadioButton* aCellBtn = new QRadioButton("Cell", aTypeBox);
116   QRadioButton* aActorBtn = new QRadioButton("Actor", aTypeBox);
117   aPointBtn->setChecked(true);
118
119   connect(aTypeBox, SIGNAL(clicked(int)), this, SLOT(onSelectionChange(int)));
120
121   TopLayout->addWidget(aTypeBox, 0, 0);
122
123   QWidget* aNamePane = new QWidget(this);
124   QGridLayout* aNameLay = new QGridLayout(aNamePane);
125
126   QLabel* aMeshLbl = new QLabel("Mesh name: ", aNamePane);
127   myMeshName = new QLabel(aNamePane);
128
129   QLabel* aFieldLbl = new QLabel("Field name: ", aNamePane);
130   myFieldName = new QLabel(aNamePane);
131
132   aNameLay->addWidget(aMeshLbl, 0, 0);
133   aNameLay->addWidget(myMeshName, 0, 1);
134   aNameLay->addWidget(aFieldLbl, 1, 0);
135   aNameLay->addWidget(myFieldName, 1, 1);
136
137   TopLayout->addWidget(aNamePane, 1, 0);
138
139   myWidgetStack = new QWidgetStack(this);
140
141   // Create Points pane
142   myPointsPane = new QVBox(myWidgetStack);
143   myPointsPane->layout()->setSpacing(6);
144
145   QGroupBox* aDataGrp = new QGroupBox(2, Qt::Horizontal, "Data of Point", myPointsPane);
146   aDataGrp->layout()->setSpacing(6);
147
148   QLabel* aIDLbl = new QLabel("ID:", aDataGrp);
149   myIDValLbl = new QLineEdit("", aDataGrp);
150   QIntValidator* aIntValidator = new QIntValidator(myIDValLbl);
151   aIntValidator->setBottom(0);
152   myIDValLbl->setValidator(aIntValidator);
153   connect(myIDValLbl, SIGNAL(textChanged(const QString&)), this, SLOT(onPointIdEdit(const QString&)));
154
155   QLabel* aValueLbl = new QLabel("Scalar Value:", aDataGrp);
156   myScalarValLbl = new QLabel("", aDataGrp);
157   QLabel* aVectorLbl = new QLabel("Vector Value:", aDataGrp);
158   myVectorValLbl = new QLabel("", aDataGrp);
159   myVectorValLbl->setMinimumWidth(150);
160
161   QGroupBox* aCoordGrp = new QGroupBox(2, Qt::Horizontal, "Coordinates", myPointsPane);
162   aCoordGrp->layout()->setSpacing(6);
163   QLabel* aXLbl = new QLabel("X:", aCoordGrp);
164   myXValLbl = new QLabel("", aCoordGrp);
165   QLabel* aYLbl = new QLabel("Y:", aCoordGrp);
166   myYValLbl = new QLabel("", aCoordGrp);
167   QLabel* aZLbl = new QLabel("Z:",aCoordGrp );
168   myZValLbl = new QLabel("", aCoordGrp);
169
170
171   myWidgetStack->addWidget(myPointsPane, 0);
172
173   // Create Cells pane
174   myCellsPane = new QWidget(myWidgetStack);
175   QGridLayout* aCellLayout = new QGridLayout(myCellsPane);
176   aCellLayout->setSpacing(6);
177   aCellLayout->setRowStretch(0, 0);
178   aCellLayout->setRowStretch(1, 1);
179
180   QGroupBox* aCellGrp = new QGroupBox(2, Qt::Horizontal, "Data of Cell", myCellsPane);
181
182   QLabel* aCellIDLbl = new QLabel("ID:", aCellGrp);
183   myCellIDValLbl = new QLineEdit("", aCellGrp);
184   myCellIDValLbl->setValidator(aIntValidator);
185   connect(myCellIDValLbl, SIGNAL(textChanged(const QString&)), this, SLOT(onCellIdEdit(const QString&)));
186
187   QLabel* aCellValueLbl = new QLabel("Scalar Value:", aCellGrp);
188   myCellScalarValLbl = new QLabel("", aCellGrp);
189   QLabel* aCellVectorLbl = new QLabel("Vector Value:", aCellGrp);
190   myCellVectorValLbl = new QLabel("", aCellGrp);
191
192   aCellLayout->addWidget(aCellGrp, 0, 0);
193
194   myListPoints = new QTable(myCellsPane);
195   myListPoints->setReadOnly(true);
196   myListPoints->setNumCols(6);
197   myListPoints->setNumRows(0);
198   myListPoints->setColumnWidth(0, 40);
199   myListPoints->setColumnWidth(1, 40);
200   myListPoints->setColumnWidth(2, 40);
201   myListPoints->setColumnWidth(3, 40);
202   myListPoints->setSelectionMode(QTable::NoSelection);
203   QHeader* aHeader = myListPoints->horizontalHeader();
204   aHeader->setLabel( 0, "ID" );
205   aHeader->setLabel( 1, "X" );
206   aHeader->setLabel( 2, "Y" );
207   aHeader->setLabel( 3, "Z" );
208   aHeader->setLabel( 4, "Scalar" );
209   aHeader->setLabel( 5, "Vector" );
210
211   aCellLayout->addWidget(myListPoints, 1, 0);
212
213   myWidgetStack->addWidget(myCellsPane, 1);
214
215   // Actor Pane
216   myActorsPane = new QVBox(myWidgetStack);
217   myActorsPane->layout()->setSpacing(6);
218
219   QGroupBox* aPosGrp = new QGroupBox(2, Qt::Horizontal, "Position", myActorsPane);
220   aPosGrp->layout()->setSpacing(6);
221   QLabel* aXPosLbl = new QLabel("X:", aPosGrp);
222   myXPosLbl = new QLabel("0", aPosGrp);
223   QLabel* aYPosLbl = new QLabel("Y:", aPosGrp);
224   myYPosLbl = new QLabel("0", aPosGrp);
225   QLabel* aZPosLbl = new QLabel("Z:", aPosGrp);
226   myZPosLbl = new QLabel("0", aPosGrp);
227
228   QGroupBox* aSizeGrp = new QGroupBox(2, Qt::Horizontal, "Size", myActorsPane);
229   aSizeGrp->layout()->setSpacing(6);
230   QLabel* aXSizeLbl = new QLabel("dX:", aSizeGrp);
231   myDXLbl = new QLabel("0", aSizeGrp);
232   QLabel* aYSizeLbl = new QLabel("dY:", aSizeGrp);
233   myDYLbl = new QLabel("0", aSizeGrp);
234   QLabel* aZSizeLbl = new QLabel("dZ:",aSizeGrp );
235   myDZLbl = new QLabel("0", aSizeGrp);
236
237   myWidgetStack->addWidget(myActorsPane, 2);
238
239
240   TopLayout->addWidget(myWidgetStack, 2, 0);
241
242   // Create buttons group
243   QHBox* aBtnBox = new QHBox(this);
244   QHBoxLayout* aBtnLayout = (QHBoxLayout*)aBtnBox->layout();
245   aBtnLayout->addStretch();
246
247   QPushButton* aCloseBtn = new QPushButton(tr("BUT_CLOSE"), aBtnBox);
248   connect(aCloseBtn, SIGNAL(clicked()), this, SLOT(close()));
249
250   TopLayout->addWidget(aBtnBox, 3, 0);
251
252   SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>
253     (SUIT_Session::session()->activeApplication());
254   mySelectionMgr = anApp->selectionMgr();
255   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(onSelectionEvent()));
256
257   //connect(visuGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(close()));
258
259   myFl = false;
260
261   //onSelectionChange(0);
262   SVTK_ViewWindow* aSVTKVW = VISU::GetViewWindow();
263   // Activate Points pane
264   myWidgetStack->raiseWidget(myPointsPane);
265   aSVTKVW->SetSelectionMode(NodeSelection);
266   //onPointIdEdit(myIDValLbl->text());
267   onSelectionEvent();
268
269   mySelectionDlg = this;
270 }
271
272 VisuGUI_SelectionDlg::~VisuGUI_SelectionDlg()
273 {
274 }
275
276 void VisuGUI_SelectionDlg::onSelectionChange (int theId)
277 {
278   SVTK_ViewWindow* aSVTKVW = VISU::GetViewWindow();
279
280   switch (theId) {
281   case 0: // Points
282     myWidgetStack->raiseWidget(myPointsPane);
283     aSVTKVW->SetSelectionMode(NodeSelection);
284     onPointIdEdit(myIDValLbl->text());
285     break;
286   case 1: // Cells
287     myWidgetStack->raiseWidget(myCellsPane);
288     aSVTKVW->SetSelectionMode(CellSelection);
289     onCellIdEdit(myCellIDValLbl->text());
290     break;
291   case 2: // Actor
292     myWidgetStack->raiseWidget(myActorsPane);
293     aSVTKVW->SetSelectionMode(ActorSelection);
294     onSelectionEvent();
295   }
296 }
297
298
299 void VisuGUI_SelectionDlg::closeEvent (QCloseEvent* theEvent)
300 {
301   SVTK_ViewWindow* aSVTKVW = VISU::GetViewWindow();
302
303   mySelectionDlg = NULL;
304   aSVTKVW->SetSelectionMode(ActorSelection);
305   disconnect(mySelectionMgr,0,0,0);
306   QDialog::closeEvent(theEvent);
307 }
308
309 template<class TData> QString getValue(TData* theData, int theId){
310   if (vtkDataArray *aScalar = theData->GetScalars()){
311     float aVal = aScalar->GetTuple1(theId);
312     return QString::number(aVal);
313   } else {
314     return QString("No data");
315   }
316 }
317
318 template<class TData> QString getVector(TData* theData, int theId){
319   if (vtkDataArray *aVector = theData->GetVectors()) {
320     float *aVal = aVector->GetTuple3(theId);
321     return QString("%1; %2; %3").arg(aVal[0]).arg(aVal[1]).arg(aVal[2]);
322   } else {
323     return QString("No data");
324   }
325 }
326
327 #define ABS(a) (a>=0)?a:-a
328
329 void VisuGUI_SelectionDlg::onSelectionEvent() {
330   if (myFl) return;
331   myFl = true;
332   int aType = myWidgetStack->id(myWidgetStack->visibleWidget());
333
334   SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>
335     (SUIT_Session::session()->activeApplication());
336
337   SVTK_ViewWindow* aSVTKVW = VISU::GetViewWindow();
338   SVTK_Selector* aSelector = aSVTKVW->GetSelector();
339
340   VISU::Prs3d_i* aPrs3d = NULL;
341   _PTR(SObject) aSObject;
342   Handle(SALOME_InteractiveObject) anIO;
343
344   SALOME_ListIO aListIO;
345   mySelectionMgr->selectedObjects(aListIO, SVTK_Viewer::Type());
346
347   if (aListIO.Extent() == 1) {
348     anIO = aListIO.First();
349
350     if (anIO->hasEntry()) {
351       SalomeApp_Study* theStudy = dynamic_cast<SalomeApp_Study*>(anApp->activeStudy());
352       _PTR(Study) aStudy = theStudy->studyDS();
353       aSObject = aStudy->FindObjectID(anIO->getEntry());
354
355       if (aSObject) {
356         CORBA::Object_var anObject = VISU::ClientSObjectToObject(aSObject);
357
358         if (!CORBA::is_nil(anObject)) {
359           PortableServer::ServantBase_var aServant = VISU::GetServant(anObject);
360
361           if (aServant.in()) {
362             aPrs3d = dynamic_cast<VISU::Prs3d_i*>(aServant.in());
363           }
364         }
365       }
366     }
367   }
368
369   if (aPrs3d) {
370     VISU::Storable::TRestoringMap aMap;
371     if (aSObject) {
372       _PTR(GenericAttribute) anAttr;
373       if (aSObject->FindAttribute(anAttr, "AttributeComment")) {
374         _PTR(AttributeComment) aComment (anAttr);
375         std::string aString = aComment->Value();
376         QString strIn( aString.c_str() );
377         VISU::Storable::StrToMap(strIn, aMap);
378       }
379     }
380
381     QString aMeshName("NULL"), aFieldName("NULL");
382     if (!aMap.empty()) {
383       aMeshName  = VISU::Storable::FindValue(aMap, "myMeshName");
384       aFieldName = VISU::Storable::FindValue(aMap, "myFieldName");
385     }
386
387     myMeshName ->setText((aMeshName  == "NULL") ? QString("No name") : aMeshName);
388     myFieldName->setText((aFieldName == "NULL") ? QString("No name") : aFieldName);
389
390     VISU_Actor* anVISUActor =
391       VISU::FindActor(aSVTKVW, aSObject->GetID().c_str());
392     if (anVISUActor) {
393       float aCoord[6];
394       anVISUActor->GetBounds(aCoord);
395       myXPosLbl->setText(QString::number( aCoord[0] ));
396       myYPosLbl->setText(QString::number( aCoord[2] ));
397       myZPosLbl->setText(QString::number( aCoord[4] ));
398
399       myDXLbl->setText(QString::number( ABS(aCoord[1]-aCoord[0]) ));
400       myDYLbl->setText(QString::number( ABS(aCoord[3]-aCoord[2]) ));
401       myDZLbl->setText(QString::number( ABS(aCoord[5]-aCoord[4]) ));
402
403       TColStd_IndexedMapOfInteger aMapIndex;
404       typedef map<int,float*> PointsMap;
405       PointsMap aPointsMap;
406
407       aSelector->GetIndex(anIO, aMapIndex);
408
409       vtkDataSet* aDataSet = anVISUActor->GetInput();
410       vtkPointData* aPntData = aDataSet->GetPointData();
411
412       for (int ind = 1; ind <= aMapIndex.Extent(); ind++) {
413         int aID = aMapIndex(ind);
414
415         switch (aType) {
416         case 0:
417           {
418             float aCoord[3];
419             aDataSet->GetPoint(aID, aCoord);
420             myXValLbl->setText( QString::number( aCoord[0] ) );
421             myYValLbl->setText( QString::number( aCoord[1] ) );
422             myZValLbl->setText( QString::number( aCoord[2] ) );
423             myIDValLbl->setText( QString::number(aID) );
424             myScalarValLbl->setText(getValue(aPntData, aID));
425             myVectorValLbl->setText(getVector(aPntData, aID));
426           }
427           break;
428         case 1:
429           {
430             vtkCellData* aData = aDataSet->GetCellData();
431             vtkCell* aCell = aDataSet->GetCell(aID);
432             if (aCell != NULL) {
433               int aNbOfPoints = aCell->GetNumberOfPoints();
434               if (aNbOfPoints <=1 ) { // Cell is point
435                 clearFields();
436               } else {
437                 myCellIDValLbl->setText( QString::number(aID) );
438                 myCellScalarValLbl->setText(getValue(aData, aID));
439                 myCellVectorValLbl->setText(getVector(aData, aID));
440
441                 float* aCoord;
442                 vtkIdList *aPointList = aCell->GetPointIds();
443                 QListViewItem* anItem = NULL;
444
445                 for (int i = 0; i < aNbOfPoints; i++) {
446                   int idCurrent = aPointList->GetId(i);
447                   aCoord = aDataSet->GetPoint(idCurrent);
448                   aPointsMap.insert(PointsMap::value_type(idCurrent,aCoord));
449                 }
450               }
451             }
452           }
453           break;
454         }
455       }
456
457       myListPoints->setNumRows(aPointsMap.size());
458       PointsMap::const_iterator It = aPointsMap.begin();
459       for (int i = 0; It != aPointsMap.end() && i < myListPoints->numRows(); It++, i++) {
460         myListPoints->verticalHeader()->setLabel(i, QString::number( i ));
461         int id = It->first;
462         myListPoints->setText(i, 0, QString::number( id ));
463         float* aCoord = It->second;
464         myListPoints->setText(i, 1, QString::number( aCoord[0] ));
465         myListPoints->setText(i, 2, QString::number( aCoord[1] ));
466         myListPoints->setText(i, 3, QString::number( aCoord[2] ));
467         myListPoints->setText(i, 4, getValue(aPntData, id));
468         myListPoints->setText(i, 5, getVector(aPntData, id));
469       }
470     }
471   } else {
472     clearFields();
473   }
474   myFl = false;
475 }
476 #undef ABS
477
478
479 void VisuGUI_SelectionDlg::clearFields() {
480   int aType = myWidgetStack->id(myWidgetStack->visibleWidget());
481   switch (aType) {
482   case 0:
483     myXValLbl->setText( "" );
484     myYValLbl->setText( "" );
485     myZValLbl->setText( "" );
486     myIDValLbl->setText( "" );
487     myScalarValLbl->setText("");
488     myVectorValLbl->setText("");
489     break;
490   case 1:
491     myCellIDValLbl->setText( "" );
492     myCellScalarValLbl->setText("");
493     myCellVectorValLbl->setText("");
494     myListPoints->setNumRows(0);
495     break;
496   case 2:
497     myXPosLbl->setText("");
498     myYPosLbl->setText("");
499     myZPosLbl->setText("");
500     myDXLbl->setText("");
501     myDYLbl->setText("");
502     myDZLbl->setText("");
503   }
504 }
505
506 typedef  vtkIdType (vtkDataSet::* TDataSetMethod)();
507
508 bool onIdEdit (const QString& theText,
509                TDataSetMethod theMethod,
510                bool theIsCell,
511                SalomeApp_SelectionMgr* theSelectionMgr,
512                QLabel* theMeshName,
513                QString theValue,
514                QLabel* theFieldName)
515 {
516   SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>
517     (SUIT_Session::session()->activeApplication());
518   SVTK_ViewWindow* aSVTKVW = VISU::GetViewWindow();
519   SVTK_Selector* aSelector = aSVTKVW->GetSelector();
520
521   VISU::Prs3d_i* aPrs3d = NULL;
522   Handle(SALOME_InteractiveObject) anIO;
523
524   SALOME_ListIO aListIO;
525   theSelectionMgr->selectedObjects(aListIO, SVTK_Viewer::Type());
526
527   if (aListIO.Extent() == 1) {
528     anIO = aListIO.First();
529
530     if (anIO->hasEntry()) {
531       SalomeApp_Study* theStudy = dynamic_cast<SalomeApp_Study*>(anApp->activeStudy());
532       _PTR(Study) aStudy = theStudy->studyDS();
533       _PTR(SObject) aSObject = aStudy->FindObjectID(anIO->getEntry());
534
535       if (aSObject) {
536         CORBA::Object_var anObject = VISU::ClientSObjectToObject(aSObject);
537
538         if (!CORBA::is_nil(anObject)) {
539           PortableServer::ServantBase_var aServant = VISU::GetServant(anObject);
540
541           if (aServant.in()) {
542             aPrs3d = dynamic_cast<VISU::Prs3d_i*>(aServant.in());
543           }
544         }
545       }
546     }
547   }
548
549   if (aPrs3d) {
550     int anId = theText.toInt();
551     vtkDataSet* aDataSet = aPrs3d->GetPL()->GetMapper()->GetInput();
552     int aMaxId = (aDataSet->*theMethod)();
553     if (anId < 0) anId = 0;
554     if (anId >= aMaxId) anId = aMaxId - 1;
555
556     TColStd_MapOfInteger newIndices;
557     newIndices.Add(anId);
558     aSelector->AddOrRemoveIndex(anIO, newIndices, false);
559     aSVTKVW->highlight(anIO, true, true);
560
561     return true;
562
563   } else {
564     theMeshName->setText(theValue);
565     theFieldName->setText("");
566   }
567   return false;
568 }
569
570 void VisuGUI_SelectionDlg::onPointIdEdit (const QString& theText)
571 {
572   if (myFl) return;
573   TDataSetMethod aMethod = &vtkDataSet::GetNumberOfPoints;
574   bool anIsSelected = onIdEdit(theText,aMethod,false,mySelectionMgr,
575                                myMeshName,tr("WRN_NO_AVAILABLE_DATA"),
576                                myFieldName);
577   if (!anIsSelected)
578     clearFields();
579 }
580
581 void VisuGUI_SelectionDlg::onCellIdEdit (const QString& theText)
582 {
583   if (myFl) return;
584   TDataSetMethod aMethod = &vtkDataSet::GetNumberOfCells;
585   bool anIsSelected = onIdEdit(theText,aMethod,true,mySelectionMgr,
586                                myMeshName,tr("WRN_NO_AVAILABLE_DATA"),
587                                myFieldName);
588   if (!anIsSelected)
589     clearFields();
590 }