本文整理汇总了C++中Movement::getDet1方法的典型用法代码示例。如果您正苦于以下问题:C++ Movement::getDet1方法的具体用法?C++ Movement::getDet1怎么用?C++ Movement::getDet1使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Movement
的用法示例。
在下文中一共展示了Movement::getDet1方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QAbstractItemModel
Entities::Entities(std::map<int,Detection*> _detections,
std::map<int,Movement*> _movements,
std::map<int,Path*> _paths,
std::map<int,Agent*> _agents,
std::map<int,Behavior*> _behaviors,
bool detailed)
: QAbstractItemModel(0), detections(_detections), movements(_movements),
paths(_paths), agents(_agents), behaviors(_behaviors)
{
rootEntitiesTreeItem = new EntitiesTreeItem(NULL, 0);
if(detailed)
{
for(std::map<int,Detection*>::const_iterator it = detections.begin();
it != detections.end(); it++)
{
EntitiesTreeItem *e = new EntitiesTreeItem((*it).second, rootEntitiesTreeItem);
rootEntitiesTreeItem->appendChild(e);
}
for(std::map<int,Movement*>::const_iterator it = movements.begin();
it != movements.end(); it++)
{
EntitiesTreeItem *e = new EntitiesTreeItem((*it).second, rootEntitiesTreeItem);
rootEntitiesTreeItem->appendChild(e);
EntitiesTreeItem *e1 = new EntitiesTreeItem(((*it).second)->getDet1(), e);
e->appendChild(e1);
EntitiesTreeItem *e2 = new EntitiesTreeItem(((*it).second)->getDet2(), e);
e->appendChild(e2);
}
for(std::map<int,Path*>::const_iterator it = paths.begin();
it != paths.end(); it++)
{
Path *p = (*it).second;
EntitiesTreeItem *e = new EntitiesTreeItem(p, rootEntitiesTreeItem);
rootEntitiesTreeItem->appendChild(e);
p->movements_begin();
while(!p->movements_end())
{
Movement *m = p->movements_next();
EntitiesTreeItem *em = new EntitiesTreeItem(m, e);
e->appendChild(em);
EntitiesTreeItem *ed1 = new EntitiesTreeItem(m->getDet1(), em);
em->appendChild(ed1);
EntitiesTreeItem *ed2 = new EntitiesTreeItem(m->getDet2() ,em);
em->appendChild(ed2);
}
}
for(std::map<int,Agent*>::const_iterator it = agents.begin();
it != agents.end(); it++)
{
Agent *a = (*it).second;
EntitiesTreeItem *e = new EntitiesTreeItem(a, rootEntitiesTreeItem);
rootEntitiesTreeItem->appendChild(e);
a->paths_begin();
while(!a->paths_end())
{
Path *p = a->paths_next();
EntitiesTreeItem *ep = new EntitiesTreeItem(p, e);
e->appendChild(ep);
p->movements_begin();
while(!p->movements_end())
{
Movement *m = p->movements_next();
EntitiesTreeItem *em = new EntitiesTreeItem(m, ep);
ep->appendChild(em);
EntitiesTreeItem *ed1 = new EntitiesTreeItem(m->getDet1(), em);
em->appendChild(ed1);
EntitiesTreeItem *ed2 = new EntitiesTreeItem(m->getDet2() ,em);
em->appendChild(ed2);
}
}
}
} // if(detailed)
for(std::map<int,Behavior*>::const_iterator it = behaviors.begin();
it != behaviors.end(); it++)
{
Behavior *b = (*it).second;
EntitiesTreeItem *e = new EntitiesTreeItem(b, rootEntitiesTreeItem);
rootEntitiesTreeItem->appendChild(e);
b->agents_begin();
while(!b->agents_end())
{
Agent *a = b->agents_next();
EntitiesTreeItem *ea = new EntitiesTreeItem(a, e);
e->appendChild(ea);
a->paths_begin();
while(!a->paths_end())
{
//.........这里部分代码省略.........