MCPcopy Create free account
hub / github.com/Kitware/VTK / WriteNormalData

Method WriteNormalData

IO/Legacy/vtkDataWriter.cxx:1680–1712  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1678}
1679
1680int 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//------------------------------------------------------------------------------
1715int vtkDataWriter::WriteTCoordData(ostream* fp, vtkDataArray* tcoords, vtkIdType num)

Callers 5

WriteCellDataMethod · 0.95
WritePointDataMethod · 0.95
WriteVertexDataMethod · 0.95
WriteEdgeDataMethod · 0.95
WriteRowDataMethod · 0.95

Calls 5

WriteArrayMethod · 0.95
format_to_nFunction · 0.50
GetNameMethod · 0.45
EncodeStringMethod · 0.45
GetDataTypeMethod · 0.45

Tested by

no test coverage detected