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 =========================================================================*/
36 #ifndef vtkDataObjectTree_h
37 #define vtkDataObjectTree_h
38 
39 #include "vtkCommonDataModelModule.h" // For export macro
40 #include "vtkCompositeDataSet.h"
41 
45 class vtkInformation;
47 class vtkDataObject;
48 
49 class VTKCOMMONDATAMODEL_EXPORT vtkDataObjectTree : public vtkCompositeDataSet
50 {
51 public:
53  void PrintSelf(ostream& os, vtkIndent indent) override;
54 
58  VTK_NEWINSTANCE virtual vtkDataObjectTreeIterator* NewTreeIterator();
59 
68 
74  void CopyStructure(vtkCompositeDataSet* input) override;
75 
82  void SetDataSet(vtkCompositeDataIterator* iter, vtkDataObject* dataObj) override;
83 
87  void SetDataSetFrom(vtkDataObjectTreeIterator* iter, vtkDataObject* dataObj);
88 
89  // Needed because, otherwise vtkCompositeData::GetDataSet(unsigned int flatIndex) is hidden.
90  using Superclass::GetDataSet;
98 
107  virtual vtkInformation* GetMetaData(vtkCompositeDataIterator* iter);
108 
115  virtual int HasMetaData(vtkCompositeDataIterator* iter);
116 
121  unsigned long GetActualMemorySize() override;
122 
126  void Initialize() override;
127 
129 
132  void ShallowCopy(vtkDataObject* src) override;
133  void DeepCopy(vtkDataObject* src) override;
134  void RecursiveShallowCopy(vtkDataObject* src) override;
136 
142  vtkIdType GetNumberOfPoints() override;
143 
149  vtkIdType GetNumberOfCells() override;
150 
152 
156  static vtkDataObjectTree* GetData(vtkInformationVector* v, int i = 0);
158 
162  int GetDataObjectType() override { return VTK_DATA_OBJECT_TREE; }
163 
164 protected:
166  ~vtkDataObjectTree() override;
167 
171  void SetNumberOfChildren(unsigned int num);
172 
176  unsigned int GetNumberOfChildren();
177 
182  void SetChild(unsigned int index, vtkDataObject*);
183 
187  void RemoveChild(unsigned int index);
188 
192  vtkDataObject* GetChild(unsigned int index);
193 
199  vtkInformation* GetChildMetaData(unsigned int index);
200 
204  void SetChildMetaData(unsigned int index, vtkInformation* info);
205 
210  int HasChildMetaData(unsigned int index);
211 
218  virtual vtkDataObjectTree* CreateForCopyStructure(vtkDataObjectTree* other);
219 
220  // The internal datastructure. Subclasses need not access this directly.
222 
224 
225 private:
226  vtkDataObjectTree(const vtkDataObjectTree&) = delete;
227  void operator=(const vtkDataObjectTree&) = delete;
228 };
229 
230 #endif
unsigned long GetActualMemorySize() override
Return the actual size of the data in kibibytes (1024 bytes).
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 GetDataObjectType() override
Overridden to return VTK_DATA_OBJECT_TREE.
int vtkIdType
Definition: vtkType.h:332
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,.
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:39
#define VTK_DATA_OBJECT_TREE
Definition: vtkType.h:118
void ShallowCopy(vtkDataObject *src) override
Shallow and Deep copy.
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.
void DeepCopy(vtkDataObject *src) override
Shallow and Deep copy.
superclass for composite data iterators
general representation of visualization data
Definition: vtkDataObject.h:65
virtual vtkCompositeDataIterator * NewIterator()=0
Return a new iterator (the iterator has to be deleted by user).
virtual void CopyStructure(vtkCompositeDataSet *input)
Copies the tree structure from the input.
virtual void RecursiveShallowCopy(vtkDataObject *src)=0
For historical reasons, vtkCompositeDataSet::ShallowCopy simply pass pointers to the leaf non-composi...