VTK  9.3.20240619
vtkDataObjectTree.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
43#ifndef vtkDataObjectTree_h
44#define vtkDataObjectTree_h
45
46#include "vtkCommonDataModelModule.h" // For export macro
47#include "vtkCompositeDataSet.h"
48#include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_3_0
49#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
50
51VTK_ABI_NAMESPACE_BEGIN
55class vtkInformation;
57class vtkDataObject;
58
59class VTKCOMMONDATAMODEL_EXPORT VTK_MARSHALAUTO vtkDataObjectTree : public vtkCompositeDataSet
60{
61public:
63 void PrintSelf(ostream& os, vtkIndent indent) override;
64
69
78
84 void CopyStructure(vtkCompositeDataSet* input) override;
85
92 void SetDataSet(vtkCompositeDataIterator* iter, vtkDataObject* dataObj) override;
93
98
99 // Needed because, otherwise vtkCompositeData::GetDataSet(unsigned int flatIndex) is hidden.
100 using Superclass::GetDataSet;
108
118
126
131 unsigned long GetActualMemorySize() override;
132
136 void Initialize() override;
137
139
143 void ShallowCopy(vtkDataObject* src) override;
144 void DeepCopy(vtkDataObject* src) override;
146
150 VTK_DEPRECATED_IN_9_3_0("Please use ShallowCopy instead.")
151 void RecursiveShallowCopy(vtkDataObject* src) override;
152
158 vtkIdType GetNumberOfPoints() override;
159
165 vtkIdType GetNumberOfCells() override;
166
170 unsigned int GetNumberOfChildren();
171
175 vtkDataObject* GetChild(unsigned int index);
176
182 vtkInformation* GetChildMetaData(unsigned int index);
183
188 vtkTypeBool HasChildMetaData(unsigned int index);
189
191
194 static vtkDataObjectTree* GetData(vtkInformation* info);
195 static vtkDataObjectTree* GetData(vtkInformationVector* v, int i = 0);
197
201 int GetDataObjectType() override { return VTK_DATA_OBJECT_TREE; }
202
203protected:
206
210 void SetNumberOfChildren(unsigned int num);
211
216 void SetChild(unsigned int index, vtkDataObject*);
217
221 void RemoveChild(unsigned int index);
222
226 void SetChildMetaData(unsigned int index, vtkInformation* info);
227
235
236 // The internal datastructure. Subclasses need not access this directly.
238
240
241private:
242 vtkDataObjectTree(const vtkDataObjectTree&) = delete;
243 void operator=(const vtkDataObjectTree&) = delete;
244};
245
246VTK_ABI_NAMESPACE_END
247#endif
superclass for composite data iterators
abstract superclass for composite (multi-block or AMR) datasets
superclass for composite data iterators
provides implementation for most abstract methods in the superclass vtkCompositeDataSet
void SetChildMetaData(unsigned int index, vtkInformation *info)
Sets the meta-data at a given index.
vtkCompositeDataIterator * NewIterator() override
Return a new iterator (the iterator has to be deleted by user).
void SetDataSet(vtkCompositeDataIterator *iter, vtkDataObject *dataObj) override
Sets the data set at the location pointed by the iterator.
vtkDataObjectTreeInternals * Internals
virtual vtkDataObjectTreeIterator * NewTreeIterator()
Return a new iterator (the iterator has to be deleted by user).
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void Initialize() override
Restore data object to initial state,.
virtual vtkDataObjectTree * CreateForCopyStructure(vtkDataObjectTree *other)
When copying structure from another vtkDataObjectTree, this method gets called for create a new non-l...
void DeepCopy(vtkDataObject *src) override
CompositeShallow, Shallow and Deep copy.
unsigned long GetActualMemorySize() override
Return the actual size of the data in kibibytes (1024 bytes).
void SetChild(unsigned int index, vtkDataObject *)
Set child dataset at a given index.
vtkDataObject * GetDataSet(vtkCompositeDataIterator *iter) override
Returns the dataset located at the position pointed by the iterator.
virtual vtkInformation * GetMetaData(vtkCompositeDataIterator *iter)
Returns the meta-data associated with the position pointed by the iterator.
void CompositeShallowCopy(vtkCompositeDataSet *src) override
CompositeShallow, Shallow and Deep copy.
void SetDataSetFrom(vtkDataObjectTreeIterator *iter, vtkDataObject *dataObj)
Sets the data at the location provided by a vtkDataObjectTreeIterator.
void SetNumberOfChildren(unsigned int num)
Set the number of children.
void CopyStructure(vtkCompositeDataSet *input) override
Copies the tree structure from the input.
~vtkDataObjectTree() override
void RemoveChild(unsigned int index)
Remove the child at a given index.
virtual vtkTypeBool HasMetaData(vtkCompositeDataIterator *iter)
Returns if any meta-data associated with the position pointed by the iterator.
void ShallowCopy(vtkDataObject *src) override
CompositeShallow, Shallow and Deep copy.
general representation of visualization data
a simple class to control print indentation
Definition vtkIndent.h:108
Key for string values in vtkInformation.
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_DEPRECATED_IN_9_3_0(reason)
#define VTK_DATA_OBJECT_TREE
Definition vtkType.h:106
int vtkIdType
Definition vtkType.h:315
#define VTK_MARSHALAUTO
#define VTK_NEWINSTANCE