如何获取数据集的范围?也称为数据的边界框。数据读取与StructuredPointsReader
.
由于 vtkStructuredPoints(vtkStructuredPointsReader 上的 GetOutput() 的类型)是 vtkDataSet 的子类,因此您可以使用 vtkDataSet 的 GetBounds(double[6]) 函数。这是一个例子:
double bounds[6];
structuredPointsReader->Update();
structuredPointsReader->GetOutput()->GetBounds(bounds);
std::cout << "xmin: " << bounds[0] << " "
<< "xmax: " << bounds[1] << std::endl
<< "ymin: " << bounds[2] << " "
<< "ymax: " << bounds[3] << std::endl
<< "zmin: " << bounds[4] << " "
<< "zmax: " << bounds[5] << std::endl;
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)