MCPcopy Create free account
hub / github.com/Kitware/VTK / RequestData

Method RequestData

IO/SegY/vtkSegYReader.cxx:77–132  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

75
76//------------------------------------------------------------------------------
77int 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//------------------------------------------------------------------------------

Callers

nothing calls this directly

Calls 9

GetInformationObjectMethod · 0.80
SetVerticalCRSMethod · 0.80
LoadTracesMethod · 0.80
ExportDataMethod · 0.80
GetMethod · 0.45
UpdateProgressMethod · 0.45
SqueezeMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected