vtkFloatArray 继承了vtkDataArray
vtkDataArray存放了连续元素,每components个连续元素组成一个tuple
vtkDataArray默认的components是1,也就是普通的一维数组。
vtkFloatArray可以作为vtkPoints的内部实际存放数据的载体
#include <vtkSmartPointer.h>
#include <vtkPoints.h>
#include <vtkFloatArray.h>
#include <vtkNew.h>
#include <iostream>
int main(int argc, char* argv[])
{
vtkNew<vtkFloatArray> pcoords;
// Note that by default, an array has 1 component.
// We have to change it to 3 for points
pcoords->SetNumberOfComponents(3);
// We ask pcoords to allocate room for at least 4 tuples
// and set the number of tuples to 4.
pcoords->SetNumberOfTuples