VTK
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
45class vtkBitArray;
47class vtkTree;
49
50class VTKIOINFOVIS_EXPORT vtkPhyloXMLTreeReader : public vtkXMLReader
51{
52public:
55 void PrintSelf(ostream& os, vtkIndent indent);
56
58
62 vtkTree *GetOutput(int idx);
64
65protected:
68
72 virtual void ReadXMLData();
73
80 vtkIdType vertex);
81
90
96 vtkIdType vertex);
97
103
111
119
126
132 vtkIdType vertex);
133
139
144
149 std::string GetTrimmedString(const char *input);
150
156
162
164 virtual const char* GetDataSetName();
165 void SetOutput(vtkTree *output);
166 virtual void SetupEmptyOutput();
167
168private:
169 vtkIdType NumberOfNodes;
170 bool HasBranchColor;
171 vtkSmartPointer<vtkBitArray> ColoredVertices;
172 vtkPhyloXMLTreeReader(const vtkPhyloXMLTreeReader&) VTK_DELETE_FUNCTION;
173 void operator=(const vtkPhyloXMLTreeReader&) VTK_DELETE_FUNCTION;
174};
175
176#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.
read vtkTree from PhyloXML formatted file
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 PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
void PropagateBranchColor(vtkTree *tree)
Assign the parent's branch color to child vertices where none is otherwise specified.
virtual void ReadXMLData()
Read the input PhyloXML and populate our output vtkTree.
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.
void SetOutput(vtkTree *output)
virtual int FillOutputPortInformation(int, vtkInformation *)
Fill the output port information objects for this algorithm.
virtual void SetupEmptyOutput()
virtual const char * GetDataSetName()
void ReadDescriptionElement(vtkXMLDataElement *element, vtkMutableDirectedGraph *g)
Read the description for the tree.
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)
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.
A rooted tree data structure.
Definition: vtkTree.h:61
Represents an XML element and those nested inside.
Superclass for VTK's XML format readers.
Definition: vtkXMLReader.h:44
@ string
Definition: vtkX3D.h:490
int vtkIdType
Definition: vtkType.h:287