VTK  9.4.20251007
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
23
24#ifndef vtkDataObjectTree_h
25#define vtkDataObjectTree_h
26
27#include "vtkCommonDataModelModule.h" // For export macro
28#include "vtkCompositeDataSet.h"
29#include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_3_0
30#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
31
32VTK_ABI_NAMESPACE_BEGIN
36class vtkInformation;
38class vtkDataObject;
39
40class VTKCOMMONDATAMODEL_EXPORT VTK_MARSHALAUTO vtkDataObjectTree : public vtkCompositeDataSet
41{
42public:
44 void PrintSelf(ostream& os, vtkIndent indent) override;
45
50
59
65 void CopyStructure(vtkCompositeDataSet* input) override;
66
73 void SetDataSet(vtkCompositeDataIterator* iter, vtkDataObject* dataObj) override;
74
79
80 // Needed because, otherwise vtkCompositeData::GetDataSet(unsigned int flatIndex) is hidden.
89
99
107
112 unsigned long GetActualMemorySize() override;
113
117 void Initialize() override;
118
120
124 void ShallowCopy(vtkDataObject* src) override;
125 void DeepCopy(vtkDataObject* src) override;
127
131 VTK_DEPRECATED_IN_9_3_0("Please use ShallowCopy instead.")
133
140
147
151 unsigned int GetNumberOfChildren();
152
156 vtkDataObject* GetChild(unsigned int index);
157
163 vtkInformation* GetChildMetaData(unsigned int index);
164
169 vtkTypeBool HasChildMetaData(unsigned int index);
170
172
178
182 int GetDataObjectType() override { return VTK_DATA_OBJECT_TREE; }
183
184protected:
187
191 void SetNumberOfChildren(unsigned int num);
192
197 void SetChild(unsigned int index, vtkDataObject*);
198
202 void RemoveChild(unsigned int index);
203
207 void SetChildMetaData(unsigned int index, vtkInformation* info);
208
216
217 // The internal datastructure. Subclasses need not access this directly.
219
221
222private:
223 vtkDataObjectTree(const vtkDataObjectTree&) = delete;
224 void operator=(const vtkDataObjectTree&) = delete;
225};
226
227VTK_ABI_NAMESPACE_END
228#endif
superclass for composite data iterators
virtual vtkDataObject * GetDataSet(vtkCompositeDataIterator *iter)=0
Returns the dataset located at the position pointed by the iterator.
superclass for composite data iterators
void SetChildMetaData(unsigned int index, vtkInformation *info)
Sets the meta-data at a given index.
vtkTypeBool HasChildMetaData(unsigned int index)
Returns if meta-data information is available for the given child index.
vtkCompositeDataIterator * NewIterator() override
Return a new iterator (the iterator has to be deleted by user).
void RecursiveShallowCopy(vtkDataObject *src) override
void SetDataSet(vtkCompositeDataIterator *iter, vtkDataObject *dataObj) override
Sets the data set at the location pointed by the iterator.
vtkDataObject * GetChild(unsigned int index)
Returns a child dataset at a given index.
friend class vtkDataObjectTreeIterator
vtkIdType GetNumberOfCells() override
Returns the total number of cells of all blocks.
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.
unsigned int GetNumberOfChildren()
Get the number of children.
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.
vtkIdType GetNumberOfPoints() override
Returns the total number of points of all blocks.
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
static vtkDataObjectTree * GetData(vtkInformation *info)
Retrieve an instance of this class from an information object.
int GetDataObjectType() override
Overridden to return VTK_DATA_OBJECT_TREE.
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.
vtkInformation * GetChildMetaData(unsigned int index)
Returns the meta-data at a given index.
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:29
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