Salome HOME
Join modifications from branch OCC_development_for_3_2_0a2
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_MeshPatternDlg.cxx
index 8279690189978e54ab23682037eec908084f9c58..53e8c25a783c7c09a0cb728a9c1ee60ec210b0ca 100755 (executable)
@@ -47,7 +47,7 @@
 #include "SUIT_Desktop.h"
 #include "SUIT_FileDlg.h"
 
-#include "SalomeApp_SelectionMgr.h"
+#include "LightApp_SelectionMgr.h"
 #include "SalomeApp_Tools.h"
 #include "SalomeApp_Study.h"
 
@@ -91,6 +91,7 @@
 #include <vtkUnsignedCharArray.h>
 #include <vtkUnstructuredGrid.h>
 #include <vtkDataSetMapper.h>
+#include <vtkProperty.h>
 
 #define SPACING 5
 #define MARGIN  10
@@ -350,9 +351,6 @@ void SMESHGUI_MeshPatternDlg::Init()
   activateSelection();
   onSelectionDone();
 
-  int x, y;
-  mySMESHGUI->DefineDlgPosition(this, x, y);
-  this->move(x, y);
   this->show();
 }
 
@@ -414,7 +412,7 @@ bool SMESHGUI_MeshPatternDlg::onApply()
     bool toCreatePolygons = myCreatePolygonsChk->isChecked();
     bool toCreatePolyedrs = myCreatePolyedrsChk->isChecked();
     if ( myPattern->MakeMesh( myMesh, toCreatePolygons, toCreatePolyedrs ) ) {
-      mySelectionMgr->clearSelected();
+      //mySelectionMgr->clearSelected();
       bool autoUpdate = SMESHGUI::automaticUpdate();
       if (!isRefine() && autoUpdate) {
        _PTR(SObject) aSO = SMESH::FindSObject(myMesh.in());
@@ -430,6 +428,9 @@ bool SMESHGUI_MeshPatternDlg::onApply()
       SMESH::UpdateView();
 
       mySMESHGUI->updateObjBrowser(true);
+
+      mySelEdit[ Ids ]->setText("");
+
       return true;
     } else {
       QMessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"),
@@ -739,7 +740,10 @@ void SMESHGUI_MeshPatternDlg::onOkCreationDlg()
 {
   myPattern = SMESH::SMESH_Pattern::_duplicate(myCreationDlg->GetPattern());
   myName->setText(myCreationDlg->GetPatternName());
+
+  updateWgState();
   displayPreview();
+
   setEnabled(true);
   myIsCreateDlgOpen = false;
 }
@@ -933,7 +937,7 @@ void SMESHGUI_MeshPatternDlg::updateWgState()
     }
 
     QValueList<int> ids;
-    if (!CORBA::is_nil(myPattern) && getIds(ids)) {
+    if (!CORBA::is_nil(myPattern)/* && getIds(ids)*/) {
       SMESH::long_array_var keyPoints = myPattern->GetKeyPoints();
       if (keyPoints->length()) {
        myNode1->setEnabled(true);
@@ -1278,6 +1282,8 @@ void SMESHGUI_MeshPatternDlg::onTextChanged (const QString& theNewText)
   }
 
   myBusy = false;
+
+  displayPreview();
 }
 
 //=======================================================================