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


C++ Accessor::InitTraversal方法代码示例

本文整理汇总了C++中Accessor::InitTraversal方法的典型用法代码示例。如果您正苦于以下问题:C++ Accessor::InitTraversal方法的具体用法?C++ Accessor::InitTraversal怎么用?C++ Accessor::InitTraversal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Accessor的用法示例。


在下文中一共展示了Accessor::InitTraversal方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: IsovolumeMinMax

inline void IsovolumeMinMax(double &min, double &max, Accessor access)
{
    min = +FLT_MAX;
    max = -FLT_MAX;
    access.InitTraversal();
    while(access.Iterating())
    {
        double value = access.GetTuple1();
        min = (min < value ? min : value);
        max = (max > value ? max : value);
        ++access;
    }
}
开发者ID:,项目名称:,代码行数:13,代码来源:

示例2: AddLineToPolyData

template <class Accessor> inline void
vtkRectilinearLinesNoDataFilter_AddLines(int nX, int nY, int nZ,
    vtkIdType *nl, vtkPointData *outPointData, vtkPointData *inPointData,
    Accessor x, Accessor y, Accessor z, Accessor p)
{
    //
    // And now actually create the points/lines
    //
    int pointId = 0;
    int cellId = 0;

    p.InitTraversal();

    // This case is mutually exclusive with the other ones below....
    if ((nX==1 && nY==1) || (nX==1 && nZ==1) || (nY==1 && nZ==1))
    {
        AddLineToPolyData(0,0,0, nX-1,nY-1,nZ-1);
    }

    if (nX>1 && nY>1)
    {
        // even if nz==1
        {
            // Front, Top to Bottom
            for (int i = 0 ; i < nX ; i++)
                AddLineToPolyData(i   ,0   ,0   ,       i   ,nY-1,0   );

            // Front, Left to Right
            for (int j = 0 ; j < nY ; j++)
                AddLineToPolyData(0   ,j   ,0   ,       nX-1,j   ,0   );
        }

        if (nZ>1)
        {
            // Back, Top to Bottom
            for (int i = 0 ; i < nX ; i++)
                AddLineToPolyData(i   ,0   ,nZ-1,       i   ,nY-1,nZ-1);

            // Back, Left to Right
            for (int j = 0 ; j < nY ; j++)
                AddLineToPolyData(0   ,j   ,nZ-1,       nX-1,j   ,nZ-1);
        }
    }

    if (nX>1 && nZ>1)
    {
        // even if ny==1
        {
            // Top, Front to Back
            for (int i = 0 ; i < nX ; i++)
                AddLineToPolyData(i   ,0   ,0   ,       i   ,0   ,nZ-1);

            // Top, Left to Right
            for (int k = 0 ; k < nZ ; k++)
                AddLineToPolyData(0   ,0   ,k   ,       nX-1,0   ,k   );
        }

        if (nY>1)
        {
            // Bottom, Front to Back
            for (int i = 0 ; i < nX ; i++)
                AddLineToPolyData(i   ,nY-1,0   ,       i   ,nY-1,nZ-1);

            // Bottom, Left to Right
            for (int k = 0 ; k < nZ ; k++)
                AddLineToPolyData(0   ,nY-1,k   ,       nX-1,nY-1,k   );
        }
    }

    if (nY>1 && nZ>1)
    {
        // even if nx==1
        {
            // Left, Front to Back
            for (int j = 0 ; j < nY ; j++)
                AddLineToPolyData(0   ,j   ,0   ,       0   ,j   ,nZ-1);

            // Left, Top to Bottom
            for (int k = 0 ; k < nZ ; k++)
                AddLineToPolyData(0   ,0   ,k   ,       0   ,nY-1,k   );
        }

        if (nX>1)
        {
            // Right, Front to Back
            for (int j = 0 ; j < nY ; j++)
                AddLineToPolyData(nX-1,j   ,0   ,       nX-1,j   ,nZ-1);

            // Right, Top to Bottom
            for (int k = 0 ; k < nZ ; k++)
                AddLineToPolyData(nX-1,0   ,k   ,       nX-1,nY-1,k   );
        }
    }
}
开发者ID:burlen,项目名称:visit_vtk_7_src,代码行数:94,代码来源:vtkRectilinearLinesNoDataFilter.C


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