本文整理汇总了C++中Join::setTargetState方法的典型用法代码示例。如果您正苦于以下问题:C++ Join::setTargetState方法的具体用法?C++ Join::setTargetState怎么用?C++ Join::setTargetState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Join
的用法示例。
在下文中一共展示了Join::setTargetState方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parseFSM
//.........这里部分代码省略.........
//-- Links
//----------------
QList<QDomElement> links = QXMLLoad::getChildElements("link",fsmElement);
loopcounter =0;
for (QList<QDomElement>::iterator it=links.begin();it!=links.end();it++,loopcounter++) {
//-- Create
Link * link = new Link(fsm->getStatebyID(atoi(QXMLLoad::getAttributeValue("goal",*it))),atof(QXMLLoad::getAttributeValue("posx",*it)),
atof(QXMLLoad::getAttributeValue("posy",*it)));
link->setId(atoi(QXMLLoad::getAttributeValue("id",*it)));
//-- Color
link->setColor(atoi(QXMLLoad::getAttributeValue("color",*it)));
//-- Add
fsm->addLink(link);
}
//-- Hypertrans
//----------------
QList<QDomElement> hypertrans = QXMLLoad::getChildElements("hypertrans",fsmElement);
loopcounter =0;
for (QList<QDomElement>::iterator it=hypertrans.begin();it!=hypertrans.end();it++,loopcounter++) {
//-- Create
Hypertrans * hyperTransition = new Hypertrans();
hyperTransition->setType(atoi(QXMLLoad::getChildText("type",*it).c_str()) == 0 ? Hypertrans::FromReset : Hypertrans::FromAllStates);
hyperTransition->setPosition(make_pair( atof(QXMLLoad::getAttributeValue("posx",*it)),atof(QXMLLoad::getAttributeValue("posy",*it))));
hyperTransition->setId(atoi(QXMLLoad::getAttributeValue("id",*it)));
hyperTransition->setTargetState(fsm->getStatebyID(atoi(QXMLLoad::getAttributeValue("targetState",*it))));
hyperTransition->setName(QXMLLoad::getChildText("name",*it));
//-- Color
hyperTransition->setColor(atoi(QXMLLoad::getAttributeValue("color",*it)));
//-- Add
Hypertrans * hypertrans = fsm->addHypertrans(hyperTransition);
//-- Conditions
QList<QDomElement> conditions = QXMLLoad::getChildElements("condition",*it);
int loopcounter2 =0;
for (QList<QDomElement>::iterator it2=conditions.begin();it2!=conditions.end();it2++,loopcounter2++) {
// add
Condition* condition = hypertrans->addCondition(fsm->getNumberOfInputs());
condition->setName(QXMLLoad::getChildText("cname",*it2));
condition->setInput(QXMLLoad::getChildText("input",*it2));
} // EO Conditions --//
//-- Trackpoints ?
}
//-- Joins
//----------------
QList<QDomElement> joins = QXMLLoad::getChildElements("Join",fsmElement);
loopcounter =0;
for (QList<QDomElement>::iterator it=joins.begin();it!=joins.end();it++,loopcounter++) {