VTK: Common/DataModel/vtkDataAssemblyVisitor.h Source File

| VTK 9.3.1

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
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
45 VTK_ABI_NAMESPACE_BEGIN
46 class vtkDataAssembly;
47
48 class VTKCOMMONDATAMODEL_EXPORT vtkDataAssemblyVisitor : public vtkObject
49 {
50 public:
51 vtkTypeMacro(vtkDataAssemblyVisitor, vtkObject);
52 void PrintSelf(ostream& os, vtkIndent indent) override;
53
54 protected:
55 vtkDataAssemblyVisitor();
56 ~vtkDataAssemblyVisitor() override;
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<unsigned int> GetCurrentDataSetIndices() const;
100
101 private:
102 vtkDataAssemblyVisitor(const vtkDataAssemblyVisitor&) = delete;
103 void operator=(const vtkDataAssemblyVisitor&) = delete;
104
105 class vtkInternals;
106 std::unique_ptr<vtkInternals> Internals;
107
108 const vtkDataAssembly* Assembly;
109 int TraversalOrder;
110 friend class vtkDataAssembly;
111 };
112
113 VTK_ABI_NAMESPACE_END
114 #endif
vtkDataAssemblyVisitor
visitor API for vtkDataAssembly
Definition: vtkDataAssemblyVisitor.h:49
vtkDataAssemblyVisitor::~vtkDataAssemblyVisitor
~vtkDataAssemblyVisitor() override
vtkDataAssemblyVisitor::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkDataAssemblyVisitor::GetTraversalOrder
int GetTraversalOrder() const
Returns the current traversal order.
Definition: vtkDataAssemblyVisitor.h:67
vtkDataAssemblyVisitor::EndSubTree
virtual void EndSubTree(int vtkNotUsed(nodeid))
Methods called at the start and end of a subtree traversal.
Definition: vtkDataAssemblyVisitor.h:88
vtkDataAssemblyVisitor::GetAssembly
const vtkDataAssembly * GetAssembly() const
Provides access to the assembly during traversal, otherwise returns nullptr.
Definition: vtkDataAssemblyVisitor.h:62
vtkDataAssemblyVisitor::Visit
virtual void Visit(int nodeid)=0
Called on every node being visited.
vtkDataAssemblyVisitor::BeginSubTree
virtual void BeginSubTree(int vtkNotUsed(nodeid))
Methods called at the start and end of a subtree traversal.
Definition: vtkDataAssemblyVisitor.h:87
vtkDataAssemblyVisitor::vtkDataAssemblyVisitor
vtkDataAssemblyVisitor()
vtkDataAssemblyVisitor::GetCurrentDataSetIndices
std::vector< unsigned int > GetCurrentDataSetIndices() const
API to access information from the current node being processed.
vtkDataAssemblyVisitor::GetTraverseSubtree
virtual bool GetTraverseSubtree(int vtkNotUsed(nodeid))
Called to check if the subtree anchored at nodeid is to be traversed.
Definition: vtkDataAssemblyVisitor.h:81
vtkDataAssemblyVisitor::GetCurrentNodeName
const char * GetCurrentNodeName() const
API to access information from the current node being processed.
vtkDataAssembly
hierarchical representation to use with vtkPartitionedDataSetCollection
Definition: vtkDataAssembly.h:123
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:61
vtkObject.h