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:
53  static vtkPhyloXMLTreeReader *New();
55  void PrintSelf(ostream& os, vtkIndent indent);
56 
58 
61  vtkTree *GetOutput();
62  vtkTree *GetOutput(int idx);
64 
65 protected:
68 
72  virtual void ReadXMLData();
73 
79  void ReadXMLElement(vtkXMLDataElement *element, vtkMutableDirectedGraph *g,
80  vtkIdType vertex);
81 
88  vtkIdType ReadCladeElement(vtkXMLDataElement *element,
90 
95  void ReadNameElement(vtkXMLDataElement *element, vtkMutableDirectedGraph *g,
96  vtkIdType vertex);
97 
101  void ReadDescriptionElement(vtkXMLDataElement *element,
103 
109  void ReadPropertyElement(vtkXMLDataElement *element,
111 
117  void ReadBranchLengthElement(vtkXMLDataElement *element,
119 
124  void ReadConfidenceElement(vtkXMLDataElement *element,
126 
131  void ReadColorElement(vtkXMLDataElement *element, vtkMutableDirectedGraph *g,
132  vtkIdType vertex);
133 
138  void PropagateBranchColor(vtkTree *tree);
139 
143  void CountNodes(vtkXMLDataElement *element);
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 
163  virtual int FillOutputPortInformation(int, vtkInformation*);
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
virtual const char * GetDataSetName()=0
virtual void SetupEmptyOutput()=0
Represents an XML element and those nested inside.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
Store vtkAlgorithm input/output information.
virtual void ReadXMLData()
int vtkIdType
Definition: vtkType.h:287
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
static vtkAlgorithm * New()
A rooted tree data structure.
Definition: vtkTree.h:60
Superclass for VTK's XML format readers.
Definition: vtkXMLReader.h:43