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) 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,
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  int FillOutputPortInformation(int, vtkInformation*) override;
164  const char* GetDataSetName() override;
165  void SetOutput(vtkTree *output);
166  void SetupEmptyOutput() override;
167 
168 private:
169  vtkIdType NumberOfNodes;
170  bool HasBranchColor;
171  vtkSmartPointer<vtkBitArray> ColoredVertices;
173  void operator=(const vtkPhyloXMLTreeReader&) = delete;
174 };
175 
176 #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:347
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&#39;s XML format readers.
Definition: vtkXMLReader.h:43