本文整理汇总了C++中Pile::getNumItems方法的典型用法代码示例。如果您正苦于以下问题:C++ Pile::getNumItems方法的具体用法?C++ Pile::getNumItems怎么用?C++ Pile::getNumItems使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pile
的用法示例。
在下文中一共展示了Pile::getNumItems方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: isSourceValid
bool FileSystemActor::isSourceValid()
{
FileSystemActor *fsData = NULL;
Actor *data = NULL;
for (uint i = 0; i < source.size(); i++)
{
// Check to see if the icon is a filesystem icon
if (source[i]->isBumpObjectType(BumpActor))
{
data = (Actor *) source[i];
if (data->isActorType(FileSystem))
{
fsData = (FileSystemActor *) source[i];
// Exclude Virtual folders
if (fsData->isFileSystemType(Virtual)) return false;
if (fsData->isFileSystemType(LogicalVolume)) return false;
if (fsData == this) return false;
}
else if (data->isActorType(Webpage) && RecycleBin == winOS->GetIconTypeFromFileName(getFullPath()))
return true; // can drop WebActor into Recycling Bin to delete
else
return false;
}else if (source[i]->isBumpObjectType(BumpPile))
{
Pile *pile = (Pile *) source[i];
// Check for any items that cannot be moved (ie. Virtual folders)
for (uint i = 0; i < pile->getNumItems(); i++)
{
if (!(*pile)[i]->isPilable(HardPile))
{
return false;
}
}
// Ignore gridded items because they are on the dynamic plane, above
// all other items on the floor.
if (pile->getPileState() == Grid) return false;
// Allow Piles
return true;
}else{
// Logical items are not allowed
return false;
}
}
return true;
}
示例2: if
vector<BumpObject *> FileSystemActor::onDrop(vector<BumpObject *> &objList)
{
QString fPath;
FileSystemActor *fsData;
Pile *pile;
FileSystemPile *fsPile;
Vec3 topPt;
bool moveItem = true;
bool operationSucceeded = false;
vector<FileSystemActor *> failedObj, fsObjList;
vector<BumpObject *> failedBumpObjs;
vector<FileSystemActor *> hardPileOwners;
if (!isSourceValid())
{
return objList;
}
else
{
// Convert Piles to Free Items
for (int i = 0; i < objList.size(); i++)
{
// Do Pile to free Item conversions
if (objList[i]->getObjectType() == ObjectType(BumpPile, HardPile, Stack))
{
// If its a Hard Pile, get its owner and use it instead of pile members
fsPile = (FileSystemPile *) objList[i];
objList.erase(objList.begin() + i);
objList.push_back(fsPile->getOwner());
hardPileOwners.push_back(fsPile->getOwner());
fsPile->folderize(false);
i--;
}else if (objList[i]->getObjectType() == ObjectType(BumpPile, SoftPile, Stack))
{
pile = (Pile *) objList[i];
objList.erase(objList.begin() + i);
i--;
// If its a Soft Pile, use its members instead of the pile
for (uint j = 0; j < pile->getNumItems(); j++)
{
objList.push_back((*pile)[j]);
}
}
}
if (isFileSystemType(Executable))
{
for (uint i = 0; i < objList.size(); i++)
{
// Create a parameter list separated by spaces
fsData = (FileSystemActor *) objList[i];
if (!fsData || !scnManager->containsObject(fsData))
continue;
fPath.append(fsData->getFullPath());
fPath.append(" ");
}
// We just tossed into an executable
// QString lnkTarget, dummyLnkArgs, lnkWorkingDir;
QString lnkArgs = fPath;
/*
if (isFileSystemType(Link))
{
fsManager->getShortcutTarget(getFullPath(), &lnkTarget, &dummyLnkArgs, &lnkWorkingDir);
fsManager->launchFileAsync(lnkTarget, lnkArgs, lnkWorkingDir);
}
else
*/
fsManager->launchFileAsync(filePath, lnkArgs);
}else if (isFileSystemType(Folder))
{
bool itemNeedsPrompt = false;
bool onlyPhotoFrame = true;
int iconType = winOS->GetIconTypeFromFileName(getFullPath());
bool isRecycleBin = iconType == RecycleBin;
bool isMyDocuments = iconType == MyDocuments;
// Convert BumpObject to FileSystemActors, delete WebActors since they are not FileSystemActors
for (uint i = 0; i < objList.size(); i++)
{
if (objList[i]->isObjectType(ObjectType(BumpActor, Webpage)))
{
if (isRecycleBin)
{
sel->remove(objList[i]);
objList[i]->markDragCancelled(true);
objList[i]->onDragEnd();
FadeAndDeleteActor((Actor *)objList[i]);
objList.erase(objList.begin() + i);
}
//.........这里部分代码省略.........