From 2bb9a7b8b456a6dc8667c41e2ef19e96e2937cfa Mon Sep 17 00:00:00 2001 From: eap Date: Fri, 8 Dec 2006 14:49:52 +0000 Subject: [PATCH 1/1] PAL13473 (Build repetitive mesh): fix changing 1D hypo type --- .../StdMeshersGUI_LayerDistributionParamWdg.cxx | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/StdMeshersGUI/StdMeshersGUI_LayerDistributionParamWdg.cxx b/src/StdMeshersGUI/StdMeshersGUI_LayerDistributionParamWdg.cxx index 836eb5523..7537e621b 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_LayerDistributionParamWdg.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_LayerDistributionParamWdg.cxx @@ -119,9 +119,9 @@ void StdMeshersGUI_LayerDistributionParamWdg::init() // Add to pop-up hypotheses of "Regular_1D" algo myHypTypePopup->clear(); HypothesisData* algoData = SMESH::GetHypothesisData( "Regular_1D" ); - QStringList aHypTypeNameList = SMESH::GetAvailableHypotheses( false, 0 ); - QStringList::const_iterator anIter = aHypTypeNameList.begin(); - for ( int i = 0; anIter != aHypTypeNameList.end(); ++anIter, ++i ) + myHypTypes = SMESH::GetAvailableHypotheses( false, 0 ); + QStringList::const_iterator anIter = myHypTypes.begin(); + for ( ; anIter != myHypTypes.end(); ++anIter ) { HypothesisData* hypData = SMESH::GetHypothesisData( *anIter ); bool bidon; @@ -149,9 +149,16 @@ void StdMeshersGUI_LayerDistributionParamWdg::onHypTypePopup( int theIndex ) gen->SetCurrentStudy( SALOMEDS::Study::_nil() ); // create a hyp - QString aHypType = myHypTypePopup->text( theIndex ); - HypothesisData* aHypData = SMESH::GetHypothesisData(aHypType.latin1()); + HypothesisData* aHypData = 0; + QStringList::const_iterator anIter = myHypTypes.begin(); + for ( ; !aHypData && anIter != myHypTypes.end(); ++anIter ) + { + HypothesisData* hypData = SMESH::GetHypothesisData( *anIter ); + if ( myHypTypePopup->text( theIndex ) == hypData->Label ) + aHypData = hypData; + } QString aServLib = aHypData->ServerLibName; + QString aHypType = aHypData->TypeName; try { set( gen->CreateHypothesis(aHypType, aServLib)); } -- 2.30.2