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

Method RequestInformation

IO/PDAL/vtkPDALReader.cxx:61–106  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

59
60//------------------------------------------------------------------------------
61int vtkPDALReader::RequestInformation(
62 vtkInformation*, vtkInformationVector**, vtkInformationVector*)
63{
64 this->OffsetAsString.clear();
65 this->HasOffset = false;
66
67 try
68 {
69 pdal::StageFactory factory;
70
71 std::string driverName = pdal::StageFactory::inferReaderDriver(this->FileName);
72
73 pdal::Stage* reader = factory.createStage(driverName);
74 if (!reader)
75 {
76 vtkErrorMacro("CreateStage failed");
77 return 1;
78 }
79
80 pdal::Options opts;
81 opts.add(pdal::Option("filename", this->FileName));
82 reader->setOptions(opts);
83
84 pdal::PointTable table;
85 reader->prepare(table);
86
87 auto offsets = this->GetLasOffsets(reader);
88
89 if (!(offsets[0] == 0.0 && offsets[1] == 0.0 && offsets[2] == 0.0))
90 {
91 std::ostringstream ss;
92 ss.setf(std::ios::fixed);
93 ss.precision(3);
94 ss << "(" << offsets[0] << ", " << offsets[1] << ", " << offsets[2] << ")";
95
96 this->HasOffset = true;
97 this->OffsetAsString = ss.str();
98 }
99 }
100 catch (const pdal::pdal_error& e)
101 {
102 vtkErrorMacro(<< "PDAL error: " << e.what());
103 }
104
105 return 1;
106}
107
108int vtkPDALReader::RequestData(vtkInformation* vtkNotUsed(request),
109 vtkInformationVector** vtkNotUsed(request), vtkInformationVector* outputVector)

Callers

nothing calls this directly

Calls 7

GetLasOffsetsMethod · 0.95
prepareMethod · 0.80
OptionClass · 0.50
clearMethod · 0.45
addMethod · 0.45
strMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected