VTK  9.3.0
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
44 class vtkInformation;
46 class vtkDataObject;
47 
48 class VTKCOMMONDATAMODEL_EXPORT vtkDataObjectTree : public vtkCompositeDataSet
49 {
50 public:
52  void PrintSelf(ostream& os, vtkIndent indent) override;
53 
58 
67 
73  void CopyStructure(vtkCompositeDataSet* input) override;
74 
81  void SetDataSet(vtkCompositeDataIterator* iter, vtkDataObject* dataObj) override;
82 
87 
88  // Needed because, otherwise vtkCompositeData::GetDataSet(unsigned int flatIndex) is hidden.
89  using Superclass::GetDataSet;
97 
107 
115 
120  unsigned long GetActualMemorySize() override;
121 
125  void Initialize() override;
126 
128 
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 
163 
167  int GetDataObjectType() override { return VTK_DATA_OBJECT_TREE; }
168 
169 protected:
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 
205 
210 
216 
224 
225  // The internal datastructure. Subclasses need not access this directly.
227 
229 
230 private:
231  vtkDataObjectTree(const vtkDataObjectTree&) = delete;
232  void operator=(const vtkDataObjectTree&) = delete;
233 };
234 
235 VTK_ABI_NAMESPACE_END
236 #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
virtual vtkDataObjectTree * CreateForCopyStructure(vtkDataObjectTree *other)
When copying structure from another vtkDataObjectTree, this method gets called for create a new non-l...
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.
virtual vtkInformation * GetMetaData(vtkCompositeDataIterator *iter)
Returns the meta-data associated with the position pointed by the iterator.
void SetDataSet(vtkCompositeDataIterator *iter, vtkDataObject *dataObj) override
Sets the data set at the location pointed by the iterator.
vtkDataObjectTreeInternals * Internals
vtkInformation * GetChildMetaData(unsigned int index)
Returns the meta-data at a given index.
vtkDataObject * GetDataSet(vtkCompositeDataIterator *iter) override
Returns the dataset located at the position pointed by the iterator.
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,.
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.
unsigned int GetNumberOfChildren()
Get the number of children.
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.
vtkCompositeDataIterator * NewIterator() override
Return a new iterator (the iterator has to be deleted by user).
~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.
virtual vtkDataObjectTreeIterator * NewTreeIterator()
Return a new iterator (the iterator has to be deleted by user).
void ShallowCopy(vtkDataObject *src) override
CompositeShallow, Shallow and Deep copy.
vtkDataObject * GetChild(unsigned int index)
Returns a child dataset at a given index.
general representation of visualization data
Definition: vtkDataObject.h:64
a simple class to control print indentation
Definition: vtkIndent.h:38
Key for string values in vtkInformation.
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
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.
@ info
Definition: vtkX3D.h:376
@ index
Definition: vtkX3D.h:246
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_NEWINSTANCE