+//================================================================================
+/*!
+ * \brief Update available list of mesh types
+ */
+//================================================================================
+void SMESHGUI_MeshOp::updateMeshTypeList()
+{
+ QStringList meshTypes;
+ meshTypes.append( tr( "MT_ANY" ) );
+ if ( myMaxShapeDim >= 2 || myMaxShapeDim == -1 )
+ {
+ meshTypes.append( tr( "MT_TRIANGULAR" ) );
+ meshTypes.append( tr( "MT_QUADRILATERAL" ) );
+ }
+ if ( myMaxShapeDim == 3 || myMaxShapeDim == -1 )
+ {
+ meshTypes.append( tr( "MT_TETRAHEDRAL" ) );
+ meshTypes.append( tr( "MT_HEXAHEDRAL" ) );
+ }
+
+ myDlg->setAvailableMeshType( meshTypes );
+}
+
+//================================================================================
+/*!
+ * \brief Update available list of hypothesis sets
+ */
+//================================================================================
+void SMESHGUI_MeshOp::updateHypoSets()
+{
+ // get available algorithms taking into account geometry and mesh type
+ QStringList algosAvailable;
+ if ( myDlg->currentMeshType() != MT_ANY )
+ for ( int dim = 0; dim <= 3; ++dim )
+ availableHyps( dim, Algo, algosAvailable, myAvailableHypData[ dim ][ Algo ] );
+
+ THypDataList anAvailableAlgsData;
+ QStringList aHypothesesSetsList = SMESH::GetHypothesesSets( myMaxShapeDim );
+ QStringList aFilteredHypothesesSetsList;
+ QStringList::const_iterator inHypoSetName = aHypothesesSetsList.begin();
+ for ( ; inHypoSetName != aHypothesesSetsList.end(); ++inHypoSetName )
+ {
+ HypothesesSet* currentHypoSet = SMESH::GetHypothesesSet( *inHypoSetName );
+ HypothesesSet::SetType sType;
+ for ( sType = HypothesesSet::MAIN; sType <= HypothesesSet::ALT; SMESHUtils::Increment( sType ))
+ {
+ bool isAvailable = false;
+ for ( currentHypoSet->init( true, sType ); currentHypoSet->more(); currentHypoSet->next() )
+ {
+ isAvailable = false;
+ if ( HypothesisData* algoDataIn = SMESH::GetHypothesisData( currentHypoSet->current() )) {
+ for ( int dim = SMESH::DIM_0D; dim <= myMaxShapeDim; dim++) {
+ int aCurrentAvailableAlgo = myAvailableHypData[dim][Algo].indexOf( algoDataIn );
+ if ( aCurrentAvailableAlgo > -1 ) {
+ isAvailable = true;
+ break;
+ }
+ }
+ if ( !isAvailable )
+ break;
+ }
+ }
+ currentHypoSet->setAlgoAvailable( sType, isAvailable );
+ }
+ if ( currentHypoSet->hasAlgo( HypothesesSet::MAIN ) &&
+ currentHypoSet->hasAlgo( HypothesesSet::ALT ))
+ {
+ HypothesesSet::SetType setType = HypothesesSet::getPreferredHypType();
+ if ( !currentHypoSet->getAlgoAvailable( setType ))
+ continue; // not add if a preferred type not available currently
+ }
+
+ if ( currentHypoSet->getAlgoAvailable( HypothesesSet::MAIN ) ||
+ currentHypoSet->getAlgoAvailable( HypothesesSet::ALT ))
+ {
+ aFilteredHypothesesSetsList.append( *inHypoSetName );
+ }
+ }
+ myDlg->setHypoSets( aFilteredHypothesesSetsList );
+}
+
+//================================================================================
+/*!
+ * \brief SLOT. Is called when the user select type of mesh
+ * \param theTabIndex - Index of current active tab
+ * \param theIndex - Index of current type of mesh
+ */
+//================================================================================
+void SMESHGUI_MeshOp::onAlgoSetByMeshType( const int /*theTabIndex*/, const int /*theIndex*/ )
+{
+ setFilteredAlgoData();
+}