Salome HOME
Remove last wrong commits.
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_AddMeshElementDlg.cxx
index 20452fc65c95785afb236029fffeaf436dccbe41..79588047cb0abfb36b46746cfd9387503fc559e0 100644 (file)
@@ -413,26 +413,14 @@ SMESHGUI_AddMeshElementDlg::SMESHGUI_AddMeshElementDlg( SMESHGUI*          theMo
 
   Reverse = (myElementType == SMDSAbs_Face || myElementType == SMDSAbs_Volume ) ? new QCheckBox(tr("SMESH_REVERSE"), GroupC1) : 0;
 
 
   Reverse = (myElementType == SMDSAbs_Face || myElementType == SMDSAbs_Volume ) ? new QCheckBox(tr("SMESH_REVERSE"), GroupC1) : 0;
 
-  AutomaticPresentation = (myGeomType == SMDSEntity_Quadrangle || myGeomType == SMDSEntity_Polygon ||
-                           myGeomType == SMDSEntity_Pyramid    || myGeomType == SMDSEntity_Hexa    ||
-                           myGeomType == SMDSEntity_Penta      || myGeomType == SMDSEntity_Hexagonal_Prism ) ? new QCheckBox(tr("SMESH_AUTOMATIC_PRESENTATION"), GroupC1) : 0;
-  if ( AutomaticPresentation ) {
-    GetNextPresentationButton = new QPushButton(tr("SMESH_BUT_GET_NEXT_SHAPE"), GroupC1);
-    GetNextPresentationButton->setAutoDefault(false);
-  }
   DiameterSpinBox = ( myGeomType == SMDSEntity_Ball ) ? new SMESHGUI_SpinBox(GroupC1) : 0;
   QLabel* diameterLabel = DiameterSpinBox ? new QLabel( tr("BALL_DIAMETER"),GroupC1) : 0;
 
   GroupC1Layout->addWidget(TextLabelC1A1,    0, 0);
   GroupC1Layout->addWidget(SelectButtonC1A1, 0, 1);
   GroupC1Layout->addWidget(LineEditC1A1,     0, 2);
   DiameterSpinBox = ( myGeomType == SMDSEntity_Ball ) ? new SMESHGUI_SpinBox(GroupC1) : 0;
   QLabel* diameterLabel = DiameterSpinBox ? new QLabel( tr("BALL_DIAMETER"),GroupC1) : 0;
 
   GroupC1Layout->addWidget(TextLabelC1A1,    0, 0);
   GroupC1Layout->addWidget(SelectButtonC1A1, 0, 1);
   GroupC1Layout->addWidget(LineEditC1A1,     0, 2);
-  if ( AutomaticPresentation ) {
-    AutomaticPresentation->setChecked(true);
-    GroupC1Layout->addWidget(AutomaticPresentation, 1, 0, 1, 2);
-    GroupC1Layout->addWidget(GetNextPresentationButton, 1, 2, 1, 1);
-  }
   if ( Reverse ) {
   if ( Reverse ) {
-    GroupC1Layout->addWidget(Reverse, 2, 0, 1, 3);
+    GroupC1Layout->addWidget(Reverse, 1, 0, 1, 3);
   }
   if ( DiameterSpinBox ) {
     GroupC1Layout->addWidget(diameterLabel,   1, 0);
   }
   if ( DiameterSpinBox ) {
     GroupC1Layout->addWidget(diameterLabel,   1, 0);
@@ -518,25 +506,22 @@ void SMESHGUI_AddMeshElementDlg::Init()
   myActor = 0;
 
   /* signals and slots connections */
   myActor = 0;
 
   /* signals and slots connections */
-  connect(buttonOk,                SIGNAL(clicked()),                     SLOT(ClickOnOk()));
-  connect(buttonCancel,            SIGNAL(clicked()),                     SLOT(reject()));
-  connect(buttonApply,             SIGNAL(clicked()),                     SLOT(ClickOnApply()));
-  connect(buttonHelp,              SIGNAL(clicked()),                     SLOT(ClickOnHelp()));
-
-  connect(SelectButtonC1A1,        SIGNAL(clicked()),                     SLOT(SetEditCurrentArgument()));
-  connect(LineEditC1A1,            SIGNAL(textChanged(const QString&)),   SLOT(onTextChange(const QString&)));
-  connect(mySMESHGUI,              SIGNAL(SignalDeactivateActiveDialog()),SLOT(DeactivateActiveDialog()));
-  connect(mySelectionMgr,          SIGNAL(currentSelectionChanged()),     SLOT(SelectionIntoArgument()));
+  connect(buttonOk,        SIGNAL(clicked()),                     SLOT(ClickOnOk()));
+  connect(buttonCancel,    SIGNAL(clicked()),                     SLOT(reject()));
+  connect(buttonApply,     SIGNAL(clicked()),                     SLOT(ClickOnApply()));
+  connect(buttonHelp,      SIGNAL(clicked()),                     SLOT(ClickOnHelp()));
+
+  connect(SelectButtonC1A1,SIGNAL(clicked()),                     SLOT(SetEditCurrentArgument()));
+  connect(LineEditC1A1,    SIGNAL(textChanged(const QString&)),   SLOT(onTextChange(const QString&)));
+  connect(mySMESHGUI,      SIGNAL(SignalDeactivateActiveDialog()),SLOT(DeactivateActiveDialog()));
+  connect(mySelectionMgr,  SIGNAL(currentSelectionChanged()),     SLOT(SelectionIntoArgument()));
   /* to close dialog if study frame change */
   /* to close dialog if study frame change */
-  connect(mySMESHGUI,              SIGNAL(SignalStudyFrameChanged()),     SLOT(reject()));
-  connect(mySMESHGUI,              SIGNAL(SignalCloseAllDialogs()),       SLOT(reject()));
+  connect(mySMESHGUI,      SIGNAL(SignalStudyFrameChanged()),     SLOT(reject()));
+  connect(mySMESHGUI,      SIGNAL(SignalCloseAllDialogs()),       SLOT(reject()));    
 
   if (Reverse)
 
   if (Reverse)
-    connect(Reverse,               SIGNAL(stateChanged(int)),             SLOT(CheckBox(int)));
-  if (AutomaticPresentation) {
-    connect(AutomaticPresentation, SIGNAL(stateChanged(int)),             SLOT(SelectionIntoArgument()));
-    connect(GetNextPresentationButton, SIGNAL(clicked()),                 SLOT(GetNextShapePresentation()));
-  }
+    connect(Reverse,       SIGNAL(stateChanged(int)),             SLOT(CheckBox(int)));
+
   // set selection mode
   SMESH::SetPointRepresentation(true);
 
   // set selection mode
   SMESH::SetPointRepresentation(true);
 
@@ -664,8 +649,6 @@ void SMESHGUI_AddMeshElementDlg::ClickOnApply()
     
     buttonOk->setEnabled(false);
     buttonApply->setEnabled(false);
     
     buttonOk->setEnabled(false);
     buttonApply->setEnabled(false);
-    if ( AutomaticPresentation )
-      GetNextPresentationButton->setEnabled(false);
 
     myEditCurrentArgument->setText("");
 
 
     myEditCurrentArgument->setText("");
 
@@ -738,8 +721,6 @@ void SMESHGUI_AddMeshElementDlg::onTextChange (const QString& theNewText)
 
   buttonOk->setEnabled(false);
   buttonApply->setEnabled(false);
 
   buttonOk->setEnabled(false);
   buttonApply->setEnabled(false);
-  if ( AutomaticPresentation )
-    GetNextPresentationButton->setEnabled(false);
 
   mySimulation->SetVisibility(false);
 
 
   mySimulation->SetVisibility(false);
 
@@ -781,8 +762,6 @@ void SMESHGUI_AddMeshElementDlg::onTextChange (const QString& theNewText)
   if(myNbOkNodes) {
     buttonOk->setEnabled(true);
     buttonApply->setEnabled(true);
   if(myNbOkNodes) {
     buttonOk->setEnabled(true);
     buttonApply->setEnabled(true);
-    if ( AutomaticPresentation && AutomaticPresentation->isChecked() )
-      GetNextPresentationButton->setEnabled(true);
     displaySimulation();
   }
 
     displaySimulation();
   }
 
@@ -802,7 +781,6 @@ void SMESHGUI_AddMeshElementDlg::SelectionIntoArgument()
   myActor = 0;
 
   myBusy = true;
   myActor = 0;
 
   myBusy = true;
-  QString anOldEditArgument = myEditCurrentArgument->text();
   myEditCurrentArgument->setText("");
   myBusy = false;
 
   myEditCurrentArgument->setText("");
   myBusy = false;
 
@@ -811,8 +789,6 @@ void SMESHGUI_AddMeshElementDlg::SelectionIntoArgument()
 
   buttonOk->setEnabled(false);
   buttonApply->setEnabled(false);
 
   buttonOk->setEnabled(false);
   buttonApply->setEnabled(false);
-  if ( AutomaticPresentation )
-    GetNextPresentationButton->setEnabled(false);
 
   mySimulation->SetVisibility(false);
   //  SMESH::SetPointRepresentation(true);
 
   mySimulation->SetVisibility(false);
   //  SMESH::SetPointRepresentation(true);
@@ -856,34 +832,14 @@ void SMESHGUI_AddMeshElementDlg::SelectionIntoArgument()
 
   // get selected nodes
   QString aString = "";
 
   // get selected nodes
   QString aString = "";
-  int nbNodes = 0;
-  while ( aString == "" || anOldEditArgument == aString ) {
-    if ( AutomaticPresentation && AutomaticPresentation->isChecked() ) {
-      nbNodes = SMESH::GetNameOfSelectedSortedNodes( myGeomType , mySelector, myActor, myShift, aString );
-    }
-    else
-      nbNodes = SMESH::GetNameOfSelectedNodes( mySelector, myActor->getIO(), aString );
-    if ( aString!= "" && myNbNodes == nbNodes && anOldEditArgument == aString && AutomaticPresentation && AutomaticPresentation->isChecked()) {
-      myShift++;
-      if ( myShift > nbNodes ) {
-        myEditCurrentArgument->setText(aString);
-        myShift = 0;
-        break;
-      }
-      continue;
-    }
-    myBusy = true;
-    myEditCurrentArgument->setText(aString);
-    myBusy = false;
-    if (myIsPoly && myElementType == SMDSAbs_Face && nbNodes >= 3 )
-      myNbNodes = nbNodes;
-    else if (myNbNodes != nbNodes && myNbNodes != 1) {
-      myShift = 0;
-      return;
-    }
-    if ( !AutomaticPresentation || !AutomaticPresentation->isChecked() ||
-       ( myIsPoly && nbNodes < 3 ) )
-      break;
+  int nbNodes = SMESH::GetNameOfSelectedNodes(mySelector,myActor->getIO(),aString);
+  myBusy = true;
+  myEditCurrentArgument->setText(aString);
+  myBusy = false;
+  if (myIsPoly && myElementType == SMDSAbs_Face && nbNodes >= 3 ) {
+    myNbNodes = nbNodes;
+  } else if (myNbNodes != nbNodes && myNbNodes != 1) {
+    return;
   }
 
   // OK
   }
 
   // OK
@@ -891,8 +847,6 @@ void SMESHGUI_AddMeshElementDlg::SelectionIntoArgument()
 
   buttonOk->setEnabled(true);
   buttonApply->setEnabled(true);
 
   buttonOk->setEnabled(true);
   buttonApply->setEnabled(true);
-  if ( AutomaticPresentation && AutomaticPresentation->isChecked() )
-    GetNextPresentationButton->setEnabled(true);
 
   displaySimulation();
 }
 
   displaySimulation();
 }
@@ -942,16 +896,6 @@ void SMESHGUI_AddMeshElementDlg::SetEditCurrentArgument()
   SelectionIntoArgument();
 }
 
   SelectionIntoArgument();
 }
 
-//=================================================================================
-// function : GetNextShapePresentation()
-// purpose  :
-//=================================================================================
-void SMESHGUI_AddMeshElementDlg::GetNextShapePresentation()
-{
-  myShift++;
-  SetEditCurrentArgument();
-}
-
 //=================================================================================
 // function : DeactivateActiveDialog()
 // purpose  :
 //=================================================================================
 // function : DeactivateActiveDialog()
 // purpose  :