| 853 | } |
| 854 | |
| 855 | vtkHyperTreeGridNonOrientedGeometryCursor* vtkHyperTreeGrid::FindNonOrientedGeometryCursor( |
| 856 | double x[3]) |
| 857 | { |
| 858 | unsigned int i = this->FindDichotomicX(x[0]); |
| 859 | if (i == std::numeric_limits<unsigned int>::max()) |
| 860 | { |
| 861 | return nullptr; |
| 862 | } |
| 863 | unsigned int j = this->FindDichotomicY(x[1]); |
| 864 | if (j == std::numeric_limits<unsigned int>::max()) |
| 865 | { |
| 866 | return nullptr; |
| 867 | } |
| 868 | unsigned int k = this->FindDichotomicZ(x[2]); |
| 869 | if (k == std::numeric_limits<unsigned int>::max()) |
| 870 | { |
| 871 | return nullptr; |
| 872 | } |
| 873 | |
| 874 | vtkIdType index; |
| 875 | this->GetIndexFromLevelZeroCoordinates(index, i, j, k); |
| 876 | |
| 877 | vtkHyperTreeGridNonOrientedGeometryCursor* cursor = |
| 878 | vtkHyperTreeGridNonOrientedGeometryCursor::New(); |
| 879 | cursor->Initialize(this, index, false); |
| 880 | |
| 881 | switch (this->BranchFactor) |
| 882 | { |
| 883 | case 2: |
| 884 | { |
| 885 | while (!cursor->IsLeaf()) |
| 886 | { |
| 887 | double p[3]; |
| 888 | cursor->GetPoint(p); |
| 889 | unsigned int ichild = 0; |
| 890 | if (x[0] <= p[0]) |
| 891 | { |
| 892 | } |
| 893 | else |
| 894 | { |
| 895 | ichild = 1; |
| 896 | } |
| 897 | if (x[1] <= p[1]) |
| 898 | { |
| 899 | } |
| 900 | else |
| 901 | { |
| 902 | ichild = 2 + ichild; |
| 903 | } |
| 904 | if (x[2] <= p[2]) |
| 905 | { |
| 906 | } |
| 907 | else |
| 908 | { |
| 909 | ichild = 4 + ichild; |
| 910 | } |
| 911 | cursor->ToChild(ichild); |
| 912 | } |
no test coverage detected