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
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 
31 VTK_ABI_NAMESPACE_BEGIN
35 class vtkInformation;
37 class vtkDataObject;
38 
39 class VTKCOMMONDATAMODEL_EXPORT vtkDataObjectTree : public vtkCompositeDataSet
40 {
41 public:
43  void PrintSelf(ostream& os, vtkIndent indent) override;
44 
48  VTK_NEWINSTANCE virtual vtkDataObjectTreeIterator* NewTreeIterator();
49 
58 
64  void CopyStructure(vtkCompositeDataSet* input) override;
65 
72  void SetDataSet(vtkCompositeDataIterator* iter, vtkDataObject* dataObj) override;
73 
77  void SetDataSetFrom(vtkDataObjectTreeIterator* iter, vtkDataObject* dataObj);
78 
79  // Needed because, otherwise vtkCompositeData::GetDataSet(unsigned int flatIndex) is hidden.
80  using Superclass::GetDataSet;
88 
97  virtual vtkInformation* GetMetaData(vtkCompositeDataIterator* iter);
98 
105  virtual vtkTypeBool HasMetaData(vtkCompositeDataIterator* iter);
106 
111  unsigned long GetActualMemorySize() override;
112 
116  void Initialize() override;
117 
119 
122  void CompositeShallowCopy(vtkCompositeDataSet* src) override;
123  void ShallowCopy(vtkDataObject* src) override;
124  void DeepCopy(vtkDataObject* src) override;
126 
130  VTK_DEPRECATED_IN_9_3_0("Please use ShallowCopy instead.")
131  void RecursiveShallowCopy(vtkDataObject* src) override;
132 
138  vtkIdType GetNumberOfPoints() override;
139 
145  vtkIdType GetNumberOfCells() override;
146 
148 
152  static vtkDataObjectTree* GetData(vtkInformationVector* v, int i = 0);
154 
158  int GetDataObjectType() override { return VTK_DATA_OBJECT_TREE; }
159 
160 protected:
162  ~vtkDataObjectTree() override;
163 
167  void SetNumberOfChildren(unsigned int num);
168 
172  unsigned int GetNumberOfChildren();
173 
178  void SetChild(unsigned int index, vtkDataObject*);
179 
183  void RemoveChild(unsigned int index);
184 
188  vtkDataObject* GetChild(unsigned int index);
189 
195  vtkInformation* GetChildMetaData(unsigned int index);
196 
200  void SetChildMetaData(unsigned int index, vtkInformation* info);
201 
206  vtkTypeBool HasChildMetaData(unsigned int index);
207 
214  virtual vtkDataObjectTree* CreateForCopyStructure(vtkDataObjectTree* other);
215 
216  // The internal datastructure. Subclasses need not access this directly.
218 
220 
221 private:
222  vtkDataObjectTree(const vtkDataObjectTree&) = delete;
223  void operator=(const vtkDataObjectTree&) = delete;
224 };
225 
226 VTK_ABI_NAMESPACE_END
227 #endif
unsigned long GetActualMemorySize() override
Return the actual size of the data in kibibytes (1024 bytes).
virtual void CompositeShallowCopy(vtkCompositeDataSet *src)
The goal of the method is to copy the data up to the dataset pointers only.
provides implementation for most abstract methods in the superclass vtkCompositeDataSet ...
Store vtkAlgorithm input/output information.
vtkDataObjectTreeInternals * Internals
int vtkIdType
Definition: vtkType.h:315
Key for string values in vtkInformation.
superclass for composite data iterators
void Initialize() override
Restore data object to initial state,.
int vtkTypeBool
Definition: vtkABI.h:64
virtual void SetDataSet(vtkCompositeDataIterator *iter, vtkDataObject *dataObj)=0
Sets the data set at the location pointed by the iterator.
#define VTK_DEPRECATED_IN_9_3_0(reason)
abstract superclass for composite (multi-block or AMR) datasets
a simple class to control print indentation
Definition: vtkIndent.h:28
#define VTK_DATA_OBJECT_TREE
Definition: vtkType.h:106
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.
#define VTK_NEWINSTANCE
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual vtkDataObject * GetDataSet(vtkCompositeDataIterator *iter)=0
Returns the dataset located at the position pointed by the iterator.
Store zero or more vtkInformation instances.
superclass for composite data iterators
general representation of visualization data
Definition: vtkDataObject.h:54
virtual vtkCompositeDataIterator * NewIterator()=0
Return a new iterator (the iterator has to be deleted by user).
virtual void DeepCopy(vtkDataObject *src)
The goal of the method is to copy the complete data from src into this object.
virtual void CopyStructure(vtkCompositeDataSet *input)
Copies the tree structure from the input.
virtual void ShallowCopy(vtkDataObject *src)
The goal of the method is to copy the data up to the array pointers only.