17#ifndef vtkHyperTreeGridScales_h
18#define vtkHyperTreeGridScales_h
20#include "vtkABINamespace.h"
25VTK_ABI_NAMESPACE_BEGIN
33 : BranchFactor(branchfactor)
35 , CellScales(scale, scale + 3)
46 return this->CellScales.data() + 3 * level;
52 return this->CellScales[3 * level + 0];
58 return this->CellScales[3 * level + 1];
64 return this->CellScales[3 * level + 2];
70 void GetScale(
unsigned int level,
double scale[3])
const
73 memcpy(scale, this->CellScales.data() + 3 * level, 3 *
sizeof(
double));
85 void Update(
unsigned int level)
const
87 if (level < this->CurrentFailLevel)
91 this->CurrentFailLevel =
level + 1;
92 this->CellScales.resize(3 * this->CurrentFailLevel);
93 auto current = this->CellScales.begin() + 3 * (this->CurrentFailLevel - 1);
95 auto end = this->CellScales.end();
96 for (; current != end; ++current, ++
previous)
98 *current = *
previous / this->BranchFactor;
105 const double BranchFactor;
110 mutable unsigned int CurrentFailLevel;
111 mutable std::vector<double> CellScales;
A specifalized type of vtkHyperTreeGrid for the case when root cells have uniform sizes in each direc...
double GetScaleX(unsigned int level) const
vtkHyperTreeGridScales(double branchfactor, const double scale[3])
Build this class from the original scale mesh and subdivision factor.
~vtkHyperTreeGridScales()=default
double GetBranchFactor() const
double GetScaleY(unsigned int level) const
double * GetScale(unsigned int level) const
unsigned int GetCurrentFailLevel() const
void GetScale(unsigned int level, double scale[3]) const
Return the mesh scale at the given level.
double GetScaleZ(unsigned int level) const