VTK  9.2.6
vtkPhyloXMLTreeReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPhyloXMLTreeReader.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 =========================================================================*/
38 #ifndef vtkPhyloXMLTreeReader_h
39 #define vtkPhyloXMLTreeReader_h
40 
41 #include "vtkIOInfovisModule.h" // For export macro
42 #include "vtkSmartPointer.h" // For SP ivar
43 #include "vtkXMLReader.h"
44 
45 class vtkBitArray;
47 class vtkTree;
48 class vtkXMLDataElement;
49 
50 class VTKIOINFOVIS_EXPORT vtkPhyloXMLTreeReader : public vtkXMLReader
51 {
52 public:
53  static vtkPhyloXMLTreeReader* New();
55  void PrintSelf(ostream& os, vtkIndent indent) override;
56 
58 
61  vtkTree* GetOutput();
62  vtkTree* GetOutput(int idx);
64 
65 protected:
67  ~vtkPhyloXMLTreeReader() override;
68 
72  void ReadXMLData() override;
73 
79  void ReadXMLElement(vtkXMLDataElement* element, vtkMutableDirectedGraph* g, vtkIdType vertex);
80 
87  vtkIdType ReadCladeElement(
89 
94  void ReadNameElement(vtkXMLDataElement* element, vtkMutableDirectedGraph* g, vtkIdType vertex);
95 
99  void ReadDescriptionElement(vtkXMLDataElement* element, vtkMutableDirectedGraph* g);
100 
106  void ReadPropertyElement(
108 
114  void ReadBranchLengthElement(
116 
121  void ReadConfidenceElement(
123 
128  void ReadColorElement(vtkXMLDataElement* element, vtkMutableDirectedGraph* g, vtkIdType vertex);
129 
134  void PropagateBranchColor(vtkTree* tree);
135 
139  void CountNodes(vtkXMLDataElement* element);
140 
145  std::string GetTrimmedString(const char* input);
146 
151  std::string GetStringBeforeColon(const char* input);
152 
157  std::string GetStringAfterColon(const char* input);
158 
159  int FillOutputPortInformation(int, vtkInformation*) override;
160  const char* GetDataSetName() override;
161  void SetOutput(vtkTree* output);
162  void SetupEmptyOutput() override;
163 
164 private:
165  vtkIdType NumberOfNodes;
166  bool HasBranchColor;
167  vtkSmartPointer<vtkBitArray> ColoredVertices;
169  void operator=(const vtkPhyloXMLTreeReader&) = delete;
170 };
171 
172 #endif
virtual const char * GetDataSetName()=0
virtual void SetupEmptyOutput()=0
Represents an XML element and those nested inside.
Store vtkAlgorithm input/output information.
virtual void ReadXMLData()
int vtkIdType
Definition: vtkType.h:332
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.
read vtkTree from PhyloXML formatted file
dynamic, self-adjusting array of bits
Definition: vtkBitArray.h:36
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:60
Superclass for VTK's XML format readers.
Definition: vtkXMLReader.h:49