MCPcopy Create free account
hub / github.com/Kitware/VTK / GetLocalMinMax

Method GetLocalMinMax

Filters/Parallel/vtkPKdTree.cxx:1831–1883  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1829//------------------------------------------------------------------------------
1830
1831void vtkPKdTree::GetLocalMinMax(int L, int R, int me, float* min, float* max)
1832{
1833 int i, d;
1834 int from = this->StartVal[me];
1835 int to = this->EndVal[me];
1836
1837 from = std::max(L, from);
1838 to = std::min(R, to);
1839
1840 if (from <= to)
1841 {
1842 from -= this->StartVal[me];
1843 to -= this->StartVal[me];
1844
1845 float* val = this->CurrentPtArray + from * 3;
1846
1847 for (d = 0; d < 3; d++)
1848 {
1849 min[d] = max[d] = val[d];
1850 }
1851
1852 for (i = from + 1; i <= to; i++)
1853 {
1854 val += 3;
1855
1856 for (d = 0; d < 3; d++)
1857 {
1858 if (val[d] < min[d])
1859 {
1860 min[d] = val[d];
1861 }
1862 else if (val[d] > max[d])
1863 {
1864 max[d] = val[d];
1865 }
1866 }
1867 }
1868 }
1869 else
1870 {
1871 // this guy has none of the data, but still must participate
1872 // in ReduceMax and ReduceMin
1873
1874 const double* regionMin = this->Top->GetMinBounds();
1875 const double* regionMax = this->Top->GetMaxBounds();
1876
1877 for (d = 0; d < 3; d++)
1878 {
1879 min[d] = (float)regionMax[d];
1880 max[d] = (float)regionMin[d];
1881 }
1882 }
1883}
1884void vtkPKdTree::GetDataBounds(int L, int K, int R, float globalBounds[12])
1885{
1886 float localMinLeft[3]; // Left region is L through K-1

Callers 1

GetDataBoundsMethod · 0.95

Calls 2

maxFunction · 0.50
minFunction · 0.50

Tested by

no test coverage detected