本文整理汇总了C++中SoPath::getIndexFromTail方法的典型用法代码示例。如果您正苦于以下问题:C++ SoPath::getIndexFromTail方法的具体用法?C++ SoPath::getIndexFromTail怎么用?C++ SoPath::getIndexFromTail使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SoPath
的用法示例。
在下文中一共展示了SoPath::getIndexFromTail方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ASSERT
void
IfWeeder::weedMaterial(SoNode *root, IfWeederMaterialEntry *entry)
{
// If the material affects no shapes at all, get rid of it. This
// can happen when vertex property nodes are used.
if (entry->shapes.getLength() == 0) {
SoSearchAction sa;
sa.setNode(entry->material);
sa.setInterest(SoSearchAction::ALL);
sa.apply(root);
for (int i = 0; i < sa.getPaths().getLength(); i++) {
SoPath *path = sa.getPaths()[i];
SoSeparator *parent = (SoSeparator *) path->getNodeFromTail(1);
int index = path->getIndexFromTail(0);
ASSERT(parent->isOfType(SoSeparator::getClassTypeId()));
ASSERT(parent->getChild(index) == entry->material);
parent->removeChild(index);
}
}
// Remove all material values from the material node that are
// not used by any dependent shapes. Adjust the indices in the
// dependent shapes accordingly.
removeDuplicateMaterials(entry);
// Now remove all material values that are not used by any
// dependent shapes. Again, adjust the indices in the dependent
// shapes.
removeUnusedMaterials(entry);
}