VTK
vtkNewickTreeReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkNewickTreeReader.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
34 #ifndef vtkNewickTreeReader_h
35 #define vtkNewickTreeReader_h
36 
37 #include "vtkIOInfovisModule.h" // For export macro
38 #include "vtkDataReader.h"
39 
40 class vtkDoubleArray;
42 class vtkStringArray;
43 class vtkTree;
44 
45 class VTKIOINFOVIS_EXPORT vtkNewickTreeReader : public vtkDataReader
46 {
47 public:
48  static vtkNewickTreeReader *New();
50  void PrintSelf(ostream& os, vtkIndent indent) override;
51 
53 
56  vtkTree *GetOutput();
57  vtkTree *GetOutput(int idx);
58  void SetOutput(vtkTree *output);
59  int ReadNewickTree(const char * buffer, vtkTree & tree);
61 
65  int ReadMeshSimple(const std::string& fname,
66  vtkDataObject* output) override;
67 
68 protected:
70  ~vtkNewickTreeReader() override;
71 
72  int FillOutputPortInformation(int, vtkInformation*) override;
73  void CountNodes(const char * buffer, vtkIdType *numNodes);
74  vtkIdType BuildTree(char *buffer, vtkMutableDirectedGraph *g,
75  vtkDoubleArray *weights, vtkStringArray *names, vtkIdType parent);
76 private:
78  void operator=(const vtkNewickTreeReader&) = delete;
79 };
80 
81 #endif
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:347
dynamic, self-adjusting array of double
int ReadMeshSimple(const std::string &, vtkDataObject *) override
Overridden with default implementation of doing nothing so that subclasses only override what is need...
static vtkDataReader * New()
helper superclass for objects that read vtk data files
Definition: vtkDataReader.h:49
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:39
An editable directed graph.
A rooted tree data structure.
Definition: vtkTree.h:60
general representation of visualization data
Definition: vtkDataObject.h:64