VTK  9.6.1
vtkTree.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-FileCopyrightText: Copyright 2008 Sandia Corporation
3// SPDX-License-Identifier: LicenseRef-BSD-3-Clause-Sandia-USGov
35
36#ifndef vtkTree_h
37#define vtkTree_h
38
39#include "vtkCommonDataModelModule.h" // For export macro
41#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
42
43VTK_ABI_NAMESPACE_BEGIN
44class vtkIdTypeArray;
45
46class VTKCOMMONDATAMODEL_EXPORT VTK_MARSHALAUTO vtkTree : public vtkDirectedAcyclicGraph
47{
48public:
49 static vtkTree* New();
51 void PrintSelf(ostream& os, vtkIndent indent) override;
52
56 int GetDataObjectType() VTK_FUTURE_CONST override { return VTK_TREE; }
57
59
62 vtkGetMacro(Root, vtkIdType);
63 vtkSetMacro(Root, vtkIdType);
65
70
75
82
87
92
99
103 bool IsLeaf(vtkIdType vertex);
104
106
110 static vtkTree* GetData(vtkInformationVector* v, int i = 0);
112
119 virtual void ReorderChildren(vtkIdType parent, vtkIdTypeArray* children);
120
121protected:
123 ~vtkTree() override;
124
129 bool IsStructureValid(vtkGraph* g) override;
130
135
136private:
137 vtkTree(const vtkTree&) = delete;
138 void operator=(const vtkTree&) = delete;
139};
140
141VTK_ABI_NAMESPACE_END
142#endif
virtual vtkIdType GetOutDegree(vtkIdType v)
The number of outgoing edges from vertex v.
virtual void GetAdjacentVertices(vtkIdType v, vtkAdjacentVertexIterator *it)
Initializes the adjacent vertex iterator to iterate over all outgoing vertices from vertex v.
friend class vtkAdjacentVertexIterator
Friend iterator classes.
Definition vtkGraph.h:780
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition vtkIndent.h:29
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
int GetDataObjectType() VTK_FUTURE_CONST override
Return what type of dataset this is.
Definition vtkTree.h:56
vtkIdType GetChild(vtkIdType v, vtkIdType i)
Get the i-th child of a parent vertex.
bool IsStructureValid(vtkGraph *g) override
Check the storage, and accept it if it is a valid tree.
vtkIdType GetNumberOfChildren(vtkIdType v)
Get the number of children of a vertex.
Definition vtkTree.h:69
static vtkTree * GetData(vtkInformationVector *v, int i=0)
Retrieve a graph from an information vector.
virtual void ReorderChildren(vtkIdType parent, vtkIdTypeArray *children)
Reorder the children of a parent vertex.
static vtkTree * New()
vtkEdgeType GetParentEdge(vtkIdType v)
Get the edge connecting the vertex to its parent.
static vtkTree * GetData(vtkInformation *info)
Retrieve a graph from an information vector.
void GetChildren(vtkIdType v, vtkAdjacentVertexIterator *it)
Get the child vertices of a vertex.
Definition vtkTree.h:81
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkIdType Root
The root of the tree.
Definition vtkTree.h:134
vtkIdType GetParent(vtkIdType v)
Get the parent of a vertex.
vtkIdType GetLevel(vtkIdType v)
Get the level of the vertex in the tree.
bool IsLeaf(vtkIdType vertex)
Return whether the vertex is a leaf (i.e.
~vtkTree() override
int vtkIdType
Definition vtkType.h:368
@ VTK_TREE
Definition vtkType.h:134
#define VTK_MARSHALAUTO