------------------------------------------------------------------------------
| 41 | |
| 42 | //------------------------------------------------------------------------------ |
| 43 | int vtkLASReader::RequestData(vtkInformation* vtkNotUsed(request), |
| 44 | vtkInformationVector** vtkNotUsed(request), vtkInformationVector* outputVector) |
| 45 | { |
| 46 | // Get the info object |
| 47 | vtkInformation* outInfo = outputVector->GetInformationObject(0); |
| 48 | |
| 49 | // Get the output |
| 50 | vtkPolyData* output = vtkPolyData::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT())); |
| 51 | |
| 52 | // Open LAS File for reading |
| 53 | vtksys::ifstream ifs; |
| 54 | ifs.open(this->FileName, std::ios_base::binary | std::ios_base::in); |
| 55 | |
| 56 | if (!ifs.is_open()) |
| 57 | { |
| 58 | vtkErrorMacro(<< "Unable to open file for reading: " << this->FileName); |
| 59 | return VTK_ERROR; |
| 60 | } |
| 61 | |
| 62 | // Read header data |
| 63 | liblas::ReaderFactory readerFactory; |
| 64 | liblas::Reader reader = readerFactory.CreateWithStream(ifs); |
| 65 | |
| 66 | vtkNew<vtkPolyData> pointsPolyData; |
| 67 | this->ReadPointRecordData(reader, pointsPolyData); |
| 68 | ifs.close(); |
| 69 | |
| 70 | // Convert points to verts in output polydata |
| 71 | vtkNew<vtkVertexGlyphFilter> vertexFilter; |
| 72 | vertexFilter->SetInputData(pointsPolyData); |
| 73 | vertexFilter->Update(); |
| 74 | output->ShallowCopy(vertexFilter->GetOutput()); |
| 75 | |
| 76 | return VTK_OK; |
| 77 | } |
| 78 | |
| 79 | //------------------------------------------------------------------------------ |
| 80 | void vtkLASReader::ReadPointRecordData(liblas::Reader& reader, vtkPolyData* pointsPolyData) |
nothing calls this directly
no test coverage detected