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

Method WriteData

IO/Geometry/vtkGLTFWriter.cxx:859–886  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

857}
858
859void 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
888void vtkGLTFWriter::WriteToStream(ostream& output, vtkDataObject* vtkNotUsed(data))
889{

Callers

nothing calls this directly

Calls 5

WriteToStreamMethod · 0.95
is_openMethod · 0.80
openMethod · 0.45
GetInputMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected