VTK  9.2.6
vtkDataObjectTree.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkDataObjectTree.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
45 #ifndef vtkDataObjectTree_h
46 #define vtkDataObjectTree_h
47 
48 #include "vtkCommonDataModelModule.h" // For export macro
49 #include "vtkCompositeDataSet.h"
50 
54 class vtkInformation;
56 class vtkDataObject;
57 
58 class VTKCOMMONDATAMODEL_EXPORT vtkDataObjectTree : public vtkCompositeDataSet
59 {
60 public:
62  void PrintSelf(ostream& os, vtkIndent indent) override;
63 
68 
77 
83  void CopyStructure(vtkCompositeDataSet* input) override;
84 
91  void SetDataSet(vtkCompositeDataIterator* iter, vtkDataObject* dataObj) override;
92 
97 
98  // Needed because, otherwise vtkCompositeData::GetDataSet(unsigned int flatIndex) is hidden.
99  using Superclass::GetDataSet;
107 
117 
125 
130  unsigned long GetActualMemorySize() override;
131 
135  void Initialize() override;
136 
138 
141  void ShallowCopy(vtkDataObject* src) override;
142  void DeepCopy(vtkDataObject* src) override;
143  void RecursiveShallowCopy(vtkDataObject* src) override;
145 
152 
159 
161 
167 
171  int GetDataObjectType() override { return VTK_DATA_OBJECT_TREE; }
172 
173 protected:
175  ~vtkDataObjectTree() override;
176 
180  void SetNumberOfChildren(unsigned int num);
181 
185  unsigned int GetNumberOfChildren();
186 
191  void SetChild(unsigned int index, vtkDataObject*);
192 
196  void RemoveChild(unsigned int index);
197 
201  vtkDataObject* GetChild(unsigned int index);
202 
209 
214 
219  int HasChildMetaData(unsigned int index);
220 
228 
229  // The internal datastructure. Subclasses need not access this directly.
231 
233 
234 private:
235  vtkDataObjectTree(const vtkDataObjectTree&) = delete;
236  void operator=(const vtkDataObjectTree&) = delete;
237 };
238 
239 #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
static vtkDataObjectTree * GetData(vtkInformation *info)
Retrieve an instance of this class from an information object.
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.
virtual vtkInformation * GetMetaData(vtkCompositeDataIterator *iter)
Returns the meta-data associated with the position pointed by the iterator.
void RecursiveShallowCopy(vtkDataObject *src) override
Shallow and Deep copy.
void SetDataSet(vtkCompositeDataIterator *iter, vtkDataObject *dataObj) override
Sets the data set at the location pointed by the iterator.
static vtkDataObjectTree * GetData(vtkInformationVector *v, int i=0)
Retrieve an instance of this class from an information object.
vtkIdType GetNumberOfCells() override
Returns the total number of cells of all blocks.
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
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.
virtual int HasMetaData(vtkCompositeDataIterator *iter)
Returns if any meta-data associated with the position pointed by the iterator.
unsigned int GetNumberOfChildren()
Get the number of children.
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.
vtkCompositeDataIterator * NewIterator() override
Return a new iterator (the iterator has to be deleted by user).
int HasChildMetaData(unsigned int index)
Returns if meta-data information is available for the given child index.
~vtkDataObjectTree() override
int GetDataObjectType() override
Overridden to return VTK_DATA_OBJECT_TREE.
void RemoveChild(unsigned int index)
Remove the child at a given index.
virtual vtkDataObjectTreeIterator * NewTreeIterator()
Return a new iterator (the iterator has to be deleted by user).
void ShallowCopy(vtkDataObject *src) override
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:75
a simple class to control print indentation
Definition: vtkIndent.h:49
Key for string values in vtkInformation.
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
@ info
Definition: vtkX3D.h:382
@ index
Definition: vtkX3D.h:252
#define VTK_DATA_OBJECT_TREE
Definition: vtkType.h:118
int vtkIdType
Definition: vtkType.h:332
#define VTK_NEWINSTANCE