本文整理汇总了C++中OctreeElementPointer::isLeaf方法的典型用法代码示例。如果您正苦于以下问题:C++ OctreeElementPointer::isLeaf方法的具体用法?C++ OctreeElementPointer::isLeaf怎么用?C++ OctreeElementPointer::isLeaf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OctreeElementPointer
的用法示例。
在下文中一共展示了OctreeElementPointer::isLeaf方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: didntFit
void OctreeSceneStats::didntFit(const OctreeElementPointer element) {
_didntFit++;
if (element->isLeaf()) {
_leavesDidntFit++;
} else {
_internalDidntFit++;
}
}
示例2: colorSent
void OctreeSceneStats::colorSent(const OctreeElementPointer element) {
_colorSent++;
if (element->isLeaf()) {
_leavesColorSent++;
} else {
_internalColorSent++;
}
}
示例3: traversed
void OctreeSceneStats::traversed(const OctreeElementPointer element) {
_traversed++;
if (element->isLeaf()) {
_leaves++;
} else {
_internal++;
}
}
示例4: skippedOccluded
void OctreeSceneStats::skippedOccluded(const OctreeElementPointer element) {
_skippedOccluded++;
if (element->isLeaf()) {
_leavesSkippedOccluded++;
} else {
_internalSkippedOccluded++;
}
}
示例5: safeDeepDeleteChildAtIndex
// handles staging or deletion of all deep children
bool OctreeElement::safeDeepDeleteChildAtIndex(int childIndex, int recursionCount) {
bool deleteApproved = false;
if (recursionCount > DANGEROUSLY_DEEP_RECURSION) {
static QString repeatedMessage
= LogHandler::getInstance().addRepeatedMessageRegex(
"OctreeElement::safeDeepDeleteChildAtIndex\\(\\) reached DANGEROUSLY_DEEP_RECURSION, bailing!");
qCDebug(octree) << "OctreeElement::safeDeepDeleteChildAtIndex() reached DANGEROUSLY_DEEP_RECURSION, bailing!";
return deleteApproved;
}
OctreeElementPointer childToDelete = getChildAtIndex(childIndex);
if (childToDelete) {
if (childToDelete->deleteApproved()) {
// If the child is not a leaf, then call ourselves recursively on all the children
if (!childToDelete->isLeaf()) {
// delete all it's children
for (int i = 0; i < NUMBER_OF_CHILDREN; i++) {
if (childToDelete->getChildAtIndex(i)) {
deleteApproved = childToDelete->safeDeepDeleteChildAtIndex(i,recursionCount+1);
if (!deleteApproved) {
break; // no point in continuing...
}
}
}
} else {
deleteApproved = true; // because we got here after checking that delete was approved
}
if (deleteApproved) {
deleteChildAtIndex(childIndex);
_isDirty = true;
markWithChangedTime();
}
}
}
return deleteApproved;
}