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=========================================================================*/
37
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
45class vtkBitArray;
47class vtkTree;
49
50class VTKIOINFOVIS_EXPORT vtkPhyloXMLTreeReader : public vtkXMLReader
51{
52public:
55 void PrintSelf(ostream& os, vtkIndent indent) override;
56
58
62 vtkTree* GetOutput(int idx);
64
65protected:
68
72 void ReadXMLData() override;
73
80
89
95
100
108
116
123
129
135
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
160 const char* GetDataSetName() override;
161 void SetOutput(vtkTree* output);
162 void SetupEmptyOutput() override;
163
164private:
165 vtkIdType NumberOfNodes;
166 bool HasBranchColor;
167 vtkSmartPointer<vtkBitArray> ColoredVertices;
169 void operator=(const vtkPhyloXMLTreeReader&) = delete;
170};
171
172#endif
dynamic, self-adjusting array of bits
Definition vtkBitArray.h:37
a simple class to control print indentation
Definition vtkIndent.h:40
Store vtkAlgorithm input/output information.
An editable directed graph.
~vtkPhyloXMLTreeReader() override
void ReadBranchLengthElement(vtkXMLDataElement *element, vtkMutableDirectedGraph *g, vtkIdType vertex)
Read & store the branch length for this clade.
void ReadConfidenceElement(vtkXMLDataElement *element, vtkMutableDirectedGraph *g, vtkIdType vertex)
Read confidence value and store it for the specified vertex, or the whole tree is vertex is -1.
void ReadNameElement(vtkXMLDataElement *element, vtkMutableDirectedGraph *g, vtkIdType vertex)
Read a name and assign it to the specified vertex, or the whole tree if vertex is -1.
vtkIdType ReadCladeElement(vtkXMLDataElement *element, vtkMutableDirectedGraph *g, vtkIdType parent)
Read a clade element.
void ReadColorElement(vtkXMLDataElement *element, vtkMutableDirectedGraph *g, vtkIdType vertex)
Read RGB color value for this vertex.
void SetupEmptyOutput() override
void PropagateBranchColor(vtkTree *tree)
Assign the parent's branch color to child vertices where none is otherwise specified.
void ReadXMLElement(vtkXMLDataElement *element, vtkMutableDirectedGraph *g, vtkIdType vertex)
Read one particular XML element.
std::string GetTrimmedString(const char *input)
Return a copy of the input string with all leading & trailing whitespace removed.
std::string GetStringBeforeColon(const char *input)
Return the portion of the input string that occurs before the first colon (:).
static vtkPhyloXMLTreeReader * New()
vtkTree * GetOutput()
Get the output of this reader.
const char * GetDataSetName() override
void ReadXMLData() override
Read the input PhyloXML and populate our output vtkTree.
void SetOutput(vtkTree *output)
void ReadDescriptionElement(vtkXMLDataElement *element, vtkMutableDirectedGraph *g)
Read the description for the tree.
int FillOutputPortInformation(int, vtkInformation *) override
Fill the output port information objects for this algorithm.
void ReadPropertyElement(vtkXMLDataElement *element, vtkMutableDirectedGraph *g, vtkIdType vertex)
Read a property and assign it to our output vtkTree's VertexData for the specified vertex.
vtkTree * GetOutput(int idx)
Get the output of this reader.
std::string GetStringAfterColon(const char *input)
Return the portion of the input string that occurs after the first colon (:).
void CountNodes(vtkXMLDataElement *element)
Count the number of vertices in the tree.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Hold a reference to a vtkObjectBase instance.
A rooted tree data structure.
Definition vtkTree.h:61
Represents an XML element and those nested inside.
int vtkIdType
Definition vtkType.h:332