31 #include <vtkCellData.h> 32 #include <vtkPointData.h> 37 const std::vector<std::string> &newnames)
40 std::vector<int> arrayIDs =
getArrayIDs(arrayNames, pointData);
48 const std::vector<std::string> &newnames)
51 std::vector<int> arrayIDs =
getArrayIDs(arrayNames, cellData);
58 std::vector<int> arrayIDs;
59 for(
auto arrayName : arrayNames)
64 std::cerr <<
"Array " << arrayName <<
" not found." << std::endl;
67 arrayIDs.push_back(arrayIndex);
74 for(
int arrayIndex = 0; arrayIndex < data->GetNumberOfArrays(); ++arrayIndex)
76 if(arrayName == data->GetArrayName(arrayIndex))
return arrayIndex;
data_type data
Edge/face with sorted point ids (a, b, c, ...) is located at some index i in data[b], with data[b][i].first == [a, c] (for edges, third point id treated as -1).
virtual int transferCellData(const std::vector< int > &arrayIDs, const std::vector< std::string > &newnames=std::vector< std::string >())=0
Transfer cell data with given ids from source to target.
int getDataArrayIndex(const std::string &arrayName, vtkFieldData *data)
given array name and field data, returns index of array with given name (-1 if not found) ...
vtkSmartPointer< vtkDataSet > getDataSet() const
get this meshes' dataSet
virtual int transferPointData(const std::vector< int > &arrayIDs, const std::vector< std::string > &newnames=std::vector< std::string >())=0
Transfer point data with given ids from source to target.
std::vector< int > getArrayIDs(const std::vector< std::string > &arrayNames, vtkFieldData *fieldData)
given array names and field data, return vector of corresponding array ids in the field data ...