当前位置: 首页>>代码示例>>C++>>正文


C++ Polygons::getGroupedVerticesVertexCountArray方法代码示例

本文整理汇总了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;
}
开发者ID:sneakerpeet,项目名称:opencollada,代码行数:56,代码来源:COLLADAFWMeshPrimitive.cpp


注:本文中的Polygons::getGroupedVerticesVertexCountArray方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。