------------------------------------------------------------------------------
| 75 | |
| 76 | //------------------------------------------------------------------------------ |
| 77 | int vtkSegYReader::RequestData(vtkInformation* vtkNotUsed(request), |
| 78 | vtkInformationVector** vtkNotUsed(inputVector), vtkInformationVector* outputVector) |
| 79 | { |
| 80 | vtkInformation* outInfo = outputVector->GetInformationObject(0); |
| 81 | if (!outInfo) |
| 82 | { |
| 83 | return 0; |
| 84 | } |
| 85 | |
| 86 | vtkDataObject* output = outInfo->Get(vtkDataObject::DATA_OBJECT()); |
| 87 | if (!output) |
| 88 | { |
| 89 | return 0; |
| 90 | } |
| 91 | |
| 92 | this->Reader->SetVerticalCRS(this->VerticalCRS); |
| 93 | switch (this->XYCoordMode) |
| 94 | { |
| 95 | case VTK_SEGY_SOURCE: |
| 96 | { |
| 97 | this->Reader->SetXYCoordBytePositions(72, 76); |
| 98 | break; |
| 99 | } |
| 100 | case VTK_SEGY_CDP: |
| 101 | { |
| 102 | this->Reader->SetXYCoordBytePositions(180, 184); |
| 103 | break; |
| 104 | } |
| 105 | case VTK_SEGY_CUSTOM: |
| 106 | { |
| 107 | this->Reader->SetXYCoordBytePositions(this->XCoordByte - 1, this->YCoordByte - 1); |
| 108 | break; |
| 109 | } |
| 110 | default: |
| 111 | { |
| 112 | vtkErrorMacro(<< "Unknown value for XYCoordMode " << this->XYCoordMode); |
| 113 | return 1; |
| 114 | } |
| 115 | } |
| 116 | this->Reader->LoadTraces(this->DataExtent); |
| 117 | this->UpdateProgress(0.5); |
| 118 | if (this->Is3D && !this->StructuredGrid) |
| 119 | { |
| 120 | vtkImageData* imageData = vtkImageData::SafeDownCast(output); |
| 121 | this->Reader->ExportData( |
| 122 | imageData, this->DataExtent, this->DataOrigin, this->DataSpacing, this->DataSpacingSign); |
| 123 | } |
| 124 | else |
| 125 | { |
| 126 | vtkStructuredGrid* grid = vtkStructuredGrid::SafeDownCast(output); |
| 127 | this->Reader->ExportData(grid, this->DataExtent, this->DataOrigin, this->DataSpacing); |
| 128 | grid->Squeeze(); |
| 129 | } |
| 130 | this->Reader->In.close(); |
| 131 | return 1; |
| 132 | } |
| 133 | |
| 134 | //------------------------------------------------------------------------------ |
nothing calls this directly
no test coverage detected