VTK  9.3.1
vtkNewickTreeReader.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
22 #ifndef vtkNewickTreeReader_h
23 #define vtkNewickTreeReader_h
24 
25 #include "vtkDataReader.h"
26 #include "vtkIOInfovisModule.h" // For export macro
27 
28 VTK_ABI_NAMESPACE_BEGIN
29 class vtkDoubleArray;
31 class vtkStringArray;
32 class vtkTree;
33 
34 class VTKIOINFOVIS_EXPORT vtkNewickTreeReader : public vtkDataReader
35 {
36 public:
37  static vtkNewickTreeReader* New();
39  void PrintSelf(ostream& os, vtkIndent indent) override;
40 
42 
45  vtkTree* GetOutput();
46  vtkTree* GetOutput(int idx);
47  void SetOutput(vtkTree* output);
48  int ReadNewickTree(const char* buffer, vtkTree& tree);
50 
54  int ReadMeshSimple(VTK_FILEPATH const std::string& fname, vtkDataObject* output) override;
55 
56 protected:
58  ~vtkNewickTreeReader() override;
59 
60  int FillOutputPortInformation(int, vtkInformation*) override;
61  void CountNodes(const char* buffer, vtkIdType* numNodes);
62  vtkIdType BuildTree(char* buffer, vtkMutableDirectedGraph* g, vtkDoubleArray* weights,
63  vtkStringArray* names, vtkIdType parent);
64 
65 private:
67  void operator=(const vtkNewickTreeReader&) = delete;
68 };
69 
70 VTK_ABI_NAMESPACE_END
71 #endif
int ReadMeshSimple(VTK_FILEPATH const std::string &, vtkDataObject *) override
Overridden with default implementation of doing nothing so that subclasses only override what is need...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
read vtkTree from Newick formatted file
Store vtkAlgorithm input/output information.
a vtkAbstractArray subclass for strings
int vtkIdType
Definition: vtkType.h:315
dynamic, self-adjusting array of double
static vtkDataReader * New()
helper superclass for objects that read vtk data files
Definition: vtkDataReader.h:43
virtual int FillOutputPortInformation(int port, vtkInformation *info)
Fill the output port information objects for this algorithm.
a simple class to control print indentation
Definition: vtkIndent.h:28
An editable directed graph.
#define VTK_FILEPATH
A rooted tree data structure.
Definition: vtkTree.h:45
general representation of visualization data
Definition: vtkDataObject.h:54