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

Method RequestData

IO/LAS/vtkLASReader.cxx:43–77  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

41
42//------------------------------------------------------------------------------
43int 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//------------------------------------------------------------------------------
80void vtkLASReader::ReadPointRecordData(liblas::Reader& reader, vtkPolyData* pointsPolyData)

Callers

nothing calls this directly

Calls 10

ReadPointRecordDataMethod · 0.95
GetInformationObjectMethod · 0.80
is_openMethod · 0.80
GetMethod · 0.45
openMethod · 0.45
closeMethod · 0.45
SetInputDataMethod · 0.45
UpdateMethod · 0.45
ShallowCopyMethod · 0.45
GetOutputMethod · 0.45

Tested by

no test coverage detected