------------------------------------------------------------------------------
| 678 | |
| 679 | //------------------------------------------------------------------------------ |
| 680 | void vtkStructuredGridConnectivity::EstablishNeighbors(int i, int j) |
| 681 | { |
| 682 | assert("pre: i < j" && (i < j)); |
| 683 | |
| 684 | int iGridExtent[6]; |
| 685 | int jGridExtent[6]; |
| 686 | this->GetGridExtent(i, iGridExtent); |
| 687 | this->GetGridExtent(j, jGridExtent); |
| 688 | |
| 689 | // A 3-tuple that defines the grid orientation of the form {i,j,k} where |
| 690 | // i=0;, j=1, k=2. For example, let's say that we want to define the |
| 691 | // orientation to be in the XZ plane, then, orientation array would be |
| 692 | // constructed as follows: {0,2 -1}, where -1 indicates a NIL value. |
| 693 | int orientation[3]; |
| 694 | |
| 695 | // A place holder for setting up ndim, which store the dimensionality of |
| 696 | // the data. |
| 697 | int ndim = 3; |
| 698 | |
| 699 | switch (this->DataDescription) |
| 700 | { |
| 701 | case vtkStructuredData::VTK_STRUCTURED_X_LINE: |
| 702 | ndim = 1; |
| 703 | orientation[0] = 0; |
| 704 | orientation[1] = -1; |
| 705 | orientation[2] = -1; |
| 706 | break; |
| 707 | case vtkStructuredData::VTK_STRUCTURED_Y_LINE: |
| 708 | ndim = 1; |
| 709 | orientation[0] = 1; |
| 710 | orientation[1] = -1; |
| 711 | orientation[2] = -1; |
| 712 | break; |
| 713 | case vtkStructuredData::VTK_STRUCTURED_Z_LINE: |
| 714 | ndim = 1; |
| 715 | orientation[0] = 2; |
| 716 | orientation[1] = -1; |
| 717 | orientation[2] = -1; |
| 718 | break; |
| 719 | case vtkStructuredData::VTK_STRUCTURED_XY_PLANE: |
| 720 | ndim = 2; |
| 721 | orientation[0] = 0; |
| 722 | orientation[1] = 1; |
| 723 | orientation[2] = -1; |
| 724 | break; |
| 725 | case vtkStructuredData::VTK_STRUCTURED_YZ_PLANE: |
| 726 | ndim = 2; |
| 727 | orientation[0] = 1; |
| 728 | orientation[1] = 2; |
| 729 | orientation[2] = -1; |
| 730 | break; |
| 731 | case vtkStructuredData::VTK_STRUCTURED_XZ_PLANE: |
| 732 | ndim = 2; |
| 733 | orientation[0] = 0; |
| 734 | orientation[1] = 2; |
| 735 | orientation[2] = -1; |
| 736 | break; |
| 737 | case vtkStructuredData::VTK_STRUCTURED_XYZ_GRID: |
no test coverage detected