VTK  9.1.0
vtkDataAssemblyVisitor.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkDataAssemblyVisitor.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=========================================================================*/
49#ifndef vtkDataAssemblyVisitor_h
50#define vtkDataAssemblyVisitor_h
51
52#include "vtkCommonDataModelModule.h" // for export macros
53#include "vtkObject.h"
54#include <memory> // for std::unique_ptr
55#include <vector> // for std::vector
56
57class vtkDataAssembly;
58
59class VTKCOMMONDATAMODEL_EXPORT vtkDataAssemblyVisitor : public vtkObject
60{
61public:
63 void PrintSelf(ostream& os, vtkIndent indent) override;
64
65protected:
68
73 const vtkDataAssembly* GetAssembly() const { return this->Assembly; }
74
78 int GetTraversalOrder() const { return this->TraversalOrder; }
79
85 virtual void Visit(int nodeid) = 0;
86
92 virtual bool GetTraverseSubtree(int vtkNotUsed(nodeid)) { return true; }
93
95
98 virtual void BeginSubTree(int vtkNotUsed(nodeid)) {}
99 virtual void EndSubTree(int vtkNotUsed(nodeid)) {}
101
103
108 const char* GetCurrentNodeName() const;
109 std::vector<unsigned int> GetCurrentDataSetIndices() const;
111
112private:
114 void operator=(const vtkDataAssemblyVisitor&) = delete;
115
116 class vtkInternals;
117 std::unique_ptr<vtkInternals> Internals;
118
119 const vtkDataAssembly* Assembly;
120 int TraversalOrder;
121 friend class vtkDataAssembly;
122};
123
124#endif
visitor API for vtkDataAssembly
~vtkDataAssemblyVisitor() override
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
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 vtkNotUsed(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.
virtual void BeginSubTree(int vtkNotUsed(nodeid))
Methods called at the start and end of a subtree traversal.
virtual bool GetTraverseSubtree(int vtkNotUsed(nodeid))
Called to check if the subtree anchored at nodeid is to be traversed.
hierarchical representation to use with vtkPartitionedDataSetCollection
a simple class to control print indentation
Definition: vtkIndent.h:113
abstract base class for most VTK objects
Definition: vtkObject.h:73