本文整理汇总了C++中Join::setPosy方法的典型用法代码示例。如果您正苦于以下问题:C++ Join::setPosy方法的具体用法?C++ Join::setPosy怎么用?C++ Join::setPosy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Join
的用法示例。
在下文中一共展示了Join::setPosy方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parseFSM
//.........这里部分代码省略.........
//-- 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++) {
//-- Create
Join * newJoin = new Join();
//-- Id
newJoin->setId(atoi(QXMLLoad::getAttributeValue("id",*it)));
//-- Position
newJoin->setPosx(atof(QXMLLoad::getAttributeValue("posx",*it)));
newJoin->setPosy(atof(QXMLLoad::getAttributeValue("posy",*it)));
//-- target State
newJoin->setTargetState(fsm->getStatebyID(atoi(QXMLLoad::getAttributeValue("targetState",*it))));
//-- Add join to FSM
fsm->addJoin(newJoin);
//---- Trackpoints
//-----------------------
QList<QDomElement> trackpoints = QXMLLoad::getChildElements("trackpoint",*it);
int loopcounter2 =0;
for (QList<QDomElement>::iterator it2=trackpoints.begin();it2!=trackpoints.end();it2++,loopcounter2++) {
//-- Add
Trackpoint * addedTrackpoint = newJoin->addTrackpoint();
//-- Position
addedTrackpoint->setPosition(make_pair((double)atof(QXMLLoad::getAttributeValue("posx",*it2)),(double)atof(QXMLLoad::getAttributeValue("posy",*it2))));
//-- Link ?
bool link = atoi(QXMLLoad::getAttributeValue("link",*it2))==1?true:false;
addedTrackpoint->setTargetLink(fsm->getLinkbyID(atoi(QXMLLoad::getAttributeValue("linkid",*it2))));
//-- Color
addedTrackpoint->setColor(atoi(QXMLLoad::getAttributeValue("color",*it2)));
//-- Hierarchy
}
}
// EOF Joins