------------------------------------------------------------------------------ Write the row data (e.g., scalars, vectors, ...) of a vtk table. Returns 0 if error.
| 859 | // Write the row data (e.g., scalars, vectors, ...) of a vtk table. |
| 860 | // Returns 0 if error. |
| 861 | int vtkDataWriter::WriteRowData(ostream* fp, vtkTable* t) |
| 862 | { |
| 863 | vtkIdType numRows; |
| 864 | vtkDataArray* scalars; |
| 865 | vtkDataArray* vectors; |
| 866 | vtkDataArray* normals; |
| 867 | vtkDataArray* tcoords; |
| 868 | vtkDataArray* tensors; |
| 869 | vtkDataArray* globalIds; |
| 870 | vtkAbstractArray* pedigreeIds; |
| 871 | vtkFieldData* field; |
| 872 | vtkDataSetAttributes* cd = t->GetRowData(); |
| 873 | |
| 874 | numRows = t->GetNumberOfRows(); |
| 875 | |
| 876 | vtkDebugMacro(<< "Writing row data..."); |
| 877 | |
| 878 | scalars = cd->GetScalars(); |
| 879 | if (scalars && scalars->GetNumberOfTuples() <= 0) |
| 880 | scalars = nullptr; |
| 881 | |
| 882 | vectors = cd->GetVectors(); |
| 883 | if (vectors && vectors->GetNumberOfTuples() <= 0) |
| 884 | vectors = nullptr; |
| 885 | |
| 886 | normals = cd->GetNormals(); |
| 887 | if (normals && normals->GetNumberOfTuples() <= 0) |
| 888 | normals = nullptr; |
| 889 | |
| 890 | tcoords = cd->GetTCoords(); |
| 891 | if (tcoords && tcoords->GetNumberOfTuples() <= 0) |
| 892 | tcoords = nullptr; |
| 893 | |
| 894 | tensors = cd->GetTensors(); |
| 895 | if (tensors && tensors->GetNumberOfTuples() <= 0) |
| 896 | tensors = nullptr; |
| 897 | |
| 898 | globalIds = cd->GetGlobalIds(); |
| 899 | if (globalIds && globalIds->GetNumberOfTuples() <= 0) |
| 900 | globalIds = nullptr; |
| 901 | |
| 902 | pedigreeIds = cd->GetPedigreeIds(); |
| 903 | if (pedigreeIds && pedigreeIds->GetNumberOfTuples() <= 0) |
| 904 | pedigreeIds = nullptr; |
| 905 | |
| 906 | field = cd; |
| 907 | if (field && field->GetNumberOfTuples() <= 0) |
| 908 | field = nullptr; |
| 909 | |
| 910 | if (!(scalars || vectors || normals || tcoords || tensors || globalIds || pedigreeIds || field)) |
| 911 | { |
| 912 | vtkDebugMacro(<< "No row data to write!"); |
| 913 | return 1; |
| 914 | } |
| 915 | |
| 916 | *fp << "ROW_DATA " << numRows << "\n"; |
| 917 | // |
| 918 | // Write scalar data |
no test coverage detected