本文整理汇总了C++中DynamicArray::append方法的典型用法代码示例。如果您正苦于以下问题:C++ DynamicArray::append方法的具体用法?C++ DynamicArray::append怎么用?C++ DynamicArray::append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DynamicArray
的用法示例。
在下文中一共展示了DynamicArray::append方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HavokDataHolder
HavokDataHolder(hkDisplayGeometry* displayGeometry, const hkArray<hkGeometry::Triangle>& triangles)
{
m_pDisplayGeometry = displayGeometry;
displayGeometry->addReference();
m_indices.reserve(triangles.getSize() * 3);
for(auto& triangle : triangles)
{
m_indices.append(triangle.m_a);
m_indices.append(triangle.m_b);
m_indices.append(triangle.m_c);
}
}
示例2: select
void _FSSEnvironment::select(const Selector& atomSelector,
DynamicArray<Operation*>& resultList) {
// Find the criterion with the lowest number of matching operations.
// Exclude the terminator symbol from the selector while searching.
SelectorCriterion* startingCriterion = NULL;
int criteriaCount = atomSelector.getCriteria().length - 1;
for (int i = 0; i < criteriaCount; i++) {
SelectorCriterion& criterion = atomSelector.getCriteria()[i];
if (criterion.getType() == SelectorCriteriaType::SCT_OPERATION) {
startingCriterion = &criterion;
break;
} else if (criterion.getType() == SelectorCriteriaType::SCT_CLASS) {
if (startingCriterion == NULL || startingCriterion->getType() ==
SelectorCriteriaType::SCT_CLASS)
{
if (startingCriterion == NULL ||
criterion.getClass()->getMembers().length <
startingCriterion->getClass()->getMembers().length) {
startingCriterion = &criterion;
}
} else {
throw AssertionFailureException("Comparing against non-class"\
"criterion", __FILE__, __LINE__);
}
} else {
throw AssertionFailureException("Invalid criterion type.",
__FILE__, __LINE__);
}
}
// Add all operations from the starting criterion to the results list
if (startingCriterion->getType() == SCT_OPERATION) {
resultList.append(startingCriterion->getOperation());
} else if (startingCriterion->getType() == SCT_CLASS) {
int memberCount = startingCriterion->getClass()->getMembers().length;
for (int i = 0; i < memberCount; i++) {
resultList.append(startingCriterion->getClass()->getMembers()[i]);
}
}
// Remove stuff that doesn't match.
for (int i = 0; i < criteriaCount; i++) {
SelectorCriterion& criterion = atomSelector.getCriteria()[i];
if (&criterion == startingCriterion) {
continue;
}
int memberCount = resultList.getSize();
for (int j = 0; j < memberCount; j++) {
bool cull = false;
if (criterion.getType() == SCT_OPERATION) {
cull = resultList[i] != criterion.getOperation();
} else if (criterion.getType() == SCT_CLASS) {
cull = !resultList[i]->hasClass(*criterion.getClass());
} else {
throw AssertionFailureException("Invalid criterion type.",
__FILE__, __LINE__);
}
if (cull) {
resultList.removeAt(j);
memberCount--;
j--;
}
}
}
}