Salome HOME
Join modifications from branch OCC_development_for_3_2_0a2
[modules/visu.git] / src / VISUGUI / VisuGUI_Selection.cxx
index e31fe50820151db2f371f08415d323baae3ccf7c..371d50a50bf7f028d303132b8cf7b5e644beb78e 100644 (file)
@@ -30,6 +30,7 @@
 
 #include "VisuGUI.h"
 #include "VisuGUI_Tools.h"
+#include "VisuGUI_ViewTools.h"
 
 #include "VISU_Actor.h"
 #include "VISU_PrsObject_i.hh"
@@ -38,8 +39,8 @@
 
 #include "SalomeApp_Study.h"
 #include "SalomeApp_Application.h"
-#include "SalomeApp_SelectionMgr.h"
-#include "SalomeApp_VTKSelector.h"
+#include "LightApp_SelectionMgr.h"
+#include "LightApp_VTKSelector.h"
 
 #include "SUIT_MessageBox.h"
 #include "SUIT_ViewWindow.h"
@@ -49,7 +50,6 @@
 #include "SALOME_ListIteratorOfListIO.hxx"
 
 #include "SVTK_ViewWindow.h"
-#include "SVTK_ViewModel.h"
 #include "SVTK_Selector.h"
 
 #include "utilities.h"
@@ -74,7 +74,6 @@
 #include <qlineedit.h>
 #include <qvalidator.h>
 #include <qtable.h>
-#include <qlistview.h>
 
 // VTK Includes
 #include <vtkDataSetMapper.h>
 
 using namespace std;
 
-//extern VisuGUI *visuGUI;
 static VisuGUI_SelectionDlg* mySelectionDlg = NULL;
 
-VisuGUI_SelectionDlg::VisuGUI_SelectionDlg (QWidget* parent)
-     : QDialog(parent, 0, false, WStyle_Customize | WStyle_NormalBorder |
-               WStyle_Title | WStyle_SysMenu | WDestructiveClose),
-       mySelectionMgr(NULL)
+VisuGUI_SelectionDlg::VisuGUI_SelectionDlg (const SalomeApp_Module* theModule):
+  QDialog(VISU::GetDesktop(theModule), 
+         0, 
+         false, 
+         WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose),
+  mySelectionMgr(NULL),
+  myModule(theModule)
 {
-  //MESSAGE("VisuGUI_SelectionDlg::VisuGUI_SelectionDlg()");
   if (mySelectionDlg)
     mySelectionDlg->close(true);
 
   setCaption( "Data on elements" );
-  setSizeGripEnabled( TRUE );
+  setSizeGripEnabled(TRUE);
 
-  QGridLayout* TopLayout = new QGridLayout(this);
+  QGridLayout* TopLayout = new QGridLayout (this);
   TopLayout->setSpacing(6);
   TopLayout->setMargin(11);
   TopLayout->setRowStretch(0, 0);
@@ -111,25 +111,26 @@ VisuGUI_SelectionDlg::VisuGUI_SelectionDlg (QWidget* parent)
   TopLayout->setRowStretch(2, 1);
   TopLayout->setRowStretch(3, 0);
 
-  QHButtonGroup* aTypeBox = new QHButtonGroup("Selection", this);
+  QHButtonGroup* aTypeBox = new QHButtonGroup ("Selection", this);
 
-  QRadioButton* aPointBtn = new QRadioButton("Point", aTypeBox);
-  QRadioButton* aCellBtn = new QRadioButton("Cell", aTypeBox);
-  QRadioButton* aActorBtn = new QRadioButton("Actor", aTypeBox);
+  QRadioButton* aPointBtn =
+  new QRadioButton ("Point", aTypeBox);
+  new QRadioButton ("Cell" , aTypeBox);
+  new QRadioButton ("Actor", aTypeBox);
   aPointBtn->setChecked(true);
 
   connect(aTypeBox, SIGNAL(clicked(int)), this, SLOT(onSelectionChange(int)));
 
   TopLayout->addWidget(aTypeBox, 0, 0);
 
-  QWidget* aNamePane = new QWidget(this);
-  QGridLayout* aNameLay = new QGridLayout(aNamePane);
+  QWidget* aNamePane = new QWidget (this);
+  QGridLayout* aNameLay = new QGridLayout (aNamePane);
 
-  QLabel* aMeshLbl = new QLabel("Mesh name: ", aNamePane);
-  myMeshName = new QLabel(aNamePane);
+  QLabel* aMeshLbl = new QLabel ("Mesh name: ", aNamePane);
+  myMeshName = new QLabel (aNamePane);
 
-  QLabel* aFieldLbl = new QLabel("Field name: ", aNamePane);
-  myFieldName = new QLabel(aNamePane);
+  QLabel* aFieldLbl = new QLabel ("Field name: ", aNamePane);
+  myFieldName = new QLabel (aNamePane);
 
   aNameLay->addWidget(aMeshLbl, 0, 0);
   aNameLay->addWidget(myMeshName, 0, 1);
@@ -138,62 +139,62 @@ VisuGUI_SelectionDlg::VisuGUI_SelectionDlg (QWidget* parent)
 
   TopLayout->addWidget(aNamePane, 1, 0);
 
-  myWidgetStack = new QWidgetStack(this);
+  myWidgetStack = new QWidgetStack (this);
 
   // Create Points pane
-  myPointsPane = new QVBox(myWidgetStack);
+  myPointsPane = new QVBox (myWidgetStack);
   myPointsPane->layout()->setSpacing(6);
 
-  QGroupBox* aDataGrp = new QGroupBox(2, Qt::Horizontal, "Data of Point", myPointsPane);
+  QGroupBox* aDataGrp = new QGroupBox (2, Qt::Horizontal, "Data of Point", myPointsPane);
   aDataGrp->layout()->setSpacing(6);
 
-  QLabel* aIDLbl = new QLabel("ID:", aDataGrp);
-  myIDValLbl = new QLineEdit("", aDataGrp);
-  QIntValidator* aIntValidator = new QIntValidator(myIDValLbl);
+  new QLabel ("ID:", aDataGrp);
+  myIDValLbl = new QLineEdit ("", aDataGrp);
+  QIntValidator* aIntValidator = new QIntValidator (myIDValLbl);
   aIntValidator->setBottom(0);
   myIDValLbl->setValidator(aIntValidator);
   connect(myIDValLbl, SIGNAL(textChanged(const QString&)), this, SLOT(onPointIdEdit(const QString&)));
 
-  QLabel* aValueLbl = new QLabel("Scalar Value:", aDataGrp);
-  myScalarValLbl = new QLabel("", aDataGrp);
-  QLabel* aVectorLbl = new QLabel("Vector Value:", aDataGrp);
-  myVectorValLbl = new QLabel("", aDataGrp);
+  new QLabel ("Scalar Value:", aDataGrp);
+  myScalarValLbl = new QLabel ("", aDataGrp);
+  new QLabel ("Vector Value:", aDataGrp);
+  myVectorValLbl = new QLabel ("", aDataGrp);
   myVectorValLbl->setMinimumWidth(150);
 
-  QGroupBox* aCoordGrp = new QGroupBox(2, Qt::Horizontal, "Coordinates", myPointsPane);
+  QGroupBox* aCoordGrp = new QGroupBox (2, Qt::Horizontal, "Coordinates", myPointsPane);
   aCoordGrp->layout()->setSpacing(6);
-  QLabel* aXLbl = new QLabel("X:", aCoordGrp);
-  myXValLbl = new QLabel("", aCoordGrp);
-  QLabel* aYLbl = new QLabel("Y:", aCoordGrp);
-  myYValLbl = new QLabel("", aCoordGrp);
-  QLabel* aZLbl = new QLabel("Z:",aCoordGrp );
-  myZValLbl = new QLabel("", aCoordGrp);
+  new QLabel ("X:", aCoordGrp);
+  myXValLbl = new QLabel ("", aCoordGrp);
+  new QLabel ("Y:", aCoordGrp);
+  myYValLbl = new QLabel ("", aCoordGrp);
+  new QLabel ("Z:",aCoordGrp );
+  myZValLbl = new QLabel ("", aCoordGrp);
 
 
   myWidgetStack->addWidget(myPointsPane, 0);
 
   // Create Cells pane
-  myCellsPane = new QWidget(myWidgetStack);
-  QGridLayout* aCellLayout = new QGridLayout(myCellsPane);
+  myCellsPane = new QWidget (myWidgetStack);
+  QGridLayout* aCellLayout = new QGridLayout (myCellsPane);
   aCellLayout->setSpacing(6);
   aCellLayout->setRowStretch(0, 0);
   aCellLayout->setRowStretch(1, 1);
 
   QGroupBox* aCellGrp = new QGroupBox(2, Qt::Horizontal, "Data of Cell", myCellsPane);
 
-  QLabel* aCellIDLbl = new QLabel("ID:", aCellGrp);
-  myCellIDValLbl = new QLineEdit("", aCellGrp);
+  new QLabel ("ID:", aCellGrp);
+  myCellIDValLbl = new QLineEdit ("", aCellGrp);
   myCellIDValLbl->setValidator(aIntValidator);
   connect(myCellIDValLbl, SIGNAL(textChanged(const QString&)), this, SLOT(onCellIdEdit(const QString&)));
 
-  QLabel* aCellValueLbl = new QLabel("Scalar Value:", aCellGrp);
-  myCellScalarValLbl = new QLabel("", aCellGrp);
-  QLabel* aCellVectorLbl = new QLabel("Vector Value:", aCellGrp);
-  myCellVectorValLbl = new QLabel("", aCellGrp);
+  new QLabel ("Scalar Value:", aCellGrp);
+  myCellScalarValLbl = new QLabel ("", aCellGrp);
+  new QLabel ("Vector Value:", aCellGrp);
+  myCellVectorValLbl = new QLabel ("", aCellGrp);
 
   aCellLayout->addWidget(aCellGrp, 0, 0);
 
-  myListPoints = new QTable(myCellsPane);
+  myListPoints = new QTable (myCellsPane);
   myListPoints->setReadOnly(true);
   myListPoints->setNumCols(6);
   myListPoints->setNumRows(0);
@@ -215,26 +216,26 @@ VisuGUI_SelectionDlg::VisuGUI_SelectionDlg (QWidget* parent)
   myWidgetStack->addWidget(myCellsPane, 1);
 
   // Actor Pane
-  myActorsPane = new QVBox(myWidgetStack);
+  myActorsPane = new QVBox (myWidgetStack);
   myActorsPane->layout()->setSpacing(6);
 
-  QGroupBox* aPosGrp = new QGroupBox(2, Qt::Horizontal, "Position", myActorsPane);
+  QGroupBox* aPosGrp = new QGroupBox (2, Qt::Horizontal, "Position", myActorsPane);
   aPosGrp->layout()->setSpacing(6);
-  QLabel* aXPosLbl = new QLabel("X:", aPosGrp);
-  myXPosLbl = new QLabel("0", aPosGrp);
-  QLabel* aYPosLbl = new QLabel("Y:", aPosGrp);
-  myYPosLbl = new QLabel("0", aPosGrp);
-  QLabel* aZPosLbl = new QLabel("Z:", aPosGrp);
-  myZPosLbl = new QLabel("0", aPosGrp);
-
-  QGroupBox* aSizeGrp = new QGroupBox(2, Qt::Horizontal, "Size", myActorsPane);
+  new QLabel ("X:", aPosGrp);
+  myXPosLbl = new QLabel ("0", aPosGrp);
+  new QLabel ("Y:", aPosGrp);
+  myYPosLbl = new QLabel ("0", aPosGrp);
+  new QLabel ("Z:", aPosGrp);
+  myZPosLbl = new QLabel ("0", aPosGrp);
+
+  QGroupBox* aSizeGrp = new QGroupBox (2, Qt::Horizontal, "Size", myActorsPane);
   aSizeGrp->layout()->setSpacing(6);
-  QLabel* aXSizeLbl = new QLabel("dX:", aSizeGrp);
-  myDXLbl = new QLabel("0", aSizeGrp);
-  QLabel* aYSizeLbl = new QLabel("dY:", aSizeGrp);
-  myDYLbl = new QLabel("0", aSizeGrp);
-  QLabel* aZSizeLbl = new QLabel("dZ:",aSizeGrp );
-  myDZLbl = new QLabel("0", aSizeGrp);
+  new QLabel ("dX:", aSizeGrp);
+  myDXLbl = new QLabel ("0", aSizeGrp);
+  new QLabel ("dY:", aSizeGrp);
+  myDYLbl = new QLabel ("0", aSizeGrp);
+  new QLabel ("dZ:",aSizeGrp );
+  myDZLbl = new QLabel ("0", aSizeGrp);
 
   myWidgetStack->addWidget(myActorsPane, 2);
 
@@ -242,11 +243,11 @@ VisuGUI_SelectionDlg::VisuGUI_SelectionDlg (QWidget* parent)
   TopLayout->addWidget(myWidgetStack, 2, 0);
 
   // Create buttons group
-  QHBox* aBtnBox = new QHBox(this);
+  QHBox* aBtnBox = new QHBox (this);
   QHBoxLayout* aBtnLayout = (QHBoxLayout*)aBtnBox->layout();
   aBtnLayout->addStretch();
 
-  QPushButton* aCloseBtn = new QPushButton(tr("BUT_CLOSE"), aBtnBox);
+  QPushButton* aCloseBtn = new QPushButton (tr("BUT_CLOSE"), aBtnBox);
   connect(aCloseBtn, SIGNAL(clicked()), this, SLOT(close()));
 
   TopLayout->addWidget(aBtnBox, 3, 0);
@@ -260,12 +261,10 @@ VisuGUI_SelectionDlg::VisuGUI_SelectionDlg (QWidget* parent)
 
   myFl = false;
 
-  //onSelectionChange(0);
-  SVTK_ViewWindow* aSVTKVW = VISU::GetViewWindow();
   // Activate Points pane
   myWidgetStack->raiseWidget(myPointsPane);
-  aSVTKVW->SetSelectionMode(NodeSelection);
-  //onPointIdEdit(myIDValLbl->text());
+  if (SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myModule))
+    aViewWindow->SetSelectionMode(NodeSelection);
   onSelectionEvent();
 
   mySelectionDlg = this;
@@ -273,31 +272,27 @@ VisuGUI_SelectionDlg::VisuGUI_SelectionDlg (QWidget* parent)
 
 VisuGUI_SelectionDlg::~VisuGUI_SelectionDlg()
 {
-  //MESSAGE("VisuGUI_SelectionDlg::~VisuGUI_SelectionDlg()");
 }
 
 void VisuGUI_SelectionDlg::onSelectionChange (int theId)
 {
-  //MESSAGE("VisuGUI_SelectionDlg::onSelectionChange()");
-  SVTK_ViewWindow* aSVTKVW = VISU::GetViewWindow();
+  SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myModule);
+  if (!aViewWindow) return;
 
   switch (theId) {
   case 0: // Points
     myWidgetStack->raiseWidget(myPointsPane);
-    //mySelectionMgr->setSelectionModes(NodeSelection);
-    aSVTKVW->SetSelectionMode(NodeSelection);
+    aViewWindow->SetSelectionMode(NodeSelection);
     onPointIdEdit(myIDValLbl->text());
     break;
   case 1: // Cells
     myWidgetStack->raiseWidget(myCellsPane);
-    //mySelectionMgr->setSelectionModes(CellSelection);
-    aSVTKVW->SetSelectionMode(CellSelection);
+    aViewWindow->SetSelectionMode(CellSelection);
     onCellIdEdit(myCellIDValLbl->text());
     break;
   case 2: // Actor
     myWidgetStack->raiseWidget(myActorsPane);
-    //mySelectionMgr->setSelectionModes(ActorSelection);
-    aSVTKVW->SetSelectionMode(ActorSelection);
+    aViewWindow->SetSelectionMode(ActorSelection);
     onSelectionEvent();
   }
 }
@@ -305,13 +300,18 @@ void VisuGUI_SelectionDlg::onSelectionChange (int theId)
 
 void VisuGUI_SelectionDlg::closeEvent (QCloseEvent* theEvent)
 {
-  //MESSAGE("VisuGUI_SelectionDlg::closeEvent()");
-  SVTK_ViewWindow* aSVTKVW = VISU::GetViewWindow();
-
-  mySelectionDlg = NULL;
-  //mySelectionMgr->setSelectionModes(ActorSelection);
-  aSVTKVW->SetSelectionMode(ActorSelection);
-  disconnect(mySelectionMgr,0,0,0);
+  if (mySelectionDlg) {
+    mySelectionDlg = NULL;
+    disconnect(mySelectionMgr,0,0,0);
+    if (SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myModule)) {
+      switch(aViewWindow->SelectionMode()){
+      case NodeSelection:
+      case CellSelection:
+       aViewWindow->SetSelectionMode(ActorSelection);
+       break;
+      }
+    }
+  }
   QDialog::closeEvent(theEvent);
 }
 
@@ -336,27 +336,36 @@ template<class TData> QString getVector(TData* theData, int theId){
 #define ABS(a) (a>=0)?a:-a
 
 void VisuGUI_SelectionDlg::onSelectionEvent() {
-  //MESSAGE("VisuGUI_SelectionDlg::onSelectionEvent()");
+  SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myModule);
+  if (!aViewWindow) return;
+
+  switch (aViewWindow->SelectionMode()) {
+  case NodeSelection:
+  case CellSelection:
+  case ActorSelection:
+    break;
+  default:
+    close( TRUE );
+    return;
+  }
+
   if (myFl) return;
   myFl = true;
+
   int aType = myWidgetStack->id(myWidgetStack->visibleWidget());
 
   SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>
     (SUIT_Session::session()->activeApplication());
 
-  SVTK_ViewWindow* aSVTKVW = VISU::GetViewWindow();
-  SVTK_Selector* aSelector = aSVTKVW->GetSelector();
+  SVTK_Selector* aSelector = aViewWindow->GetSelector();
 
   VISU::Prs3d_i* aPrs3d = NULL;
   _PTR(SObject) aSObject;
   Handle(SALOME_InteractiveObject) anIO;
 
-  //SALOME_ListIO aListIO;
-  //mySelectionMgr->selectedObjects(aListIO, SVTK_Viewer::Type());
-
-  const SALOME_ListIO& aListIO = aSelector->StoredIObjects();
+  SALOME_ListIO aListIO;
+  mySelectionMgr->selectedObjects(aListIO);
 
-  //MESSAGE("aListIO.Extent() = " << aListIO.Extent());
   if (aListIO.Extent() == 1) {
     anIO = aListIO.First();
 
@@ -364,7 +373,6 @@ void VisuGUI_SelectionDlg::onSelectionEvent() {
       SalomeApp_Study* theStudy = dynamic_cast<SalomeApp_Study*>(anApp->activeStudy());
       _PTR(Study) aStudy = theStudy->studyDS();
       aSObject = aStudy->FindObjectID(anIO->getEntry());
-      //MESSAGE("anIO->hasEntry(): " << anIO->getEntry());
 
       if (aSObject) {
        CORBA::Object_var anObject = VISU::ClientSObjectToObject(aSObject);
@@ -402,7 +410,7 @@ void VisuGUI_SelectionDlg::onSelectionEvent() {
     myFieldName->setText((aFieldName == "NULL") ? QString("No name") : aFieldName);
 
     VISU_Actor* anVISUActor =
-      VISU::FindActor(aSVTKVW, aSObject->GetID().c_str());
+      VISU::FindActor(aViewWindow, aSObject->GetID().c_str());
     if (anVISUActor) {
       float aCoord[6];
       anVISUActor->GetBounds(aCoord);
@@ -424,37 +432,37 @@ void VisuGUI_SelectionDlg::onSelectionEvent() {
       vtkPointData* aPntData = aDataSet->GetPointData();
 
       for (int ind = 1; ind <= aMapIndex.Extent(); ind++) {
-        int aID = aMapIndex(ind);
+        int anID = aMapIndex(ind);
 
         switch (aType) {
         case 0:
           {
-            float aCoord[3];
-            aDataSet->GetPoint(aID, aCoord);
+            float* aCoord = anVISUActor->GetNodeCoord(anID);
+           int aVTKID = anVISUActor->GetNodeVTKID(anID);
             myXValLbl->setText( QString::number( aCoord[0] ) );
             myYValLbl->setText( QString::number( aCoord[1] ) );
             myZValLbl->setText( QString::number( aCoord[2] ) );
-            myIDValLbl->setText( QString::number(aID) );
-            myScalarValLbl->setText(getValue(aPntData, aID));
-            myVectorValLbl->setText(getVector(aPntData, aID));
+            myIDValLbl->setText( QString::number(anID) );
+            myScalarValLbl->setText(getValue(aPntData, aVTKID));
+            myVectorValLbl->setText(getVector(aPntData, aVTKID));
           }
           break;
         case 1:
           {
-            vtkCellData* aData = aDataSet->GetCellData();
-            vtkCell* aCell = aDataSet->GetCell(aID);
+            vtkCellData* aCellData = aDataSet->GetCellData();
+            vtkCell* aCell = anVISUActor->GetElemCell(anID);
+           int aVTKID = anVISUActor->GetElemVTKID(anID);
             if (aCell != NULL) {
               int aNbOfPoints = aCell->GetNumberOfPoints();
-              if (aNbOfPoints <=1 ) { // Cell is point
+              if ( aNbOfPoints <= 1 ) { // Cell is point
                 clearFields();
               } else {
-                myCellIDValLbl->setText( QString::number(aID) );
-                myCellScalarValLbl->setText(getValue(aData, aID));
-                myCellVectorValLbl->setText(getVector(aData, aID));
+                myCellIDValLbl->setText( QString::number(anID) );
+                myCellScalarValLbl->setText(getValue(aCellData, aVTKID));
+                myCellVectorValLbl->setText(getVector(aCellData, aVTKID));
 
                 float* aCoord;
                 vtkIdList *aPointList = aCell->GetPointIds();
-                QListViewItem* anItem = NULL;
 
                 for (int i = 0; i < aNbOfPoints; i++) {
                   int idCurrent = aPointList->GetId(i);
@@ -491,7 +499,6 @@ void VisuGUI_SelectionDlg::onSelectionEvent() {
 
 
 void VisuGUI_SelectionDlg::clearFields() {
-  //MESSAGE("VisuGUI_SelectionDlg::clearFields()");
   int aType = myWidgetStack->id(myWidgetStack->visibleWidget());
   switch (aType) {
   case 0:
@@ -523,24 +530,22 @@ typedef  vtkIdType (vtkDataSet::* TDataSetMethod)();
 bool onIdEdit (const QString& theText,
                TDataSetMethod theMethod,
                bool theIsCell,
-               SalomeApp_SelectionMgr* theSelectionMgr,
+              const SalomeApp_Module* theModule,
+               LightApp_SelectionMgr* theSelectionMgr,
                QLabel* theMeshName,
                QString theValue,
                QLabel* theFieldName)
 {
-  //MESSAGE("onIdEdit()");
-  SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>
-    (SUIT_Session::session()->activeApplication());
-  SVTK_ViewWindow* aSVTKVW = VISU::GetViewWindow();
-  SVTK_Selector* aSelector = aSVTKVW->GetSelector();
+  SalomeApp_Application* anApp = theModule->getApp();
+  SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(theModule);
+  if (!aViewWindow) return false;
+  SVTK_Selector* aSelector = aViewWindow->GetSelector();
 
   VISU::Prs3d_i* aPrs3d = NULL;
   Handle(SALOME_InteractiveObject) anIO;
 
-  //SALOME_ListIO aListIO;
-  //theSelectionMgr->selectedObjects(aListIO, SVTK_Viewer::Type());
-
-  const SALOME_ListIO& aListIO = aSelector->StoredIObjects();
+  SALOME_ListIO aListIO;
+  theSelectionMgr->selectedObjects(aListIO, SVTK_Viewer::Type());
 
   if (aListIO.Extent() == 1) {
     anIO = aListIO.First();
@@ -571,14 +576,10 @@ bool onIdEdit (const QString& theText,
     if (anId < 0) anId = 0;
     if (anId >= aMaxId) anId = aMaxId - 1;
 
-    //SALOME_ListIO sel;
-    //sel.Append(anIO);
-    //theSelectionMgr->setSelectedObjects(sel);
-
     TColStd_MapOfInteger newIndices;
     newIndices.Add(anId);
     aSelector->AddOrRemoveIndex(anIO, newIndices, false);
-    aSVTKVW->highlight(anIO, true, true);
+    aViewWindow->highlight(anIO, true, true);
 
     return true;
 
@@ -591,24 +592,28 @@ bool onIdEdit (const QString& theText,
 
 void VisuGUI_SelectionDlg::onPointIdEdit (const QString& theText)
 {
-  //MESSAGE("onPointIdEdit()");
   if (myFl) return;
   TDataSetMethod aMethod = &vtkDataSet::GetNumberOfPoints;
-  bool anIsSelected = onIdEdit(theText,aMethod,false,mySelectionMgr,
+  bool anIsSelected = onIdEdit(theText,aMethod,false,myModule,mySelectionMgr,
                               myMeshName,tr("WRN_NO_AVAILABLE_DATA"),
                               myFieldName);
-  if (!anIsSelected)
+  if (anIsSelected)
+    // as selection manager doesn't send signal currentSelectionChanged()
+    onSelectionEvent();
+  else
     clearFields();
 }
 
 void VisuGUI_SelectionDlg::onCellIdEdit (const QString& theText)
 {
-  //MESSAGE("onCellIdEdit()");
   if (myFl) return;
   TDataSetMethod aMethod = &vtkDataSet::GetNumberOfCells;
-  bool anIsSelected = onIdEdit(theText,aMethod,true,mySelectionMgr,
+  bool anIsSelected = onIdEdit(theText,aMethod,true,myModule,mySelectionMgr,
                               myMeshName,tr("WRN_NO_AVAILABLE_DATA"),
                               myFieldName);
-  if (!anIsSelected)
+  if (anIsSelected)
+    // as selection manager doesn't send signal currentSelectionChanged()
+    onSelectionEvent();
+  else
     clearFields();
 }