------------------------------------------------------------------------------
| 1743 | |
| 1744 | //------------------------------------------------------------------------------ |
| 1745 | void vtkNetCDFCFReader::AddUnstructuredSphericalCoordinates( |
| 1746 | vtkUnstructuredGrid* unstructuredOutput, const int extent[6]) |
| 1747 | { |
| 1748 | // First load the data as rectilinear coordinates, and then convert them |
| 1749 | // to spherical coordinates. Not only does this reuse code, but it also |
| 1750 | // probably makes the locator more efficient this way. |
| 1751 | this->AddUnstructuredRectilinearCoordinates(unstructuredOutput, extent); |
| 1752 | |
| 1753 | double height = 1.0 * this->VerticalScale + this->VerticalBias; |
| 1754 | if (height <= 0.0) |
| 1755 | { |
| 1756 | height = 1.0; |
| 1757 | } |
| 1758 | |
| 1759 | vtkPoints* points = unstructuredOutput->GetPoints(); |
| 1760 | vtkIdType numPoints = points->GetNumberOfPoints(); |
| 1761 | for (vtkIdType pointId = 0; pointId < numPoints; pointId++) |
| 1762 | { |
| 1763 | double lonLat[3]; |
| 1764 | points->GetPoint(pointId, lonLat); |
| 1765 | double lon = vtkMath::RadiansFromDegrees(lonLat[0]); |
| 1766 | double lat = vtkMath::RadiansFromDegrees(lonLat[1]); |
| 1767 | |
| 1768 | double cartesianCoord[3]; |
| 1769 | cartesianCoord[0] = height * cos(lon) * cos(lat); |
| 1770 | cartesianCoord[1] = height * sin(lon) * cos(lat); |
| 1771 | cartesianCoord[2] = height * sin(lat); |
| 1772 | points->SetPoint(pointId, cartesianCoord); |
| 1773 | } |
| 1774 | } |
| 1775 | |
| 1776 | //------------------------------------------------------------------------------ |
| 1777 | int vtkNetCDFCFReader::ReadMetaData(int ncFD) |
no test coverage detected