VTK  9.3.1
vtkPhyloXMLTreeReader.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
26 #ifndef vtkPhyloXMLTreeReader_h
27 #define vtkPhyloXMLTreeReader_h
28 
29 #include "vtkIOInfovisModule.h" // For export macro
30 #include "vtkSmartPointer.h" // For SP ivar
31 #include "vtkXMLReader.h"
32 
33 VTK_ABI_NAMESPACE_BEGIN
34 class vtkBitArray;
36 class vtkTree;
37 class vtkXMLDataElement;
38 
39 class VTKIOINFOVIS_EXPORT vtkPhyloXMLTreeReader : public vtkXMLReader
40 {
41 public:
42  static vtkPhyloXMLTreeReader* New();
44  void PrintSelf(ostream& os, vtkIndent indent) override;
45 
47 
50  vtkTree* GetOutput();
51  vtkTree* GetOutput(int idx);
53 
54 protected:
56  ~vtkPhyloXMLTreeReader() override;
57 
61  void ReadXMLData() override;
62 
68  void ReadXMLElement(vtkXMLDataElement* element, vtkMutableDirectedGraph* g, vtkIdType vertex);
69 
76  vtkIdType ReadCladeElement(
78 
83  void ReadNameElement(vtkXMLDataElement* element, vtkMutableDirectedGraph* g, vtkIdType vertex);
84 
88  void ReadDescriptionElement(vtkXMLDataElement* element, vtkMutableDirectedGraph* g);
89 
95  void ReadPropertyElement(
97 
103  void ReadBranchLengthElement(
105 
110  void ReadConfidenceElement(
112 
117  void ReadColorElement(vtkXMLDataElement* element, vtkMutableDirectedGraph* g, vtkIdType vertex);
118 
123  void PropagateBranchColor(vtkTree* tree);
124 
128  void CountNodes(vtkXMLDataElement* element);
129 
134  std::string GetTrimmedString(const char* input);
135 
140  std::string GetStringBeforeColon(const char* input);
141 
146  std::string GetStringAfterColon(const char* input);
147 
148  int FillOutputPortInformation(int, vtkInformation*) override;
149  const char* GetDataSetName() override;
150  void SetOutput(vtkTree* output);
151  void SetupEmptyOutput() override;
152 
153 private:
154  vtkIdType NumberOfNodes;
155  bool HasBranchColor;
156  vtkSmartPointer<vtkBitArray> ColoredVertices;
158  void operator=(const vtkPhyloXMLTreeReader&) = delete;
159 };
160 
161 VTK_ABI_NAMESPACE_END
162 #endif
virtual const char * GetDataSetName()=0
Get the name of the data set being read.
virtual void SetupEmptyOutput()=0
Setup the output with no data available.
Represents an XML element and those nested inside.
Store vtkAlgorithm input/output information.
virtual void ReadXMLData()
Pipeline execution methods to be defined by subclass.
int vtkIdType
Definition: vtkType.h:315
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.
read vtkTree from PhyloXML formatted file
dynamic, self-adjusting array of bits
Definition: vtkBitArray.h:28
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkAlgorithm * New()
A rooted tree data structure.
Definition: vtkTree.h:45
Superclass for VTK's XML format readers.
Definition: vtkXMLReader.h:38