From: imn Date: Mon, 29 Jun 2015 16:34:27 +0000 (+0300) Subject: INT PAL 0052786: 2D algorithm shown when mesh edition invoked X-Git-Tag: V7_7_0a1~31 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2295213e66a593e9b426e64eb755a3c1141dcd6e;p=modules%2Fsmesh.git INT PAL 0052786: 2D algorithm shown when mesh edition invoked --- diff --git a/src/SMESHGUI/SMESHGUI_MeshOp.cxx b/src/SMESHGUI/SMESHGUI_MeshOp.cxx index ff9851008..53e1ea98e 100644 --- a/src/SMESHGUI/SMESHGUI_MeshOp.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshOp.cxx @@ -1496,24 +1496,32 @@ void SMESHGUI_MeshOp::onAlgoSelected( const int theIndex, if ( anAvailable.count() == 1 ) soleCompatible = myAvailableHypData[dim][Algo][0]; if ( dim == aTopDim && prevAlgo ) {// all available algoritms should be selectable any way - if (aTopDim == SMESH::DIM_2D) { + if (aTopDim == SMESH::DIM_2D && myFilteredAlgoData[dim].count() > 0) { anAvailable.clear(); for (int i = 0; i < myFilteredAlgoData[dim].count(); ++i) { HypothesisData* aCurAlgo = myFilteredAlgoData[dim][ i ]; anAvailable.append( aCurAlgo->Label ); } } - if (aTopDim == SMESH::DIM_3D) + if (aTopDim == SMESH::DIM_3D && myDlg->currentMeshType() == MT_ANY) availableHyps( dim, Algo, anAvailable, myAvailableHypData[dim][Algo], 0 ); } myDlg->tab( dim )->setAvailableHyps( Algo, anAvailable ); noCompatible = anAvailable.isEmpty(); // restore previously selected algo - if (dim == aTopDim && prevAlgo && aTopDim == SMESH::DIM_2D) + if (dim == aTopDim && prevAlgo && aTopDim == SMESH::DIM_2D && myFilteredAlgoData[dim].count() > 0) { algoIndex = myFilteredAlgoData[dim].indexOf( curAlgo ); - else + setCurrentHyp( dim, Algo, algoIndex); + if (algoIndex >= 0) + prevAlgo = algoByDim[ dim ] = myFilteredAlgoData[dim][algoIndex]; + else + prevAlgo = algoByDim[ dim ] = 0; + continue; + } + else { algoIndex = myAvailableHypData[dim][Algo].indexOf( curAlgo ); + } if ( !isSubmesh && algoIndex < 0 && soleCompatible && !forward && dim != SMESH::DIM_0D) // select the sole compatible algo algoIndex = myAvailableHypData[dim][Algo].indexOf( soleCompatible );