| 1678 | } |
| 1679 | |
| 1680 | int vtkDataWriter::WriteNormalData(ostream* fp, vtkDataArray* normals, vtkIdType num) |
| 1681 | { |
| 1682 | char* normalsName; |
| 1683 | // Buffer size is size of array name times four because |
| 1684 | // in theory there could be array name consisting of only |
| 1685 | // weird symbols. |
| 1686 | if (!this->NormalsName) |
| 1687 | { |
| 1688 | if (normals->GetName() && strlen(normals->GetName())) |
| 1689 | { |
| 1690 | normalsName = new char[strlen(normals->GetName()) * 4 + 1]; |
| 1691 | this->EncodeString(normalsName, normals->GetName()); |
| 1692 | } |
| 1693 | else |
| 1694 | { |
| 1695 | normalsName = new char[strlen("normals") + 1]; |
| 1696 | strcpy(normalsName, "normals"); |
| 1697 | } |
| 1698 | } |
| 1699 | else |
| 1700 | { |
| 1701 | normalsName = new char[strlen(this->NormalsName) * 4 + 1]; |
| 1702 | this->EncodeString(normalsName, this->NormalsName); |
| 1703 | } |
| 1704 | |
| 1705 | *fp << "NORMALS "; |
| 1706 | char format[1024]; |
| 1707 | auto result = vtk::format_to_n(format, sizeof(format), "{:s} {:s}\n", normalsName, "{:s}"); |
| 1708 | *result.out = '\0'; |
| 1709 | delete[] normalsName; |
| 1710 | |
| 1711 | return this->WriteArray(fp, normals->GetDataType(), normals, format, num, 3); |
| 1712 | } |
| 1713 | |
| 1714 | //------------------------------------------------------------------------------ |
| 1715 | int vtkDataWriter::WriteTCoordData(ostream* fp, vtkDataArray* tcoords, vtkIdType num) |
no test coverage detected