How to get the the values of a vtkDoubleArray in a std::vector
问题 I want to copy the elements of a vtkDoubleArray into a C++ std::vector (as in How to convert a vtkDoubleArray to an Eigen::matrix) I am trying to get this to work: typedef std::vector<double> row_type; typedef std::vector<row_type> matrix_type; int n_components = vtk_arr->GetNumberOfComponents(); int n_rows = vtk_arr->GetNumberOfTuples(); row_type curTuple(n_components); matrix_type cpp_matrix(n_rows, row_type(n_components)); for (int i=0; i<n_rows; i++) { vtk_arr->GetTuple(i, curTuple); cpp