VTK: Common/DataModel/vtkDataObjectTree.h Source File

| VTK 9.3.1

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
33 #ifndef vtkDataObjectTree_h
34 #define vtkDataObjectTree_h
35
36 #include "vtkCommonDataModelModule.h" // For export macro
37 #include "vtkCompositeDataSet.h"
38 #include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_3_0
39
40 VTK_ABI_NAMESPACE_BEGIN
41 class vtkCompositeDataIterator;
42 class vtkDataObjectTreeIterator;
43 class vtkDataObjectTreeInternals;
44 class vtkInformation;
45 class vtkInformationStringKey;
46 class vtkDataObject;
47
48 class VTKCOMMONDATAMODEL_EXPORT vtkDataObjectTree : public vtkCompositeDataSet
49 {
50 public:
51 vtkTypeMacro(vtkDataObjectTree, vtkCompositeDataSet);
52 void PrintSelf(ostream& os, vtkIndent indent) override;
53
57 VTK_NEWINSTANCE virtual vtkDataObjectTreeIterator* NewTreeIterator();
58
66 VTK_NEWINSTANCE vtkCompositeDataIterator* NewIterator() override;
67
73 void CopyStructure(vtkCompositeDataSet* input) override;
74
81 void SetDataSet(vtkCompositeDataIterator* iter, vtkDataObject* dataObj) override;
82
86 void SetDataSetFrom(vtkDataObjectTreeIterator* iter, vtkDataObject* dataObj);
87
88 // Needed because, otherwise vtkCompositeData::GetDataSet(unsigned int flatIndex) is hidden.
89 using Superclass::GetDataSet;
96 vtkDataObject* GetDataSet(vtkCompositeDataIterator* iter) override;
97
106 virtual vtkInformation* GetMetaData(vtkCompositeDataIterator* iter);
107
114 virtual vtkTypeBool HasMetaData(vtkCompositeDataIterator* iter);
115
120 unsigned long GetActualMemorySize() override;
121
125 void Initialize() override;
126
128
131 void CompositeShallowCopy(vtkCompositeDataSet* src) override;
132 void ShallowCopy(vtkDataObject* src) override;
133 void DeepCopy(vtkDataObject* src) override;
135
139 VTK_DEPRECATED_IN_9_3_0("Please use ShallowCopy instead.")
140 void RecursiveShallowCopy(vtkDataObject* src) override;
141
147 vtkIdType GetNumberOfPoints() override;
148
154 vtkIdType GetNumberOfCells() override;
155
157
160 static vtkDataObjectTree* GetData(vtkInformation* info);
161 static vtkDataObjectTree* GetData(vtkInformationVector* v, int i = 0);
163
167 int GetDataObjectType() override { return VTK_DATA_OBJECT_TREE; }
168
169 protected:
170 vtkDataObjectTree();
171 ~vtkDataObjectTree() override;
172
176 void SetNumberOfChildren(unsigned int num);
177
181 unsigned int GetNumberOfChildren();
182
187 void SetChild(unsigned int index, vtkDataObject*);
188
192 void RemoveChild(unsigned int index);
193
197 vtkDataObject* GetChild(unsigned int index);
198
204 vtkInformation* GetChildMetaData(unsigned int index);
205
209 void SetChildMetaData(unsigned int index, vtkInformation* info);
210
215 vtkTypeBool HasChildMetaData(unsigned int index);
216
223 virtual vtkDataObjectTree* CreateForCopyStructure(vtkDataObjectTree* other);
224
225 // The internal datastructure. Subclasses need not access this directly.
226 vtkDataObjectTreeInternals* Internals;
227
228 friend class vtkDataObjectTreeIterator;
229
230 private:
231 vtkDataObjectTree(const vtkDataObjectTree&) = delete;
232 void operator=(const vtkDataObjectTree&) = delete;
233 };
234
235 VTK_ABI_NAMESPACE_END
236 #endif
vtkCompositeDataIterator
superclass for composite data iterators
Definition: vtkCompositeDataIterator.h:28
vtkCompositeDataSet
abstract superclass for composite (multi-block or AMR) datasets
Definition: vtkCompositeDataSet.h:51
vtkDataObjectTreeInternals
Definition: vtkDataObjectTreeInternals.h:34
vtkDataObjectTreeIterator
superclass for composite data iterators
Definition: vtkDataObjectTreeIterator.h:38
vtkDataObjectTreeIterator::vtkDataObjectTree
friend class vtkDataObjectTree
Definition: vtkDataObjectTreeIterator.h:136
vtkDataObjectTree
provides implementation for most abstract methods in the superclass vtkCompositeDataSet
Definition: vtkDataObjectTree.h:49
vtkDataObjectTree::CreateForCopyStructure
virtual vtkDataObjectTree * CreateForCopyStructure(vtkDataObjectTree *other)
When copying structure from another vtkDataObjectTree, this method gets called for create a new non-l...
vtkDataObjectTree::SetChildMetaData
void SetChildMetaData(unsigned int index, vtkInformation *info)
Sets the meta-data at a given index.
vtkDataObjectTree::HasChildMetaData
vtkTypeBool HasChildMetaData(unsigned int index)
Returns if meta-data information is available for the given child index.
vtkDataObjectTree::GetMetaData
virtual vtkInformation * GetMetaData(vtkCompositeDataIterator *iter)
Returns the meta-data associated with the position pointed by the iterator.
vtkDataObjectTree::SetDataSet
void SetDataSet(vtkCompositeDataIterator *iter, vtkDataObject *dataObj) override
Sets the data set at the location pointed by the iterator.
vtkDataObjectTree::Internals
vtkDataObjectTreeInternals * Internals
Definition: vtkDataObjectTree.h:226
vtkDataObjectTree::GetChildMetaData
vtkInformation * GetChildMetaData(unsigned int index)
Returns the meta-data at a given index.
vtkDataObjectTree::GetDataSet
vtkDataObject * GetDataSet(vtkCompositeDataIterator *iter) override
Returns the dataset located at the position pointed by the iterator.
vtkDataObjectTree::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkDataObjectTree::Initialize
void Initialize() override
Restore data object to initial state,.
vtkDataObjectTree::DeepCopy
void DeepCopy(vtkDataObject *src) override
CompositeShallow, Shallow and Deep copy.
vtkDataObjectTree::GetActualMemorySize
unsigned long GetActualMemorySize() override
Return the actual size of the data in kibibytes (1024 bytes).
vtkDataObjectTree::SetChild
void SetChild(unsigned int index, vtkDataObject *)
Set child dataset at a given index.
vtkDataObjectTree::GetNumberOfChildren
unsigned int GetNumberOfChildren()
Get the number of children.
vtkDataObjectTree::CompositeShallowCopy
void CompositeShallowCopy(vtkCompositeDataSet *src) override
CompositeShallow, Shallow and Deep copy.
vtkDataObjectTree::SetDataSetFrom
void SetDataSetFrom(vtkDataObjectTreeIterator *iter, vtkDataObject *dataObj)
Sets the data at the location provided by a vtkDataObjectTreeIterator.
vtkDataObjectTree::SetNumberOfChildren
void SetNumberOfChildren(unsigned int num)
Set the number of children.
vtkDataObjectTree::CopyStructure
void CopyStructure(vtkCompositeDataSet *input) override
Copies the tree structure from the input.
vtkDataObjectTree::NewIterator
vtkCompositeDataIterator * NewIterator() override
Return a new iterator (the iterator has to be deleted by user).
vtkDataObjectTree::vtkDataObjectTree
vtkDataObjectTree()
vtkDataObjectTree::~vtkDataObjectTree
~vtkDataObjectTree() override
vtkDataObjectTree::RemoveChild
void RemoveChild(unsigned int index)
Remove the child at a given index.
vtkDataObjectTree::HasMetaData
virtual vtkTypeBool HasMetaData(vtkCompositeDataIterator *iter)
Returns if any meta-data associated with the position pointed by the iterator.
vtkDataObjectTree::NewTreeIterator
virtual vtkDataObjectTreeIterator * NewTreeIterator()
Return a new iterator (the iterator has to be deleted by user).
vtkDataObjectTree::ShallowCopy
void ShallowCopy(vtkDataObject *src) override
CompositeShallow, Shallow and Deep copy.
vtkDataObjectTree::GetChild
vtkDataObject * GetChild(unsigned int index)
Returns a child dataset at a given index.
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:64
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkInformationStringKey
Key for string values in vtkInformation.
Definition: vtkInformationStringKey.h:26
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:40
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:72
vtkIOSSUtilities::GetData
vtkSmartPointer< vtkDataArray > GetData(const Ioss::GroupingEntity *entity, const std::string &fieldname, Ioss::Transform *transform=nullptr, Cache *cache=nullptr, const std::string &cachekey=std::string())
Returns a VTK array for a given field (fieldname) on the chosen block (or set) entity.
vtkX3D::info
@ info
Definition: vtkX3D.h:376
vtkX3D::index
@ index
Definition: vtkX3D.h:246
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:64
vtkCompositeDataSet.h
vtkDeprecation.h
VTK_DEPRECATED_IN_9_3_0
#define VTK_DEPRECATED_IN_9_3_0(reason)
Definition: vtkDeprecation.h:99
VTK_DATA_OBJECT_TREE
#define VTK_DATA_OBJECT_TREE
Definition: vtkType.h:106
vtkIdType
int vtkIdType
Definition: vtkType.h:315
VTK_NEWINSTANCE
#define VTK_NEWINSTANCE
Definition: vtkWrappingHints.h:32