138 #ifndef vtkHyperTree_h
139 #define vtkHyperTree_h
141 #include "vtkCommonDataModelModule.h"
150 class vtkTypeInt64Array;
194 unsigned char branchFactor,
unsigned char dimension,
unsigned char numberOfChildren);
239 virtual void BuildFromBreadthFirstOrderDescriptor(
279 virtual void ComputeBreadthFirstOrderDescriptor(
vtkBitArray* inputMask,
280 vtkTypeInt64Array* numberOfVerticesPerDepth,
vtkBitArray* descriptor,
313 assert(
"post: result_greater_or_equal_to_one" && this->Datas->NumberOfLevels >= 1);
314 return this->Datas->NumberOfLevels;
332 return this->Datas->NumberOfVertices - this->Datas->NumberOfNodes;
356 void GetScale(
double s[3])
const;
358 double GetScale(
unsigned int d)
const;
366 std::shared_ptr<vtkHyperTreeGridScales> InitializeScales(
367 const double* scales,
bool reinitialize =
false)
const;
379 static vtkHyperTree* CreateInstance(
unsigned char branchFactor,
unsigned char dimension);
384 virtual unsigned long GetActualMemorySizeBytes() = 0;
393 return static_cast<unsigned int>(this->GetActualMemorySizeBytes() / 1024);
405 virtual bool IsGlobalIndexImplicit() = 0;
426 virtual void SetGlobalIndexStart(
vtkIdType start) = 0;
459 virtual vtkIdType GetGlobalNodeIndexMax()
const = 0;
489 virtual vtkIdType GetElderChildIndex(
unsigned int index_parent)
const = 0;
495 virtual const unsigned int* GetElderChildIndexArray(
size_t& nbElements)
const = 0;
504 void SetScales(std::shared_ptr<vtkHyperTreeGridScales> scales)
const { this->Scales = scales; }
511 bool HasScales()
const {
return (this->Scales !=
nullptr); }
518 std::shared_ptr<vtkHyperTreeGridScales>
GetScales()
const
520 assert(this->Scales !=
nullptr);
530 virtual void InitializePrivate() = 0;
531 virtual void PrintSelfPrivate(ostream& os,
vtkIndent indent) = 0;
532 virtual void CopyStructurePrivate(
vtkHyperTree* ht) = 0;
546 std::shared_ptr<vtkHyperTreeData>
Datas;
552 mutable std::shared_ptr<vtkHyperTreeGridScales>
Scales;
556 unsigned char branchFactor,
unsigned char dimension,
unsigned char numberOfChildren);
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.
void SetTreeIndex(vtkIdType treeIndex)
Set/Get tree index in hypertree grid.
void SetScales(std::shared_ptr< vtkHyperTreeGridScales > scales) const
In an hypertree, all cells are the same size by level.
unsigned char BranchFactor
unsigned int NumberOfLevels
a simple class to control print indentation
std::shared_ptr< vtkHyperTreeGridScales > GetScales() const
Return all scales.
unsigned int GetActualMemorySize()
Return memory used in kibibytes (1024 bytes).
list of point or cell ids
std::shared_ptr< vtkHyperTreeGridScales > Scales
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.
unsigned char NumberOfChildren
vtkIdType GetNumberOfNodes() const
Return the number of nodes (coarse) in the tree.
A specifalized type of vtkHyperTreeGrid for the case when root cells have uniform sizes in each direc...
vtkIdType GlobalIndexStart
std::shared_ptr< vtkHyperTreeData > Datas