myHypTypePopup = new QPopupMenu();
- QStringList aHypTypeNameList = SMESH::GetAvailableHypotheses( false, 0 );
+ // Add to pop-up hypotheses of "Regular_1D" algo
myHypTypePopup->clear();
- for ( int i = 0, n = aHypTypeNameList.count(); i < n; i++ ) {
- myHypTypePopup->insertItem( aHypTypeNameList[ i ] );
+ HypothesisData* algoData = SMESH::GetHypothesisData( "Regular_1D" );
+ myHypTypes = SMESH::GetAvailableHypotheses( false, 0 );
+ QStringList::const_iterator anIter = myHypTypes.begin();
+ for ( ; anIter != myHypTypes.end(); ++anIter )
+ {
+ HypothesisData* hypData = SMESH::GetHypothesisData( *anIter );
+ bool bidon;
+ if ( SMESH::IsAvailableHypothesis( algoData, hypData->TypeName, bidon ))
+ myHypTypePopup->insertItem( hypData->Label );
}
connect( myCreateButton, SIGNAL(clicked()), SLOT(onCreate()));
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));
}