本文整理汇总了C++中GeometryPtr::getIndices方法的典型用法代码示例。如果您正苦于以下问题:C++ GeometryPtr::getIndices方法的具体用法?C++ GeometryPtr::getIndices怎么用?C++ GeometryPtr::getIndices使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GeometryPtr
的用法示例。
在下文中一共展示了GeometryPtr::getIndices方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: verifyIndexMap
bool VerifyGraphOp::verifyIndexMap(GeometryPtr &geo, bool &repair)
{
repair = false;
if(geo == NullFC)
return true;
if(geo->getIndices() == NullFC)
return true;
if(!geo->getMFIndexMapping()->empty())
return true;
if(geo->getPositions() == NullFC)
return true;
UInt32 positions_size = geo->getPositions()->getSize();
UInt32 normals_size = 0;
if(geo->getNormals() != NullFC)
normals_size = geo->getNormals()->getSize();
UInt32 colors_size = 0;
if(geo->getColors() != NullFC)
colors_size = geo->getColors()->getSize();
UInt32 secondary_colors_size = 0;
if(geo->getSecondaryColors() != NullFC)
secondary_colors_size = geo->getSecondaryColors()->getSize();
UInt32 texccords_size = 0;
if(geo->getTexCoords() != NullFC)
texccords_size = geo->getTexCoords()->getSize();
UInt32 texccords1_size = 0;
if(geo->getTexCoords1() != NullFC)
texccords1_size = geo->getTexCoords1()->getSize();
UInt32 texccords2_size = 0;
if(geo->getTexCoords2() != NullFC)
texccords2_size = geo->getTexCoords2()->getSize();
UInt32 texccords3_size = 0;
if(geo->getTexCoords3() != NullFC)
texccords3_size = geo->getTexCoords3()->getSize();
/*
printf("sizes: %u %u %u %u %u %u %u %u\n", positions_size, normals_size,
colors_size, secondary_colors_size,
texccords_size, texccords1_size,
texccords2_size, texccords3_size);
*/
if((positions_size == normals_size || normals_size == 0) &&
(positions_size == colors_size || colors_size == 0) &&
(positions_size == secondary_colors_size || secondary_colors_size == 0) &&
(positions_size == texccords_size || texccords_size == 0) &&
(positions_size == texccords1_size || texccords1_size == 0) &&
(positions_size == texccords2_size || texccords2_size == 0) &&
(positions_size == texccords3_size || texccords3_size == 0)
)
{
UInt16 indexmap = 0;
if(positions_size > 0)
indexmap |= Geometry::MapPosition;
if(normals_size > 0)
indexmap |= Geometry::MapNormal;
if(colors_size > 0)
indexmap |= Geometry::MapColor;
if(secondary_colors_size > 0)
indexmap |= Geometry::MapSecondaryColor;
if(texccords_size > 0)
indexmap |= Geometry::MapTexCoords;
if(texccords1_size > 0)
indexmap |= Geometry::MapTexCoords1;
if(texccords2_size > 0)
indexmap |= Geometry::MapTexCoords2;
if(texccords3_size > 0)
indexmap |= Geometry::MapTexCoords3;
beginEditCP(geo, Geometry::IndexMappingFieldMask);
geo->editMFIndexMapping()->push_back(indexmap);
endEditCP(geo, Geometry::IndexMappingFieldMask);
repair = true;
return false;
}
else
{
return false;
}
}