VTK  9.7.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
27 #ifndef vtkDataObjectTree_h
28 #define vtkDataObjectTree_h
29 
30 #include "vtkCommonDataModelModule.h" // For export macro
31 #include "vtkCompositeDataSet.h"
32 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
33 
34 VTK_ABI_NAMESPACE_BEGIN
38 class vtkInformation;
40 class vtkDataObject;
41 
42 class VTKCOMMONDATAMODEL_EXPORT VTK_MARSHALAUTO vtkDataObjectTree : public vtkCompositeDataSet
43 {
44 public:
46  void PrintSelf(ostream& os, vtkIndent indent) override;
47 
51  VTK_NEWINSTANCE virtual vtkDataObjectTreeIterator* NewTreeIterator();
52 
61 
67  void CopyStructure(vtkCompositeDataSet* input) override;
68 
75  void SetDataSet(vtkCompositeDataIterator* iter, vtkDataObject* dataObj) override;
76 
80  void SetDataSetFrom(vtkDataObjectTreeIterator* iter, vtkDataObject* dataObj);
81 
82  // Needed because, otherwise vtkCompositeData::GetDataSet(unsigned int flatIndex) is hidden.
83  using Superclass::GetDataSet;
91 
100  virtual vtkInformation* GetMetaData(vtkCompositeDataIterator* iter);
101 
108  virtual vtkTypeBool HasMetaData(vtkCompositeDataIterator* iter);
109 
114  unsigned long GetActualMemorySize() override;
115 
119  void Initialize() override;
120 
122 
125  void CompositeShallowCopy(vtkCompositeDataSet* src) override;
126  void ShallowCopy(vtkDataObject* src) override;
127  void DeepCopy(vtkDataObject* src) override;
129 
135  vtkIdType GetNumberOfPoints() override;
136 
142  vtkIdType GetNumberOfCells() override;
143 
147  unsigned int GetNumberOfChildren();
148 
152  vtkDataObject* GetChild(unsigned int index);
153 
159  vtkInformation* GetChildMetaData(unsigned int index);
160 
165  vtkTypeBool HasChildMetaData(unsigned int index);
166 
168 
172  static vtkDataObjectTree* GetData(vtkInformationVector* v, int i = 0);
174 
178  int GetDataObjectType() VTK_FUTURE_CONST override { return VTK_DATA_OBJECT_TREE; }
179 
180 protected:
182  ~vtkDataObjectTree() override;
183 
187  void SetNumberOfChildren(unsigned int num);
188 
193  void SetChild(unsigned int index, vtkDataObject*);
194 
198  void RemoveChild(unsigned int index);
199 
203  void SetChildMetaData(unsigned int index, vtkInformation* info);
204 
211  virtual vtkDataObjectTree* CreateForCopyStructure(vtkDataObjectTree* other);
212 
213  // The internal datastructure. Subclasses need not access this directly.
215 
217 
218 private:
219  vtkDataObjectTree(const vtkDataObjectTree&) = delete;
220  void operator=(const vtkDataObjectTree&) = delete;
221 };
222 
223 VTK_ABI_NAMESPACE_END
224 #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.
virtual vtkIdType GetNumberOfPoints()
Returns the total number of points of all blocks.
provides implementation for most abstract methods in the superclass vtkCompositeDataSet ...
Store vtkAlgorithm input/output information.
vtkDataObjectTreeInternals * Internals
int vtkIdType
Definition: vtkType.h:363
virtual vtkIdType GetNumberOfCells()
Returns the total number of cells of all blocks.
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.
abstract superclass for composite (multi-block or AMR) datasets
a simple class to control print indentation
Definition: vtkIndent.h:28
static vtkCompositeDataSet * GetData(vtkInformation *info)
Retrieve an instance of this class from an information object.
#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.
#define VTK_MARSHALAUTO
superclass for composite data iterators
int GetDataObjectType() VTK_FUTURE_CONST override
Overridden to return VTK_DATA_OBJECT_TREE.
general representation of visualization data
Definition: vtkDataObject.h:55
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.