VTK  9.1.0
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=========================================================================*/
23#ifndef vtkPhyloXMLTreeWriter_h
24#define vtkPhyloXMLTreeWriter_h
25
26#include "vtkIOInfovisModule.h" // For export macro
27#include "vtkSmartPointer.h" // For SP ivars
28#include "vtkStdString.h" // For get/set ivars
29#include "vtkXMLWriter.h"
30
31class vtkStringArray;
32class vtkTree;
34
35class VTKIOINFOVIS_EXPORT vtkPhyloXMLTreeWriter : public vtkXMLWriter
36{
37public:
40 void PrintSelf(ostream& os, vtkIndent indent) override;
41
43
49
53 const char* GetDefaultFileExtension() override;
54
56
63 vtkGetMacro(EdgeWeightArrayName, vtkStdString);
64 vtkSetMacro(EdgeWeightArrayName, vtkStdString);
66
68
75 vtkGetMacro(NodeNameArrayName, vtkStdString);
76 vtkSetMacro(NodeNameArrayName, vtkStdString);
78
84 void IgnoreArray(const char* arrayName);
85
86protected:
88 ~vtkPhyloXMLTreeWriter() override = default;
89
90 int WriteData() override;
91
92 const char* GetDataSetName() override;
93 int StartFile() override;
94 int EndFile() override;
95
101 const char* elementName, const char* attributeName);
102
107
112 void WriteCladeElement(vtkTree* const input, vtkIdType vertex, vtkXMLDataElement* parentElement);
113
118 vtkTree* const input, vtkIdType vertex, vtkXMLDataElement* element);
119
124
128 void WriteConfidenceElement(vtkTree* const input, vtkIdType vertex, vtkXMLDataElement* element);
129
134 void WriteColorElement(vtkTree* const input, vtkIdType vertex, vtkXMLDataElement* element);
135
140
145 const char* GetArrayAttribute(vtkAbstractArray* array, const char* attributeName);
146
148
150
153
157
158private:
160 void operator=(const vtkPhyloXMLTreeWriter&) = delete;
161};
162
163#endif
Abstract superclass for all arrays.
a simple class to control print indentation
Definition: vtkIndent.h:113
Store vtkAlgorithm input/output information.
write vtkTree data to PhyloXML format.
void WriteNameElement(vtkIdType vertex, vtkXMLDataElement *element)
Write the name element for the specified vertex.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
const char * GetDataSetName() override
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.
const char * GetDefaultFileExtension() override
Get the default file extension for files written by this writer.
int StartFile() override
void WriteConfidenceElement(vtkTree *const input, vtkIdType vertex, vtkXMLDataElement *element)
Write the confidence element for the specified vertex.
vtkTree * GetInput(int port)
Get the input to this writer.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
static vtkPhyloXMLTreeWriter * New()
void WriteTreeLevelProperties(vtkTree *input, vtkXMLDataElement *rootElement)
Search for any tree-level properties and write them out if they are found.
int WriteData() override
vtkSmartPointer< vtkStringArray > Blacklist
void IgnoreArray(const char *arrayName)
Do not include name the VertexData array in the PhyloXML output of this writer.
vtkInformation * InputInformation
int EndFile() override
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.
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.
~vtkPhyloXMLTreeWriter() override=default
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:105
a vtkAbstractArray subclass for strings
A rooted tree data structure.
Definition: vtkTree.h:164
Represents an XML element and those nested inside.
Superclass for VTK's XML file writers.
Definition: vtkXMLWriter.h:62
@ info
Definition: vtkX3D.h:382
@ port
Definition: vtkX3D.h:453
int vtkIdType
Definition: vtkType.h:332