1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151
|
/*=========================================================================
Program: Visualization Toolkit
Module: $RCSfile: vtkHierarchicalDataSet.h,v $
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkHierarchicalDataSet - abstract superclass for hierarchical datasets
// .SECTION Description
// vtkHierarchicalDataSet is a vtkCompositeDataSet that stores
// a hierarchy of datasets. The dataset collection consists of
// multiple levels. Each dataset can have an arbitrary number of
// parents and children at levels above and below. Currently,
// the interface for connecting parents-children is incomplete.
#ifndef __vtkHierarchicalDataSet_h
#define __vtkHierarchicalDataSet_h
#include "vtkCompositeDataSet.h"
//BTX
struct vtkHierarchicalDataSetInternal;
//ETX
class vtkDataObject;
class vtkHDSNode;
class vtkHierarchicalDataInformation;
class VTK_FILTERING_EXPORT vtkHierarchicalDataSet : public vtkCompositeDataSet
{
public:
static vtkHierarchicalDataSet *New();
vtkTypeRevisionMacro(vtkHierarchicalDataSet,vtkCompositeDataSet);
virtual void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Return a new (forward) iterator
// (the iterator has to be deleted by user)
virtual vtkCompositeDataIterator* NewIterator();
// Description:
// Return class name of data type (see vtkSystemIncludes.h for
// definitions).
virtual int GetDataObjectType() {return VTK_HIERARCHICAL_DATA_SET;}
// Description:
// Restore data object to initial state,
virtual void Initialize();
// Description:
// Set the number of refinement levels. This call might cause
// allocation if the new number of levels is larger than the
// current one.
void SetNumberOfLevels(unsigned int numLevels);
// Description:
// Returns the number of levels.
unsigned int GetNumberOfLevels();
// Description:
// Set the number of datasets in a given level. This call might
// cause allocation if the new number of datasets is larger
// than the current one.
void SetNumberOfDataSets(unsigned int level, unsigned int numDataSets);
// Description:
// Returns the number of datasets in a given level.
unsigned int GetNumberOfDataSets(unsigned int level);
// Description:
// Initialize the entry for a dataset node. This removes all
// parent/child links between the given node and others.
void InitializeNode(unsigned int level, unsigned int id);
// Description:
// Set the dataset pointer for a given node. This method does
// not remove the existing parent/child links. It only replaces
// the dataset pointer.
void SetDataSet(unsigned int level, unsigned int id, vtkDataObject* dataSet);
// Description:
// Uses keys LEVEL() and INDEX() to call SetDataSet(LEVEL, INDEX, dobj)
virtual void AddDataSet(vtkInformation* index, vtkDataObject* dobj);
// Description:
// Get a dataset give a level and an id.
vtkDataObject* GetDataSet(unsigned int level, unsigned int id);
// Description:
// Uses keys LEVEL() and INDEX() to call GetDataSet(LEVEL, INDEX)
virtual vtkDataObject* GetDataSet(vtkInformation* index);
// Description:
// Shallow and Deep copy.
virtual void ShallowCopy(vtkDataObject *src);
virtual void DeepCopy(vtkDataObject *src);
// Description:
// Returns the data structure containing information about
// the datasets.
vtkGetObjectMacro(HierarchicalDataInformation,vtkHierarchicalDataInformation);
// Description:
// Set the information about the datasets.
void SetHierarchicalDataInformation(vtkHierarchicalDataInformation* info);
// Description:
// Returns the total number of points of all blocks. This will
// iterate over all blocks and call GetNumberOfPoints() so it
// might be expansive.
virtual vtkIdType GetNumberOfPoints();
//BTX
friend class vtkHierarchicalDataIterator;
//ETX
static vtkInformationIntegerKey* LEVEL();
//BTX
// Description:
// Retrieve an instance of this class from an information object.
static vtkHierarchicalDataSet* GetData(vtkInformation* info);
static vtkHierarchicalDataSet* GetData(vtkInformationVector* v, int i=0);
//ETX
protected:
vtkHierarchicalDataSet();
~vtkHierarchicalDataSet();
vtkHierarchicalDataSetInternal* Internal;
void InitializeDataSets();
virtual vtkHDSNode* NewNode();
vtkHierarchicalDataInformation* HierarchicalDataInformation;
private:
vtkHierarchicalDataSet(const vtkHierarchicalDataSet&); // Not implemented.
void operator=(const vtkHierarchicalDataSet&); // Not implemented.
};
#endif
|