+}
+
+void SMESHGUI_HypothesisDlg::setHIcon( const QPixmap& p )
+{
+ myIconLabel->setPixmap( p );
+}
+
+void SMESHGUI_HypothesisDlg::setType( const QString& t )
+{
+ myTypeLabel->setText( t );
+}
+
+HypothesisData::HypothesisData( const QString& theTypeName,
+ const QString& thePluginName,
+ const QString& theServerLibName,
+ const QString& theClientLibName,
+ const QString& theLabel,
+ const QString& theIconId,
+ const QString& theContext,
+ const int theGroupID,
+ const int thePriority,
+ const QList<int>& theDim,
+ const bool theIsAuxOrNeedHyp,
+ const QStringList& theBasicHypos,
+ const QStringList& theOptionalHypos,
+ const QStringList& theInputTypes,
+ const QStringList& theOutputTypes,
+ const int theIsNeedGeometry,
+ const bool theSupportSub)
+ : TypeName( theTypeName ),
+ PluginName( thePluginName ),
+ ServerLibName( theServerLibName ),
+ ClientLibName( theClientLibName ),
+ Label( theLabel ),
+ IconId( theIconId ),
+ Context( theContext ),
+ GroupID( theGroupID ),
+ Priority( thePriority ),
+ Dim( theDim ),
+ IsAuxOrNeedHyp( theIsAuxOrNeedHyp ),
+ IsNeedGeometry( theIsNeedGeometry ),
+ IsSupportSubmeshes( theSupportSub ),
+ BasicHypos( theBasicHypos ),
+ OptionalHypos( theOptionalHypos ),
+ InputTypes( theInputTypes ),
+ OutputTypes( theOutputTypes )
+{
+}
+
+// HypothesesSet::HypothesesSet( const QString& theSetName )
+// : myHypoSetName( theSetName ),
+// myIsAlgo( false ),
+// myIsCustom( false )
+// {
+// }
+
+HypothesesSet::HypothesesSet( const QString& theSetName,
+ bool useCommonSize, bool isQuadDominated,
+ const QStringList& mainHypos, const QStringList& mainAlgos,
+ const QStringList& altHypos, const QStringList& altAlgos,
+ const QStringList& intHypos, const QStringList& intAlgos )
+ : myUseCommonSize( useCommonSize ),
+ myQuadDominated( isQuadDominated ),
+ myHypoSetName( theSetName ),
+ myHypoList { mainHypos, altHypos, intHypos },
+ myAlgoList { mainAlgos, altAlgos, intAlgos },
+ myIsAlgo( false ),
+ myIsCustom( false ),
+ myIndex( 0 )
+{
+ for ( myHypType = MAIN; myHypType < NB_HYP_TYPES; SMESHUtils::Increment( myHypType ))
+ for ( int isAlgo = myIsAlgo = 0; isAlgo < 2; myIsAlgo = ++isAlgo )
+ {
+ QStringList& hyps = *list();
+ for ( int i = 0; i < hyps.count(); ++i )
+ hyps[ i ] = hyps[ i ].trimmed();
+ }
+}
+
+QStringList* HypothesesSet::list( bool is_algo, SetType setType) const
+{
+ return const_cast<QStringList*>( &( is_algo ? myAlgoList[setType] : myHypoList[setType] ));
+}
+
+QStringList* HypothesesSet::list() const
+{
+ return list( myIsAlgo, myHypType );
+}
+
+QString HypothesesSet::name() const
+{
+ return myHypoSetName;
+}
+
+// void HypothesesSet::set( bool isAlgo, const QStringList& lst )
+// {
+// *list(isAlgo) = lst;
+// }
+
+// int HypothesesSet::count( bool isAlgo, SetType setType ) const
+// {
+// return list(isAlgo,setType)->count();
+// }
+
+// bool HypothesesSet::isAlgo() const
+// {
+// return myIsAlgo;
+// }
+
+void HypothesesSet::init( bool isAlgo, SetType setType )
+{
+ myHypType = setType;
+ myIsAlgo = isAlgo;
+ myIndex = 0;
+}
+
+bool HypothesesSet::more() const
+{
+ return myIndex < list()->count();
+}
+
+void HypothesesSet::next()
+{
+ myIndex++;
+}
+
+QString HypothesesSet::current() const
+{
+ return list()->at(myIndex);
+}
+
+void HypothesesSet::setIsCustom( bool isCustom )
+{
+ myIsCustom = isCustom;
+}
+
+bool HypothesesSet::getIsCustom() const
+{
+ return myIsCustom;
+}
+
+void HypothesesSet::setAlgoAvailable( SetType type, bool isAvailable )
+{
+ if ( MAIN <= type && type < NB_HYP_TYPES )
+ myIsAlgoAvailable[ type ] = isAvailable;
+}
+
+bool HypothesesSet::getAlgoAvailable( SetType type )
+{
+ bool isAva = false;
+ if ( MAIN <= type && type < NB_HYP_TYPES )
+ isAva = myIsAlgoAvailable[ type ];
+ return isAva;
+}
+
+HypothesesSet::SetType HypothesesSet::getPreferredHypType()
+{
+ SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+ int useAltHypos = !resMgr->booleanValue( "SMESH", "use-meshgems-hypo-sets", false );
+ return ( HypothesesSet::SetType ) useAltHypos;
+}
+
+int HypothesesSet::maxDim() const
+{
+ HypothesesSet * thisSet = (HypothesesSet*) this;
+ int dim = -1;
+ for ( int setType = 0; setType < 2; ++setType )
+ for ( int isAlgo = 0; isAlgo < 2; ++isAlgo )
+ {
+ for ( thisSet->init( isAlgo, SetType( setType )); thisSet->more(); thisSet->next() )
+ if ( HypothesisData* hypData = SMESH::GetHypothesisData( thisSet->current() ))
+ for ( int i = 0; i < hypData->Dim.count(); ++i )
+ dim = qMax( dim, hypData->Dim[i] );
+ }
+ return dim;
+}