18#ifndef vtkHyperTreeGridScales_h
19#define vtkHyperTreeGridScales_h
21#include "vtkABINamespace.h"
27VTK_ABI_NAMESPACE_BEGIN
35 : BranchFactor(branchfactor)
37 , CellScales(scale, scale + 3)
51 return this->CellScales.data() + 3 * level;
60 return this->CellScales[3 * level + 0];
69 return this->CellScales[3 * level + 1];
78 return this->CellScales[3 * level + 2];
90 memcpy(scale, this->CellScales.data() + 3 * level, 3 *
sizeof(
double));
102 void Update(
unsigned int level)
104 if (level < this->CurrentFailLevel)
108 this->CurrentFailLevel =
level + 1;
109 this->CellScales.resize(3 * this->CurrentFailLevel);
110 auto current = this->CellScales.begin() + 3 * (this->CurrentFailLevel - 1);
112 auto end = this->CellScales.end();
113 for (; current != end; ++current, ++
previous)
115 *current = *
previous / this->BranchFactor;
122 const double BranchFactor;
127 unsigned int CurrentFailLevel;
128 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)
double GetScaleZ(unsigned int level)
~vtkHyperTreeGridScales()=default
double GetBranchFactor() const
double ComputeScaleY(unsigned int level)
double * GetScale(unsigned int level)
double GetScaleX(unsigned int level)
unsigned int GetCurrentFailLevel() const
void ComputeScale(unsigned int level, double scale[3])
Return the mesh scale at the given level.
double GetScaleY(unsigned int level)
#define VTK_DEPRECATED_IN_9_6_0(reason)