2
如何獲取數據集的範圍?也稱爲數據的邊界框。數據與StructuredPointsReader
一起閱讀。如何獲取點數據的邊界框?
如何獲取數據集的範圍?也稱爲數據的邊界框。數據與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;