VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkNewickTreeReader.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00033 #ifndef __vtkNewickTreeReader_h 00034 #define __vtkNewickTreeReader_h 00035 00036 #include "vtkIOInfovisModule.h" // For export macro 00037 #include "vtkDataReader.h" 00038 00039 class vtkDoubleArray; 00040 class vtkMutableDirectedGraph; 00041 class vtkStringArray; 00042 class vtkTree; 00043 00044 class VTKIOINFOVIS_EXPORT vtkNewickTreeReader : public vtkDataReader 00045 { 00046 public: 00047 static vtkNewickTreeReader *New(); 00048 vtkTypeMacro(vtkNewickTreeReader,vtkDataReader); 00049 void PrintSelf(ostream& os, vtkIndent indent); 00050 00052 00053 vtkTree *GetOutput(); 00054 vtkTree *GetOutput(int idx); 00055 void SetOutput(vtkTree *output); 00056 int ReadNewickTree(const char * buffer, vtkTree & tree); 00058 00059 protected: 00060 vtkNewickTreeReader(); 00061 ~vtkNewickTreeReader(); 00062 00063 virtual int RequestData(vtkInformation *, vtkInformationVector **, 00064 vtkInformationVector *); 00065 00066 // Since the Outputs[0] has the same UpdateExtent format 00067 // as the generic DataObject we can copy the UpdateExtent 00068 // as a default behavior. 00069 virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, 00070 vtkInformationVector *); 00071 00072 virtual int FillOutputPortInformation(int, vtkInformation*); 00073 void CountNodes(const char * buffer, vtkIdType *numNodes); 00074 vtkIdType BuildTree(char *buffer, vtkMutableDirectedGraph *g, 00075 vtkDoubleArray *weights, vtkStringArray *names, vtkIdType parent); 00076 private: 00077 vtkNewickTreeReader(const vtkNewickTreeReader&); // Not implemented. 00078 void operator=(const vtkNewickTreeReader&); // Not implemented. 00079 }; 00080 00081 #endif