VTK  9.2.6
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 
57 class vtkDataAssembly;
58 
59 class VTKCOMMONDATAMODEL_EXPORT vtkDataAssemblyVisitor : public vtkObject
60 {
61 public:
63  void PrintSelf(ostream& os, vtkIndent indent) override;
64 
65 protected:
67  ~vtkDataAssemblyVisitor() override;
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 
112 private:
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
abstract base class for most VTK objects
Definition: vtkObject.h:62
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void EndSubTree(int vtkNotUsed(nodeid))
Methods called at the start and end of a subtree traversal.
visitor API for vtkDataAssembly
a simple class to control print indentation
Definition: vtkIndent.h:39
virtual bool GetTraverseSubtree(int vtkNotUsed(nodeid))
Called to check if the subtree anchored at nodeid is to be traversed.
int GetTraversalOrder() const
Returns the current traversal order.
hierarchical representation to use with vtkPartitionedDataSetCollection
virtual void BeginSubTree(int vtkNotUsed(nodeid))
Methods called at the start and end of a subtree traversal.
const vtkDataAssembly * GetAssembly() const
Provides access to the assembly during traversal, otherwise returns nullptr.