本文整理汇总了C++中VectorPtr::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ VectorPtr::push_back方法的具体用法?C++ VectorPtr::push_back怎么用?C++ VectorPtr::push_back使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VectorPtr
的用法示例。
在下文中一共展示了VectorPtr::push_back方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: import
bool TSShapeImport::import(TSShape* shape,ITRGeometry* geometry)
{
//
printf("TSShape Import\n");
//
VectorPtr<TSPartList*> partStack;
partStack.push_back(dynamic_cast<TSPartList*>(shape));
while (!partStack.empty()) {
TSPartList& partList = *partStack.last();
partStack.decrement();
for (int i = 0; i < partList.getPartCount(); i++)
if (TSPartList *pl = dynamic_cast<TSPartList*>(partList[i]))
partStack.push_back(pl);
else
if (TSMesh* pm = dynamic_cast<TSMesh*>(partList[i])) {
if (!import(pm,shape->getMaterialList(),geometry))
return false;
}
}
printf(" Vertices: %d\n",geometry->point3List.size());
printf(" Surfaces: %d\n",geometry->surfaceList.size());
printf(" Polygons: %d\n",geometry->polyList.size());
printf(" Planes: %d\n",geometry->planeList.size());
return true;
}
示例2: while
void Win32WindowManager::getWindows(VectorPtr<PlatformWindow*> &windows)
{
Win32Window *win = mWindowListHead;
while(win)
{
windows.push_back(win);
win = win->mNextWindow;
}
}
示例3: stepThrough
Status BehaviorTreeStepper::stepThrough(VectorPtr<Task *> &taskVector)
{
if(taskVector.empty()) return INVALID;
if(taskVector.back()->getStatus() == SUSPENDED)
return SUSPENDED;
Status status = INVALID;
// loop through the tasks in the task list
while(!taskVector.empty())
{
// get a task
Task *currentTask = taskVector.back();
// tick the task
Task *nextTask = currentTask->tick();
// if task returned no children, it has completed
if(!nextTask)
{
// stop if it's RUNNING or SUSPENED
status = currentTask->getStatus();
if(status == RUNNING || status == SUSPENDED)
break;
// otherwise, remove it from the list
taskVector.pop_back();
if(!taskVector.empty())
// and tell its parent that it completed
taskVector.back()->onChildComplete(currentTask->getStatus());
// complete the task
currentTask->finish();
}
else
{
// add the child as a task
nextTask->setup();
taskVector.push_back(nextTask);
}
}
return status;
}
示例4: dumpClasses
static void dumpClasses( Stream &stream )
{
Namespace::trashCache();
VectorPtr<Namespace*> vec;
vec.reserve( 1024 );
// We use mHashSequence to mark if we have traversed...
// so mark all as zero to start.
for ( Namespace *walk = Namespace::mNamespaceList; walk; walk = walk->mNext )
walk->mHashSequence = 0;
for(Namespace *walk = Namespace::mNamespaceList; walk; walk = walk->mNext)
{
VectorPtr<Namespace*> stack;
stack.reserve( 1024 );
// Get all the parents of this namespace... (and mark them as we go)
Namespace *parentWalk = walk;
while(parentWalk)
{
if(parentWalk->mHashSequence != 0)
break;
if(parentWalk->mPackage == 0)
{
parentWalk->mHashSequence = 1; // Mark as traversed.
stack.push_back(parentWalk);
}
parentWalk = parentWalk->mParent;
}
// Load stack into our results vector.
while(stack.size())
{
vec.push_back(stack[stack.size() - 1]);
stack.pop_back();
}
}
// Go through previously discovered classes
U32 i;
for(i = 0; i < vec.size(); i++)
{
const char *className = vec[i]->mName;
const char *superClassName = vec[i]->mParent ? vec[i]->mParent->mName : NULL;
// Skip the global namespace, that gets dealt with in dumpFunctions
if(!className)
continue;
// We're just dumping engine functions, then we don't want to dump
// a class that only contains script functions. So, we iterate over
// all the functions.
bool found = false;
for( Namespace::Entry *ewalk = vec[i]->mEntryList; ewalk; ewalk = ewalk->mNext )
{
if( ewalk->mType != Namespace::Entry::ConsoleFunctionType )
{
found = true;
break;
}
}
// If we don't have engine functions and the namespace name
// doesn't match the class name... then its a script class.
if ( !found && !vec[i]->isClass() )
continue;
// If we hit a class with no members and no classRep, do clever filtering.
if(vec[i]->mEntryList == NULL && vec[i]->mClassRep == NULL)
{
// Print out a short stub so we get a proper class hierarchy.
if ( superClassName )
{
// Filter hack; we don't want non-inheriting classes...
dumpClassHeader( stream, NULL, className, superClassName );
dumpClassFooter( stream );
}
continue;
}
// Skip over hidden or internal classes.
if( vec[i]->mUsage &&
( dStrstr( vec[i]->mUsage, "@hide" ) || dStrstr( vec[i]->mUsage, "@internal" ) ) )
continue;
// Print the header for the class..
dumpClassHeader( stream, vec[i]->mUsage, className, superClassName );
// Dump all fragments for this class.
for( ConsoleDocFragment* fragment = ConsoleDocFragment::smFirst; fragment != NULL; fragment = fragment->mNext )
if( fragment->mClass && dStricmp( fragment->mClass, className ) == 0 )
dumpFragment( stream, fragment );
// Dump member functions.
dumpNamespaceEntries( stream, vec[ i ], false );
// Dump callbacks.
dumpGroupStart( stream, "Callbacks" );
//.........这里部分代码省略.........