本文整理汇总了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;
}
}
示例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 );
}
}
}