Salome HOME
*** empty log message ***
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_MeshPatternDlg.cxx
index 238f2277cdfa2e5cba139a95cbda937ec81521eb..ecd3c522ac29a48bcae2caa1265538f86eee1a42 100755 (executable)
@@ -140,7 +140,7 @@ QFrame* SMESHGUI_MeshPatternDlg::createMainFrame (QWidget* theParent)
   QPixmap iconSlct ( mgr->loadPixmap("SMESH", tr("ICON_SELECT")));
   QPixmap icon2d   ( mgr->loadPixmap("SMESH", tr("ICON_PATTERN_2d")));
   QPixmap icon3d   ( mgr->loadPixmap("SMESH", tr("ICON_PATTERN_3d")));
-  QPixmap iconOpen ( mgr->loadPixmap("SMESH", tr("ICON_FILE_OPEN")));
+  QPixmap iconOpen ( mgr->loadPixmap("STD", tr("ICON_FILE_OPEN")));
 
   QPixmap iconSample2d ( mgr->loadPixmap("SMESH", tr("ICON_PATTERN_SAMPLE_2D")));
   QPixmap iconSample3d ( mgr->loadPixmap("SMESH", tr("ICON_PATTERN_SAMPLE_3D")));
@@ -415,9 +415,7 @@ bool SMESHGUI_MeshPatternDlg::onApply()
     if ( myPattern->MakeMesh( myMesh, toCreatePolygons, toCreatePolyedrs ) ) {
       mySelectionMgr->clearSelected();
       SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
-      bool autoUpdate = false;
-      if (mgr && mgr->stringValue("SMESH", "AutomaticUpdate").compare("true") == 0)
-        autoUpdate = true;
+      bool autoUpdate = SMESHGUI::automaticUpdate();
       if (!isRefine() && autoUpdate) {
        _PTR(SObject) aSO = SMESH::FindSObject(myMesh.in());
        SMESH_Actor* anActor = SMESH::FindActorByEntry(aSO->GetID().c_str());
@@ -516,6 +514,8 @@ void SMESHGUI_MeshPatternDlg::onSelectionDone()
     } else if (mySelInput == Ids) {
       SALOME_ListIO aList;
       mySelectionMgr->selectedObjects(aList,SVTK_Viewer::Type());
+      if (aList.Extent() != 1)
+       return;
 
       QString anIds;
       if (!SMESH::GetNameOfSelectedElements(mySelector, aList.First(), anIds))
@@ -853,7 +853,7 @@ void SMESHGUI_MeshPatternDlg::displayPreview()
     aProp->SetRepresentationToWireframe();
     aProp->SetColor(250, 0, 250);
     if (SMESH::FindActorByObject(myMesh))
-      aProp->SetLineWidth(SMESH::GetFloat("SMESH:SettingsWidth", 1) +1);
+      aProp->SetLineWidth( SMESH::GetFloat( "SMESH:element_width", 1 ) + 1 );
     else
       aProp->SetLineWidth(1);
     myPreviewActor->SetProperty(aProp);
@@ -1256,28 +1256,16 @@ void SMESHGUI_MeshPatternDlg::onTextChanged (const QString& theNewText)
 
   if (aMesh) {
     QStringList aListId = QStringList::split(" ", theNewText, false);
-
-    SALOME_ListIO aList;
-    aList.Append(anActor->getIO());
-    mySelectionMgr->setSelectedObjects(aList, false);
-
-    TColStd_IndexedMapOfInteger selectedIndices;
+    
     TColStd_MapOfInteger newIndices;
-    mySelector->GetIndex(anActor->getIO(), selectedIndices);
-
+    
     for (int i = 0; i < aListId.count(); i++) {
       const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
-      if (e && e->GetType() == (myType == Type_2d ? SMDSAbs_Face : SMDSAbs_Volume)) {
-        if (selectedIndices.Add(e->GetID())) {
-          newIndices.Add(e->GetID());
-        }
-      }
-    }
-    if (newIndices.Extent() > 0)
-    {
-      mySelector->AddOrRemoveIndex( anActor->getIO(), newIndices, true);
-      myViewWindow->highlight( anActor->getIO(), true, true );
+      if (e && e->GetType() == (myType == Type_2d ? SMDSAbs_Face : SMDSAbs_Volume))
+       newIndices.Add(e->GetID());
     }
+    mySelector->AddOrRemoveIndex( anActor->getIO(), newIndices, false);
+    myViewWindow->highlight( anActor->getIO(), true, true );
   }
 
   myBusy = false;