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 
54 #include "vtkCommonDataModelModule.h" // For export macro
56 
57 class vtkIdTypeArray;
58 
60 {
61 public:
62  static vtkTree *New();
64  void PrintSelf(ostream& os, vtkIndent indent);
65 
67  virtual int GetDataObjectType() {return VTK_TREE;}
68 
70 
71  vtkGetMacro(Root, vtkIdType);
73 
75 
77  { return this->GetOutDegree(v); }
79 
81  vtkIdType GetChild(vtkIdType v, vtkIdType i);
82 
84 
87  { this->GetAdjacentVertices(v, it); }
89 
91  vtkIdType GetParent(vtkIdType v);
92 
93 //BTX
95 
96  vtkEdgeType GetParentEdge(vtkIdType v);
97 //ETX
99 
103  vtkIdType GetLevel(vtkIdType v);
104 
106  bool IsLeaf(vtkIdType vertex);
107 
108  //BTX
110 
112  static vtkTree *GetData(vtkInformationVector *v, int i=0);
113  //ETX
115 
119  virtual void ReorderChildren(vtkIdType parent, vtkIdTypeArray *children);
120 
121 protected:
122  vtkTree();
123  ~vtkTree();
124 
126  virtual bool IsStructureValid(vtkGraph *g);
127 
130 
131 private:
132  vtkTree(const vtkTree&); // Not implemented.
133  void operator=(const vtkTree&); // Not implemented.
134 };
135 
136 #endif
vtkIdType GetNumberOfChildren(vtkIdType v)
Definition: vtkTree.h:76
Store vtkAlgorithm input/output information.
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:275
virtual void GetAdjacentVertices(vtkIdType v, vtkAdjacentVertexIterator *it)
Base class for graph data types.
Definition: vtkGraph.h:288
virtual bool IsStructureValid(vtkGraph *g)
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkIdType Root
Definition: vtkTree.h:129
static vtkDirectedAcyclicGraph * GetData(vtkInformation *info)
Store zero or more vtkInformation instances.
void GetChildren(vtkIdType v, vtkAdjacentVertexIterator *it)
Definition: vtkTree.h:86
A rooted tree data structure.
Definition: vtkTree.h:59
A rooted tree data structure.
virtual int GetDataObjectType()
Definition: vtkTree.h:67
#define VTKCOMMONDATAMODEL_EXPORT
#define VTK_TREE
Definition: vtkType.h:87
virtual vtkIdType GetOutDegree(vtkIdType v)