------------------------------------------------------------------------------ Fill in the rectilinear points for the requested subextents ------------------------------------------------------------------------------
| 757 | // Fill in the rectilinear points for the requested subextents |
| 758 | //------------------------------------------------------------------------------ |
| 759 | void vtkWindBladeReader::FillCoordinates() |
| 760 | { |
| 761 | this->Points->Delete(); |
| 762 | this->Points = vtkPoints::New(); |
| 763 | |
| 764 | // If dataset is flat, x and y are constant spacing, z is stretched |
| 765 | if (this->UseTopographyFile == 0) |
| 766 | { |
| 767 | // Save vtkPoints instead of spacing coordinates because topography file |
| 768 | // requires this to be vtkStructuredGrid and not vtkRectilinearGrid |
| 769 | for (int k = this->SubExtent[4]; k <= this->SubExtent[5]; k++) |
| 770 | { |
| 771 | float z = this->ZSpacing->GetValue(k); |
| 772 | for (int j = this->SubExtent[2]; j <= this->SubExtent[3]; j++) |
| 773 | { |
| 774 | float y = this->YSpacing->GetValue(j); |
| 775 | for (int i = this->SubExtent[0]; i <= this->SubExtent[1]; i++) |
| 776 | { |
| 777 | float x = this->XSpacing->GetValue(i); |
| 778 | this->Points->InsertNextPoint(x, y, z); |
| 779 | } |
| 780 | } |
| 781 | } |
| 782 | } |
| 783 | |
| 784 | // If dataset is topographic, x and y are constant spacing |
| 785 | // Z data is calculated from an x by y topographic data file |
| 786 | else |
| 787 | { |
| 788 | int planeSize = this->Dimension[0] * this->Dimension[1]; |
| 789 | int rowSize = this->Dimension[0]; |
| 790 | |
| 791 | for (int k = this->SubExtent[4]; k <= this->SubExtent[5]; k++) |
| 792 | { |
| 793 | for (int j = this->SubExtent[2]; j <= this->SubExtent[3]; j++) |
| 794 | { |
| 795 | float y = this->YSpacing->GetValue(j); |
| 796 | for (int i = this->SubExtent[0]; i <= this->SubExtent[1]; i++) |
| 797 | { |
| 798 | float x = this->XSpacing->GetValue(i); |
| 799 | int index = (k * planeSize) + (j * rowSize) + i; |
| 800 | this->Points->InsertNextPoint(x, y, this->ZTopographicValues[index]); |
| 801 | } |
| 802 | } |
| 803 | } |
| 804 | } |
| 805 | } |
| 806 | |
| 807 | //------------------------------------------------------------------------------ |
| 808 | // Fill in the rectilinear points for the requested subextents |
no test coverage detected