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 
45 class vtkBitArray;
47 class vtkTree;
48 class vtkXMLDataElement;
49 
50 class VTKIOINFOVIS_EXPORT vtkPhyloXMLTreeReader : public vtkXMLReader
51 {
52 public:
55  void PrintSelf(ostream& os, vtkIndent indent);
56 
58 
62  vtkTree *GetOutput(int idx);
64 
65 protected:
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 
155  std::string GetStringBeforeColon(const char *input);
156 
161  std::string GetStringAfterColon(const char *input);
162 
164  virtual const char* GetDataSetName();
165  void SetOutput(vtkTree *output);
166  virtual void SetupEmptyOutput();
167 
168 private:
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
vtkXMLReader.h
vtkMutableDirectedGraph
An editable directed graph.
Definition: vtkMutableDirectedGraph.h:52
vtkPhyloXMLTreeReader::CountNodes
void CountNodes(vtkXMLDataElement *element)
Count the number of vertices in the tree.
vtkPhyloXMLTreeReader::New
static vtkPhyloXMLTreeReader * New()
vtkIdType
int vtkIdType
Definition: vtkType.h:287
vtkPhyloXMLTreeReader::ReadXMLData
virtual void ReadXMLData()
Read the input PhyloXML and populate our output vtkTree.
vtkPhyloXMLTreeReader::GetOutput
vtkTree * GetOutput(int idx)
vtkPhyloXMLTreeReader::GetTrimmedString
std::string GetTrimmedString(const char *input)
Return a copy of the input string with all leading & trailing whitespace removed.
vtkPhyloXMLTreeReader::vtkPhyloXMLTreeReader
vtkPhyloXMLTreeReader()
vtkSmartPointer< vtkBitArray >
vtkPhyloXMLTreeReader::ReadXMLElement
void ReadXMLElement(vtkXMLDataElement *element, vtkMutableDirectedGraph *g, vtkIdType vertex)
Read one particular XML element.
vtkPhyloXMLTreeReader::SetupEmptyOutput
virtual void SetupEmptyOutput()
vtkPhyloXMLTreeReader::GetOutput
vtkTree * GetOutput()
Get the output of this reader.
vtkTree
A rooted tree data structure.
Definition: vtkTree.h:61
vtkPhyloXMLTreeReader::~vtkPhyloXMLTreeReader
~vtkPhyloXMLTreeReader()
vtkPhyloXMLTreeReader::PropagateBranchColor
void PropagateBranchColor(vtkTree *tree)
Assign the parent's branch color to child vertices where none is otherwise specified.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkPhyloXMLTreeReader::SetOutput
void SetOutput(vtkTree *output)
vtkPhyloXMLTreeReader::ReadNameElement
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.
vtkPhyloXMLTreeReader::ReadDescriptionElement
void ReadDescriptionElement(vtkXMLDataElement *element, vtkMutableDirectedGraph *g)
Read the description for the tree.
vtkSmartPointer.h
vtkPhyloXMLTreeReader::FillOutputPortInformation
virtual int FillOutputPortInformation(int, vtkInformation *)
Fill the output port information objects for this algorithm.
vtkXMLDataElement
Represents an XML element and those nested inside.
Definition: vtkXMLDataElement.h:37
vtkPhyloXMLTreeReader::GetDataSetName
virtual const char * GetDataSetName()
vtkPhyloXMLTreeReader::ReadBranchLengthElement
void ReadBranchLengthElement(vtkXMLDataElement *element, vtkMutableDirectedGraph *g, vtkIdType vertex)
Read & store the branch length for this clade.
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:87
vtkPhyloXMLTreeReader::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkX3D::string
@ string
Definition: vtkX3D.h:490
vtkPhyloXMLTreeReader
read vtkTree from PhyloXML formatted file
Definition: vtkPhyloXMLTreeReader.h:51
vtkPhyloXMLTreeReader::GetStringAfterColon
std::string GetStringAfterColon(const char *input)
Return the portion of the input string that occurs after the first colon (:).
vtkPhyloXMLTreeReader::ReadCladeElement
vtkIdType ReadCladeElement(vtkXMLDataElement *element, vtkMutableDirectedGraph *g, vtkIdType parent)
Read a clade element.
vtkBitArray
dynamic, self-adjusting array of bits
Definition: vtkBitArray.h:37
vtkPhyloXMLTreeReader::GetStringBeforeColon
std::string GetStringBeforeColon(const char *input)
Return the portion of the input string that occurs before the first colon (:).
vtkPhyloXMLTreeReader::ReadColorElement
void ReadColorElement(vtkXMLDataElement *element, vtkMutableDirectedGraph *g, vtkIdType vertex)
Read RGB color value for this vertex.
vtkXMLReader
Superclass for VTK's XML format readers.
Definition: vtkXMLReader.h:44
vtkPhyloXMLTreeReader::ReadConfidenceElement
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.
vtkPhyloXMLTreeReader::ReadPropertyElement
void ReadPropertyElement(vtkXMLDataElement *element, vtkMutableDirectedGraph *g, vtkIdType vertex)
Read a property and assign it to our output vtkTree's VertexData for the specified vertex.