From 53781e405481d065abd32e4680ab7dc07cc90fc3 Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 3 May 2006 14:56:12 +0000 Subject: [PATCH] fix assignation of a set of hypotheses --- src/SMESHGUI/SMESHGUI_MeshOp.cxx | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI_MeshOp.cxx b/src/SMESHGUI/SMESHGUI_MeshOp.cxx index ca7b9efb2..896e7f801 100644 --- a/src/SMESHGUI/SMESHGUI_MeshOp.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshOp.cxx @@ -1114,13 +1114,16 @@ void SMESHGUI_MeshOp::onHypoSet( const QString& theSetName ) HypothesesSet* aHypoSet = SMESH::GetHypothesesSet(theSetName); if (!aHypoSet) return; + // clear all hyps + for (int dim = SMESH::DIM_1D; dim <= SMESH::DIM_3D; dim++) { + setCurrentHyp(dim, Algo, -1); + setCurrentHyp(dim, AddHyp, -1); + setCurrentHyp(dim, MainHyp, -1); + } + for (int aHypType = Algo; aHypType < AddHyp; aHypType++) { bool isAlgo = (aHypType == Algo); - // clear all hyps - for (int dim = SMESH::DIM_1D; dim <= SMESH::DIM_3D; dim++) - setCurrentHyp(dim, aHypType, -1); - // set hyps from the set QStringList* aHypoList = isAlgo ? &aHypoSet->AlgoList : &aHypoSet->HypoList; for (int i = 0, n = aHypoList->count(); i < n; i++) { @@ -1132,9 +1135,13 @@ void SMESHGUI_MeshOp::onHypoSet( const QString& theSetName ) int aDim = aHypData->Dim[0]; // create or/and set if (isAlgo) { - QStringList tmp; - availableHyps( aDim, Algo, tmp, myAvailableHypData[aDim][Algo] ); int index = myAvailableHypData[aDim][Algo].findIndex( aHypData ); + if ( index < 0 ) { + QStringList anAvailable; + availableHyps( aDim, Algo, anAvailable, myAvailableHypData[aDim][Algo] ); + myDlg->tab( aDim )->setAvailableHyps( Algo, anAvailable ); + index = myAvailableHypData[aDim][Algo].findIndex( aHypData ); + } setCurrentHyp( aDim, Algo, index ); onAlgoSelected( index, aDim ); } -- 2.39.2