------------------------------------------------------------------------------
| 1844 | |
| 1845 | //------------------------------------------------------------------------------ |
| 1846 | void vtkHyperTreeGrid::GenerateGhostArray(int zeroExt[6]) |
| 1847 | { |
| 1848 | if (this->GetNumberOfCells() == 0) |
| 1849 | { |
| 1850 | vtkDebugMacro("No cells in vtkHyperTreeGrid, skipping ghost generation."); |
| 1851 | return; |
| 1852 | } |
| 1853 | |
| 1854 | this->AllocateTreeGhostArray(); |
| 1855 | |
| 1856 | auto markGhost = [&](int imin, int imax, int jmin, int jmax, int kmin, int kmax) |
| 1857 | { |
| 1858 | vtkNew<vtkHyperTreeGridNonOrientedCursor> cursor; |
| 1859 | for (int i = imin; i < imax; ++i) |
| 1860 | { |
| 1861 | for (int j = jmin; j < jmax; ++j) |
| 1862 | { |
| 1863 | for (int k = kmin; k < kmax; ++k) |
| 1864 | { |
| 1865 | vtkIdType treeIdx; |
| 1866 | this->GetIndexFromLevelZeroCoordinates(treeIdx, i, j, k); |
| 1867 | |
| 1868 | this->InitializeNonOrientedCursor(cursor, treeIdx, false); |
| 1869 | |
| 1870 | if (cursor->HasTree()) |
| 1871 | { |
| 1872 | ::MarkEntireTreeAsGhost(cursor, this->TreeGhostArray); |
| 1873 | } |
| 1874 | } |
| 1875 | } |
| 1876 | } |
| 1877 | }; |
| 1878 | |
| 1879 | if (zeroExt[0] > this->Extent[0]) |
| 1880 | { |
| 1881 | markGhost(this->Extent[0], zeroExt[0], zeroExt[2], zeroExt[3], zeroExt[4], zeroExt[5]); |
| 1882 | } |
| 1883 | if (zeroExt[1] < this->Extent[1]) |
| 1884 | { |
| 1885 | markGhost(zeroExt[1], this->Extent[1], zeroExt[2], zeroExt[3], zeroExt[4], zeroExt[5]); |
| 1886 | } |
| 1887 | if (zeroExt[2] > this->Extent[2]) |
| 1888 | { |
| 1889 | markGhost( |
| 1890 | this->Extent[0], this->Extent[1], this->Extent[2], zeroExt[2], zeroExt[4], zeroExt[5]); |
| 1891 | } |
| 1892 | if (zeroExt[3] < this->Extent[3]) |
| 1893 | { |
| 1894 | markGhost( |
| 1895 | this->Extent[0], this->Extent[1], zeroExt[3], this->Extent[3], zeroExt[4], zeroExt[5]); |
| 1896 | } |
| 1897 | if (zeroExt[4] > this->Extent[4]) |
| 1898 | { |
| 1899 | markGhost(this->Extent[0], this->Extent[1], this->Extent[2], this->Extent[3], this->Extent[4], |
| 1900 | zeroExt[4]); |
| 1901 | } |
| 1902 | if (zeroExt[5] < this->Extent[5]) |
| 1903 | { |
nothing calls this directly
no test coverage detected