------------------------------------------------------------------------------
| 24 | |
| 25 | //------------------------------------------------------------------------------ |
| 26 | void vtkNewickTreeWriter::WriteData() |
| 27 | { |
| 28 | vtkDebugMacro(<< "Writing vtk tree data..."); |
| 29 | |
| 30 | vtkTree* const input = this->GetInput(); |
| 31 | |
| 32 | this->EdgeWeightArray = input->GetEdgeData()->GetAbstractArray(this->EdgeWeightArrayName.c_str()); |
| 33 | |
| 34 | this->NodeNameArray = input->GetVertexData()->GetAbstractArray(this->NodeNameArrayName.c_str()); |
| 35 | |
| 36 | ostream* fp = this->OpenVTKFile(); |
| 37 | if (!fp) |
| 38 | { |
| 39 | vtkErrorMacro("Failed to open output stream"); |
| 40 | return; |
| 41 | } |
| 42 | |
| 43 | this->WriteVertex(fp, input, input->GetRoot()); |
| 44 | |
| 45 | // the tree ends with a semi-colon |
| 46 | *fp << ";"; |
| 47 | |
| 48 | this->CloseVTKFile(fp); |
| 49 | } |
| 50 | |
| 51 | //------------------------------------------------------------------------------ |
| 52 | void vtkNewickTreeWriter::WriteVertex(ostream* fp, vtkTree* input, vtkIdType vertex) |
nothing calls this directly
no test coverage detected