VTK  9.5.20251215
vtkDataAssemblyVisitor.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
36
37#ifndef vtkDataAssemblyVisitor_h
38#define vtkDataAssemblyVisitor_h
39
40#include "vtkCommonDataModelModule.h" // for export macros
41#include "vtkObject.h"
42#include <memory> // for std::unique_ptr
43#include <vector> // for std::vector
44
45VTK_ABI_NAMESPACE_BEGIN
46class vtkDataAssembly;
47
48class VTKCOMMONDATAMODEL_EXPORT vtkDataAssemblyVisitor : public vtkObject
49{
50public:
52 void PrintSelf(ostream& os, vtkIndent indent) override;
53
54protected:
57
62 const vtkDataAssembly* GetAssembly() const { return this->Assembly; }
63
67 int GetTraversalOrder() const { return this->TraversalOrder; }
68
74 virtual void Visit(int nodeid) = 0;
75
81 virtual bool GetTraverseSubtree(int vtkNotUsed(nodeid)) { return true; }
82
84
87 virtual void BeginSubTree(int vtkNotUsed(nodeid)) {}
88 virtual void EndSubTree(int vtkNotUsed(nodeid)) {}
90
92
97 const char* GetCurrentNodeName() const;
98 std::vector<std::string> GetCurrentNodePath() const;
99 std::vector<unsigned int> GetCurrentDataSetIndices() const;
101
102private:
104 void operator=(const vtkDataAssemblyVisitor&) = delete;
105
106 class vtkInternals;
107 std::unique_ptr<vtkInternals> Internals;
108
109 const vtkDataAssembly* Assembly;
110 int TraversalOrder;
111 friend class vtkDataAssembly;
112};
113
114VTK_ABI_NAMESPACE_END
115#endif
~vtkDataAssemblyVisitor() override
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void BeginSubTree(int nodeid)
Methods called at the start and end of a subtree traversal.
std::vector< std::string > GetCurrentNodePath() const
API to access information from the current node being processed.
virtual bool GetTraverseSubtree(int nodeid)
Called to check if the subtree anchored at nodeid is to be traversed.
int GetTraversalOrder() const
Returns the current traversal order.
std::vector< unsigned int > GetCurrentDataSetIndices() const
API to access information from the current node being processed.
const char * GetCurrentNodeName() const
API to access information from the current node being processed.
virtual void EndSubTree(int nodeid)
Methods called at the start and end of a subtree traversal.
virtual void Visit(int nodeid)=0
Called on every node being visited.
const vtkDataAssembly * GetAssembly() const
Provides access to the assembly during traversal, otherwise returns nullptr.
hierarchical representation to use with vtkPartitionedDataSetCollection
a simple class to control print indentation
Definition vtkIndent.h:108