| 857 | } |
| 858 | |
| 859 | void vtkGLTFWriter::WriteData() |
| 860 | { |
| 861 | vtksys::ofstream output; |
| 862 | |
| 863 | // make sure the user specified a FileName or FilePointer |
| 864 | if (this->FileName == nullptr) |
| 865 | { |
| 866 | vtkErrorMacro(<< "Please specify FileName to use"); |
| 867 | return; |
| 868 | } |
| 869 | |
| 870 | std::string extension = vtksys::SystemTools::GetFilenameLastExtension(this->FileName); |
| 871 | if (extension == ".glb") |
| 872 | { |
| 873 | this->Binary = true; |
| 874 | } |
| 875 | |
| 876 | // try opening the files |
| 877 | output.open(this->FileName, ios::binary); |
| 878 | if (!output.is_open()) |
| 879 | { |
| 880 | vtkErrorMacro("Unable to open file for gltf output."); |
| 881 | return; |
| 882 | } |
| 883 | |
| 884 | this->WriteToStream(output, this->GetInput()); |
| 885 | output.close(); |
| 886 | } |
| 887 | |
| 888 | void vtkGLTFWriter::WriteToStream(ostream& output, vtkDataObject* vtkNotUsed(data)) |
| 889 | { |
nothing calls this directly
no test coverage detected