+ bool isAux = atts.value("auxiliary") == "true";
+ bool isNeedGeom = true;
+ QString aNeedGeom = atts.value("need-geom");
+ if ( !aNeedGeom.isEmpty() )
+ isNeedGeom = (aNeedGeom == "true");
+
+ QString aDimStr = atts.value("dim");
+ aDimStr = aDimStr.remove( ' ' );
+ QStringList aDimList = aDimStr.split( ',', QString::SkipEmptyParts );
+ QStringList::iterator anIter;
+ bool isOk;
+ QList<int> aDim;
+ for ( anIter = aDimList.begin(); anIter != aDimList.end(); ++anIter )
+ {
+ int aVal = (*anIter).toInt( &isOk );
+ if ( isOk )
+ aDim.append( aVal );
+ }
+
+ // for algo
+ enum { HYPOS = 0, OPT_HYPOS, INPUT, OUTPUT, NB_ATTRIBUTES };
+ const char* name [NB_ATTRIBUTES] = { "hypos", "opt-hypos", "input", "output" };
+ QStringList attr [NB_ATTRIBUTES];
+ for ( int i = 0; i < NB_ATTRIBUTES; ++i ) {
+ QString aStr = atts.value( name[i] );
+ if ( !aStr.isEmpty() ) {
+ aStr.remove( ' ' );
+ attr[ i ] = aStr.split( ',', QString::SkipEmptyParts );
+ }
+ }
+
+ HypothesisData* aHypData =
+ new HypothesisData (aHypAlType, myPluginName, myServerLib, myClientLib,
+ aLabel, anIcon, aDim, isAux,
+ attr[ HYPOS ], attr[ OPT_HYPOS ], attr[ INPUT ], attr[ OUTPUT ], isNeedGeom );