本文整理汇总了C++中utArray::iterator方法的典型用法代码示例。如果您正苦于以下问题:C++ utArray::iterator方法的具体用法?C++ utArray::iterator怎么用?C++ utArray::iterator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类utArray
的用法示例。
在下文中一共展示了utArray::iterator方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: convertGroups
void gkBlenderSceneConverter::convertGroups(utArray<Blender::Object*> &groups)
{
gkGroupManager* mgr = gkGroupManager::getSingletonPtr();
// This is a complete list of groups & containing objects.
// The gkGameObjectGroup is a containter, the gkGameObjectGroupInstance
// is where the object should be added / removed from the scene.
// for (Blender::Group* bgrp = (Blender::Group*)m_file->_getInternalFile()->m_group.first; bgrp != 0;
// bgrp = (Blender::Group*)bgrp->id.next)
gkBlendListIterator iter = m_file->_getInternalFile()->getGroupList();
while (iter.hasMoreElements())
{
Blender::Group* bgrp = (Blender::Group*)iter.getNext();
const gkResourceName groupName(GKB_IDNAME(bgrp), m_groupName);
if (mgr->exists(groupName))
{
// Can most likely assert here
continue;
}
gkGameObjectGroup* group = (gkGameObjectGroup*)mgr->create(groupName);
for (Blender::GroupObject* bgobj = (Blender::GroupObject*)bgrp->gobject.first; bgobj; bgobj = bgobj->next)
{
if (bgobj->ob)
{
Blender::Object* bobj = bgobj->ob;
if (!validObject(bobj))
continue;
gkGameObject* gobj = m_gscene->getObject(GKB_IDNAME(bobj));
// add it to the list
if (gobj)
group->addObject(gobj);
}
}
// Destroy if empty
if (group->isEmpty())
mgr->destroy(group);
else
mgr->attachGroupToScene(m_gscene, group);
}
// Process user created groups.
utArray<Blender::Object*>::Iterator it = groups.iterator();
while (it.hasMoreElements())
{
Blender::Object* bobj = it.getNext();
// Should not fail
GK_ASSERT((bobj->transflag& OB_DUPLIGROUP && bobj->dup_group != 0));
// Owning group
Blender::Group* bgobj = bobj->dup_group;
const gkResourceName groupName(GKB_IDNAME(bgobj), m_groupName);
if (mgr->exists(groupName))
{
gkGameObjectGroup* ggobj = (gkGameObjectGroup*)mgr->getByName(groupName);
gkGameObjectInstance* inst = ggobj->createGroupInstance(m_gscene, gkResourceName(GKB_IDNAME(bobj), m_groupName));
if (inst)
convertObject(bobj, inst->getRoot());
}
}
}