VTK
vtkPhyloXMLTreeWriter.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkPhyloXMLTreeWriter.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=========================================================================*/
26#ifndef vtkPhyloXMLTreeWriter_h
27#define vtkPhyloXMLTreeWriter_h
28
29#include "vtkIOInfovisModule.h" // For export macro
30#include "vtkXMLWriter.h"
31#include "vtkSmartPointer.h" // For SP ivars
32#include "vtkStdString.h" // For get/set ivars
33
34class vtkStringArray;
35class vtkTree;
37
38class VTKIOINFOVIS_EXPORT vtkPhyloXMLTreeWriter : public vtkXMLWriter
39{
40public:
43 void PrintSelf(ostream& os, vtkIndent indent);
44
46
52
56 virtual const char* GetDefaultFileExtension();
57
59
66 vtkGetMacro(EdgeWeightArrayName, vtkStdString);
67 vtkSetMacro(EdgeWeightArrayName, vtkStdString);
69
71
78 vtkGetMacro(NodeNameArrayName, vtkStdString);
79 vtkSetMacro(NodeNameArrayName, vtkStdString);
81
87 void IgnoreArray(const char * arrayName);
88
89protected:
92
93 virtual int WriteData();
94
95 virtual const char* GetDataSetName();
96 virtual int StartFile();
97 virtual int EndFile();
98
104 vtkXMLDataElement *rootElement,
105 const char *elementName,
106 const char *attributeName);
107
112
117 void WriteCladeElement(vtkTree* const input, vtkIdType vertex,
118 vtkXMLDataElement *parentElement);
119
124 vtkXMLDataElement *element);
125
130
134 void WriteConfidenceElement(vtkTree* const input, vtkIdType vertex,
135 vtkXMLDataElement *element);
136
141 void WriteColorElement(vtkTree* const input, vtkIdType vertex,
142 vtkXMLDataElement *element);
143
148 vtkXMLDataElement *element);
149
155 const char *attributeName);
156
158
160
163
167
168private:
169 vtkPhyloXMLTreeWriter(const vtkPhyloXMLTreeWriter&) VTK_DELETE_FUNCTION;
170 void operator=(const vtkPhyloXMLTreeWriter&) VTK_DELETE_FUNCTION;
171};
172
173#endif
Abstract superclass for all arrays.
a simple class to control print indentation
Definition: vtkIndent.h:40
Store vtkAlgorithm input/output information.
write vtkTree data to PhyloXML format.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
void WriteNameElement(vtkIdType vertex, vtkXMLDataElement *element)
Write the name element for the specified vertex.
vtkAbstractArray * EdgeWeightArray
void WriteTreeLevelElement(vtkTree *input, vtkXMLDataElement *rootElement, const char *elementName, const char *attributeName)
Check for an optional, tree-level element and write it out if it is found.
virtual const char * GetDataSetName()
virtual int WriteData()
void WriteConfidenceElement(vtkTree *const input, vtkIdType vertex, vtkXMLDataElement *element)
Write the confidence element for the specified vertex.
vtkTree * GetInput(int port)
static vtkPhyloXMLTreeWriter * New()
void WriteTreeLevelProperties(vtkTree *input, vtkXMLDataElement *rootElement)
Search for any tree-level properties and write them out if they are found.
virtual const char * GetDefaultFileExtension()
Get the default file extension for files written by this writer.
virtual int EndFile()
vtkSmartPointer< vtkStringArray > Blacklist
void IgnoreArray(const char *arrayName)
Do not include name the VertexData array in the PhyloXML output of this writer.
vtkInformation * InputInformation
virtual int StartFile()
void WriteCladeElement(vtkTree *const input, vtkIdType vertex, vtkXMLDataElement *parentElement)
Convert one vertex to PhyloXML.
vtkAbstractArray * NodeNameArray
void WriteBranchLengthAttribute(vtkTree *const input, vtkIdType vertex, vtkXMLDataElement *element)
Write the branch length attribute for the specified vertex.
virtual int FillInputPortInformation(int port, vtkInformation *info)
Fill the input port information objects for this algorithm.
vtkTree * GetInput()
Get the input to this writer.
const char * GetArrayAttribute(vtkAbstractArray *array, const char *attributeName)
Get the value of the requested attribute from the specified array's vtkInformation.
void WritePropertyElement(vtkAbstractArray *array, vtkIdType vertex, vtkXMLDataElement *element)
Write a property element as a child of the specified vtkXMLDataElement.
void WriteColorElement(vtkTree *const input, vtkIdType vertex, vtkXMLDataElement *element)
Write the color element and its subelements (red, green, blue) for the specified vertex.
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:49
a vtkAbstractArray subclass for strings
A rooted tree data structure.
Definition: vtkTree.h:61
Represents an XML element and those nested inside.
Superclass for VTK's XML file writers.
Definition: vtkXMLWriter.h:54
@ info
Definition: vtkX3D.h:376
@ port
Definition: vtkX3D.h:447
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
int vtkIdType
Definition: vtkType.h:287