X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_AddMeshElementDlg.cxx;h=79588047cb0abfb36b46746cfd9387503fc559e0;hp=20452fc65c95785afb236029fffeaf436dccbe41;hb=a6c877f633bb393705e79b264adfdda5164ad8b1;hpb=b5a71c53edb650e64139c16cd03a276d7fc54f1c diff --git a/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx b/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx index 20452fc65..79588047c 100644 --- a/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx @@ -413,26 +413,14 @@ SMESHGUI_AddMeshElementDlg::SMESHGUI_AddMeshElementDlg( SMESHGUI* theMo 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); - if ( AutomaticPresentation ) { - AutomaticPresentation->setChecked(true); - GroupC1Layout->addWidget(AutomaticPresentation, 1, 0, 1, 2); - GroupC1Layout->addWidget(GetNextPresentationButton, 1, 2, 1, 1); - } if ( Reverse ) { - GroupC1Layout->addWidget(Reverse, 2, 0, 1, 3); + GroupC1Layout->addWidget(Reverse, 1, 0, 1, 3); } if ( DiameterSpinBox ) { GroupC1Layout->addWidget(diameterLabel, 1, 0); @@ -518,25 +506,22 @@ void SMESHGUI_AddMeshElementDlg::Init() 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 */ - 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) - 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); @@ -664,8 +649,6 @@ void SMESHGUI_AddMeshElementDlg::ClickOnApply() buttonOk->setEnabled(false); buttonApply->setEnabled(false); - if ( AutomaticPresentation ) - GetNextPresentationButton->setEnabled(false); myEditCurrentArgument->setText(""); @@ -738,8 +721,6 @@ void SMESHGUI_AddMeshElementDlg::onTextChange (const QString& theNewText) buttonOk->setEnabled(false); buttonApply->setEnabled(false); - if ( AutomaticPresentation ) - GetNextPresentationButton->setEnabled(false); mySimulation->SetVisibility(false); @@ -781,8 +762,6 @@ void SMESHGUI_AddMeshElementDlg::onTextChange (const QString& theNewText) if(myNbOkNodes) { buttonOk->setEnabled(true); buttonApply->setEnabled(true); - if ( AutomaticPresentation && AutomaticPresentation->isChecked() ) - GetNextPresentationButton->setEnabled(true); displaySimulation(); } @@ -802,7 +781,6 @@ void SMESHGUI_AddMeshElementDlg::SelectionIntoArgument() myActor = 0; myBusy = true; - QString anOldEditArgument = myEditCurrentArgument->text(); myEditCurrentArgument->setText(""); myBusy = false; @@ -811,8 +789,6 @@ void SMESHGUI_AddMeshElementDlg::SelectionIntoArgument() buttonOk->setEnabled(false); buttonApply->setEnabled(false); - if ( AutomaticPresentation ) - GetNextPresentationButton->setEnabled(false); mySimulation->SetVisibility(false); // SMESH::SetPointRepresentation(true); @@ -856,34 +832,14 @@ void SMESHGUI_AddMeshElementDlg::SelectionIntoArgument() // 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 @@ -891,8 +847,6 @@ void SMESHGUI_AddMeshElementDlg::SelectionIntoArgument() buttonOk->setEnabled(true); buttonApply->setEnabled(true); - if ( AutomaticPresentation && AutomaticPresentation->isChecked() ) - GetNextPresentationButton->setEnabled(true); displaySimulation(); } @@ -942,16 +896,6 @@ void SMESHGUI_AddMeshElementDlg::SetEditCurrentArgument() SelectionIntoArgument(); } -//================================================================================= -// function : GetNextShapePresentation() -// purpose : -//================================================================================= -void SMESHGUI_AddMeshElementDlg::GetNextShapePresentation() -{ - myShift++; - SetEditCurrentArgument(); -} - //================================================================================= // function : DeactivateActiveDialog() // purpose :