18#ifndef vtkHyperTreeGridScales_h
19#define vtkHyperTreeGridScales_h
21#include "vtkABINamespace.h"
26VTK_ABI_NAMESPACE_BEGIN
34 : BranchFactor(branchfactor)
36 , CellScales(scale, scale + 3)
47 return this->CellScales.data() + 3 * level;
53 return this->CellScales[3 * level + 0];
59 return this->CellScales[3 * level + 1];
65 return this->CellScales[3 * level + 2];
74 memcpy(scale, this->CellScales.data() + 3 * level, 3 *
sizeof(
double));
86 void Update(
unsigned int level)
88 if (level < this->CurrentFailLevel)
92 this->CurrentFailLevel =
level + 1;
93 this->CellScales.resize(3 * this->CurrentFailLevel);
94 auto current = this->CellScales.begin() + 3 * (this->CurrentFailLevel - 1);
96 auto end = this->CellScales.end();
97 for (; current != end; ++current, ++
previous)
99 *current = *
previous / this->BranchFactor;
106 const double BranchFactor;
111 unsigned int CurrentFailLevel;
112 std::vector<double> CellScales;
Dynamic generation of scales for vtkHyperTree.
double ComputeScaleZ(unsigned int level)
vtkHyperTreeGridScales(double branchfactor, const double scale[3])
Build this class from the original scale mesh and subdivision factor.
double ComputeScaleX(unsigned int level)
double * ComputeScale(unsigned int level)
~vtkHyperTreeGridScales()=default
double GetBranchFactor() const
double ComputeScaleY(unsigned int level)
unsigned int GetCurrentFailLevel() const
void ComputeScale(unsigned int level, double scale[3])
Return the mesh scale at the given level.