本文整理汇总了C++中Polygons::getGroupedVerticesVertexCountArray方法的典型用法代码示例。如果您正苦于以下问题:C++ Polygons::getGroupedVerticesVertexCountArray方法的具体用法?C++ Polygons::getGroupedVerticesVertexCountArray怎么用?C++ Polygons::getGroupedVerticesVertexCountArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Polygons
的用法示例。
在下文中一共展示了Polygons::getGroupedVerticesVertexCountArray方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getGroupedVertexElementsCount
//-----------------------------
const size_t MeshPrimitive::getGroupedVertexElementsCount () const
{
// Get the number of grouped vertex elements (faces, holes, tristrips or trifans).
size_t groupedVertexElementsCount = 0;
MeshPrimitive::PrimitiveType primitiveType = this->getPrimitiveType ();
switch ( primitiveType )
{
case MeshPrimitive::TRIANGLES:
{
groupedVertexElementsCount = this->getFaceCount ();
break;
}
case MeshPrimitive::TRIANGLE_FANS:
{
Trifans* trifans = (Trifans*) this;
groupedVertexElementsCount = trifans->getTrifanCount ();
break;
}
case MeshPrimitive::TRIANGLE_STRIPS:
{
Tristrips* tristrips = (Tristrips*) this;
groupedVertexElementsCount = tristrips->getTristripCount ();
break;
}
case MeshPrimitive::POLYGONS:
case MeshPrimitive::POLYLIST:
{
Polygons* polygons = (Polygons*) this;
Polygons::VertexCountArray& vertexCountArray =
polygons->getGroupedVerticesVertexCountArray ();
groupedVertexElementsCount = vertexCountArray.getCount ();
}
break;
case MeshPrimitive::LINES:
{
groupedVertexElementsCount = this->getFaceCount ();
break;
}
break;
case MeshPrimitive::LINE_STRIPS:
{
Linestrips* linestrips = (Linestrips*)this;
groupedVertexElementsCount = linestrips->getLinestripCount ();
break;
}
break;
default:
std::cerr << "Primitive type not supported: " << primitiveType << std::endl;
COLLADABU_ASSERT ( "Primitive type not supported: " + primitiveType );
return 0;
}
return groupedVertexElementsCount;
}