本文整理汇总了C++中Join::setId方法的典型用法代码示例。如果您正苦于以下问题:C++ Join::setId方法的具体用法?C++ Join::setId怎么用?C++ Join::setId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Join
的用法示例。
在下文中一共展示了Join::setId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parseFSM
void QXMLLoad::parseFSM(QDomElement fsmElement) {
// Preparation
int loopcounter =0;
// Get Core
Core& c = *(Core::getInstance());
// Add FSM to core
//-----------------
Fsm * fsm = c.getProject()->addFSM();
//-- Generators parameters
//--------------------------------------
QList<QDomElement> toolsParameters = QXMLLoad::getChildElements("ToolsParameters",fsmElement);
if (toolsParameters.size()>0) {
//-- Get parameters for a user
QList<QDomElement> userParameters = QXMLLoad::getChildElements("Parameters",toolsParameters.front());
for (QList<QDomElement>::iterator it=userParameters.begin();it!=userParameters.end();it++) {
//---- Get user id
string userid = QXMLLoad::getAttributeValue("userid",*it);
//---- Get All parameters
QList<QDomElement> parameters = QXMLLoad::getChildElements("Parameter",*it);
for (QList<QDomElement>::iterator pit=parameters.begin();pit!=parameters.end();pit++) {
// Record
fsm->setParameter(userid,QXMLLoad::getAttributeValue("key",*pit),(*pit).text().toStdString());
}
}
}
//-- Globals
//-- Inputs
QList<QDomElement> inputnames = QXMLLoad::getChildElements("name",QXMLLoad::getFirstMatchingChild("inputnames",fsmElement));
loopcounter =0;
for (QList<QDomElement>::iterator it=inputnames.begin();it!=inputnames.end();it++,loopcounter++) {
fsm->addInput((*it).text().toStdString().c_str());
}
//-- Outputs
QList<QDomElement> outputnames = QXMLLoad::getChildElements("name",QXMLLoad::getFirstMatchingChild("outputnames",fsmElement));
loopcounter =0;
for (QList<QDomElement>::iterator it=outputnames.begin();it!=outputnames.end();it++,loopcounter++) {
fsm->addOutput((*it).text().toStdString().c_str());
}
//-- States
QList<QDomElement> states = QXMLLoad::getChildElements("state",fsmElement);
loopcounter =0;
for (QList<QDomElement>::iterator it=states.begin();it!=states.end();it++,loopcounter++) {
//-- Create State and set parameters
State * currentState = new ::State(fsm->getNumberOfOutputs());
currentState->setId(atoi(QXMLLoad::getAttributeValue("id",*it)));
currentState->setName(QXMLLoad::getChildText("sname",*it));
currentState->setOutput(QXMLLoad::getChildText("output",*it));
currentState->setPosition(pair<double,double>(atof(QXMLLoad::getAttributeValue("posx",*it)),atof(QXMLLoad::getAttributeValue("posy",*it))));
currentState->setColor(atoi(QXMLLoad::getAttributeValue("color",*it)));
currentState->setReset(true);
//string name = QXMLLoad::getChildText("sname",*it);
//qDebug() << "State name: "<< QString::fromStdString(name) << "//" << QString::fromStdString(currentState->getName());
fsm->addState(currentState);
} // EO States --//
//-- 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
//.........这里部分代码省略.........