本文整理汇总了C++中Join::addTrackpoint方法的典型用法代码示例。如果您正苦于以下问题:C++ Join::addTrackpoint方法的具体用法?C++ Join::addTrackpoint怎么用?C++ Join::addTrackpoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Join
的用法示例。
在下文中一共展示了Join::addTrackpoint方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parseFSM
//.........这里部分代码省略.........
//-- 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
//---- Transitions
//--------------------
QList<QDomElement> transitions = QXMLLoad::getChildElements("trans",fsmElement);
loopcounter =0;
for (QList<QDomElement>::iterator it=transitions.begin();it!=transitions.end();it++,loopcounter++) {
//-- Create trans and set params
//cout << "Trans: " <<atoi(QXMLLoad::getChildText("start",*it)) <<"->" <<atoi(QXMLLoad::getChildText("end",*it)) << ", Default: "<< (atoi(QXMLLoad::getChildText("default",*it))==1?true:false) <<endl;
//-- Get start and end
State * start = fsm->getStatebyID(atoi(QXMLLoad::getChildText("start",*it).c_str()));
State * end = fsm->getStatebyID(atoi(QXMLLoad::getChildText("end",*it).c_str()));