121 #ifndef vtkHyperTree_h
122 #define vtkHyperTree_h
124 #include "vtkCommonDataModelModule.h"
131 VTK_ABI_NAMESPACE_BEGIN
135 class vtkTypeInt64Array;
185 "Use bool Initialize(unsigned char branchFactor, unsigned char dimension) instead.")
187 unsigned char branchFactor,
unsigned char dimension,
unsigned char numberOfChildren);
197 bool Initialize(
unsigned char branchFactor,
unsigned char dimension);
242 virtual
void BuildFromBreadthFirstOrderDescriptor(
284 virtual
void ComputeBreadthFirstOrderDescriptor(
unsigned int depthLimiter,
vtkBitArray* inputMask,
285 vtkTypeInt64Array* numberOfVerticesPerDepth,
vtkBitArray* descriptor,
305 assert(
"pre: datas_non_nullptr" && this->Datas !=
nullptr);
306 this->Datas->TreeIndex = treeIndex;
310 assert(
"pre: datas_non_nullptr" && this->Datas !=
nullptr);
311 return this->Datas->TreeIndex;
320 assert(
"pre: datas_non_nullptr" && this->Datas !=
nullptr);
321 assert(
"post: result_greater_or_equal_to_one" && this->Datas->NumberOfLevels >= 1);
322 return this->Datas->NumberOfLevels;
330 assert(
"pre: datas_non_nullptr" && this->Datas !=
nullptr);
331 return this->Datas->NumberOfVertices;
339 assert(
"pre: datas_non_nullptr" && this->Datas !=
nullptr);
340 return this->Datas->NumberOfNodes;
348 assert(
"pre: datas_non_nullptr" && this->Datas !=
nullptr);
349 return this->Datas->NumberOfVertices - this->Datas->NumberOfNodes;
373 void GetScale(
double s[3])
const;
374 double GetScale(
unsigned int d)
const;
382 std::shared_ptr<vtkHyperTreeGridScales> InitializeScales(
383 const double* scales,
bool reinitialize =
false);
396 static
vtkHyperTree* CreateInstance(
unsigned char branchFactor,
unsigned char dimension);
401 virtual
unsigned long GetActualMemorySizeBytes();
407 unsigned int GetActualMemorySize()
410 return static_cast<unsigned int>(this->GetActualMemorySizeBytes() / 1024);
422 virtual bool IsGlobalIndexImplicit();
443 virtual void SetGlobalIndexStart(
vtkIdType start);
451 assert(
"pre: datas_non_nullptr" && this->Datas !=
nullptr);
452 return this->Datas->GlobalIndexStart;
480 virtual vtkIdType GetGlobalNodeIndexMax()
const;
510 virtual vtkIdType GetElderChildIndex(
unsigned int index_parent)
const;
516 virtual const unsigned int* GetElderChildIndexArray(
size_t& nbElements)
const;
525 void SetScales(std::shared_ptr<vtkHyperTreeGridScales> scales) { this->Scales = scales; }
532 bool HasScales()
const {
return (this->Scales !=
nullptr); }
539 std::shared_ptr<vtkHyperTreeGridScales>
GetScales()
const
541 assert(this->Scales !=
nullptr);
554 bool IsChildLeaf(
vtkIdType index_parent,
unsigned int ichild)
const;
564 void ComputeBreadthFirstOrderDescriptorImpl(
unsigned int depthLimiter,
vtkBitArray* inputMask,
566 std::vector<std::vector<vtkIdType>>& breadthFirstOrderIdMapPerDepth);
571 unsigned char BranchFactor;
574 unsigned char Dimension;
577 unsigned char NumberOfChildren;
580 std::shared_ptr<vtkHyperTreeData> Datas;
586 std::shared_ptr<vtkHyperTreeGridScales> Scales;
589 VTK_ABI_NAMESPACE_END
vtkIdType GetGlobalIndexStart() const
Get the start global index for the current tree for implicit global index mapping.
bool HasScales() const
Return the existence scales.
abstract base class for most VTK objects
vtkIdType NumberOfVertices
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int GetDimension() const
Return the spatial dimension of the tree.
std::vector< vtkIdType > GlobalIndexTable
void SetScales(std::shared_ptr< vtkHyperTreeGridScales > scales)
In an hypertree, all cells are the same size by level.
std::vector< unsigned int > ParentToElderChild
void SetTreeIndex(vtkIdType treeIndex)
Set/Get tree index in hypertree grid.
#define VTK_DEPRECATED_IN_9_6_0(reason)
unsigned int NumberOfLevels
a simple class to control print indentation
std::shared_ptr< vtkHyperTreeGridScales > GetScales() const
Return all scales.
list of point or cell ids
vtkIdType GetNumberOfChildren() const
Return the number of children per node of the tree.
vtkIdType GetNumberOfLeaves() const
Return the number of leaf (fine) in the tree.
int GetBranchFactor() const
Return the branch factor of the tree.
unsigned int GetNumberOfLevels() const
Return the number of levels.
vtkIdType GetTreeIndex() const
Set/Get tree index in hypertree grid.
dynamic, self-adjusting array of bits
A data object structured as a tree.
vtkIdType GetNumberOfVertices() const
Return the number of all vertices (coarse and fine) in the tree.
vtkIdType GetNumberOfNodes() const
Return the number of nodes (coarse) in the tree.
Dynamic generation of scales for vtkHyperTree.
vtkIdType GlobalIndexStart
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...