VTK
vtkTree.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkTree.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 =========================================================================*/
15 /*-------------------------------------------------------------------------
16  Copyright 2008 Sandia Corporation.
17  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
18  the U.S. Government retains certain rights in this software.
19 -------------------------------------------------------------------------*/
51 #ifndef __vtkTree_h
52 #define __vtkTree_h
53 
55 
56 class vtkIdTypeArray;
57 
59 {
60 public:
61  static vtkTree *New();
63  void PrintSelf(ostream& os, vtkIndent indent);
64 
66  virtual int GetDataObjectType() {return VTK_TREE;}
67 
69 
70  vtkGetMacro(Root, vtkIdType);
72 
74 
76  { return this->GetOutDegree(v); }
78 
80  vtkIdType GetChild(vtkIdType v, vtkIdType i);
81 
83 
86  { this->GetAdjacentVertices(v, it); }
88 
90  vtkIdType GetParent(vtkIdType v);
91 
92 //BTX
94 
95  vtkEdgeType GetParentEdge(vtkIdType v);
96 //ETX
98 
102  vtkIdType GetLevel(vtkIdType v);
103 
105  bool IsLeaf(vtkIdType vertex);
106 
107  //BTX
109 
110  static vtkTree *GetData(vtkInformation *info);
111  static vtkTree *GetData(vtkInformationVector *v, int i=0);
112  //ETX
114 
118  virtual void ReorderChildren(vtkIdType parent, vtkIdTypeArray *children);
119 
120 protected:
121  vtkTree();
122  ~vtkTree();
123 
125  virtual bool IsStructureValid(vtkGraph *g);
126 
129 
130 private:
131  vtkTree(const vtkTree&); // Not implemented.
132  void operator=(const vtkTree&); // Not implemented.
133 };
134 
135 #endif
vtkIdType GetNumberOfChildren(vtkIdType v)
Definition: vtkTree.h:75
Store vtkAlgorithm input/output information.
#define VTK_FILTERING_EXPORT
void PrintSelf(ostream &os, vtkIndent indent)
Iterates through adjacent vertices in a graph.
static vtkDirectedAcyclicGraph * New()
dynamic, self-adjusting array of vtkIdType
int vtkIdType
Definition: vtkType.h:255
virtual void GetAdjacentVertices(vtkIdType v, vtkAdjacentVertexIterator *it)
Base class for graph data types.
Definition: vtkGraph.h:287
virtual bool IsStructureValid(vtkGraph *g)
a simple class to control print indentation
Definition: vtkIndent.h:37
vtkIdType Root
Definition: vtkTree.h:128
static vtkDirectedAcyclicGraph * GetData(vtkInformation *info)
Store zero or more vtkInformation instances.
void GetChildren(vtkIdType v, vtkAdjacentVertexIterator *it)
Definition: vtkTree.h:85
A rooted tree data structure.
Definition: vtkTree.h:58
A rooted tree data structure.
virtual int GetDataObjectType()
Definition: vtkTree.h:66
#define VTK_TREE
Definition: vtkType.h:87
virtual vtkIdType GetOutDegree(vtkIdType v)