本文整理汇总了C++中LasReader::preview方法的典型用法代码示例。如果您正苦于以下问题:C++ LasReader::preview方法的具体用法?C++ LasReader::preview怎么用?C++ LasReader::preview使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LasReader
的用法示例。
在下文中一共展示了LasReader::preview方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PointView
// Test that data from three input views gets written to separate output files.
TEST(LasWriterTest, flex)
{
std::array<std::string, 3> outname =
{{ "test_1.las", "test_2.las", "test_3.las" }};
Options readerOps;
readerOps.add("filename", Support::datapath("las/simple.las"));
PointTable table;
LasReader reader;
reader.setOptions(readerOps);
reader.prepare(table);
PointViewSet views = reader.execute(table);
PointViewPtr v = *(views.begin());
PointViewPtr v1(new PointView(table));
PointViewPtr v2(new PointView(table));
PointViewPtr v3(new PointView(table));
std::vector<PointViewPtr> vs;
vs.push_back(v1);
vs.push_back(v2);
vs.push_back(v3);
for (PointId i = 0; i < v->size(); ++i)
vs[i % 3]->appendPoint(*v, i);
for (size_t i = 0; i < outname.size(); ++i)
FileUtils::deleteFile(Support::temppath(outname[i]));
BufferReader reader2;
reader2.addView(v1);
reader2.addView(v2);
reader2.addView(v3);
Options writerOps;
writerOps.add("filename", Support::temppath("test_#.las"));
LasWriter writer;
writer.setOptions(writerOps);
writer.setInput(reader2);
writer.prepare(table);
writer.execute(table);
for (size_t i = 0; i < outname.size(); ++i)
{
std::string filename = Support::temppath(outname[i]);
EXPECT_TRUE(FileUtils::fileExists(filename));
Options ops;
ops.add("filename", filename);
LasReader r;
r.setOptions(ops);
EXPECT_EQ(r.preview().m_pointCount, 355u);
}
}