本文整理汇总了C++中PipelineManager::commonOptions方法的典型用法代码示例。如果您正苦于以下问题:C++ PipelineManager::commonOptions方法的具体用法?C++ PipelineManager::commonOptions怎么用?C++ PipelineManager::commonOptions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PipelineManager
的用法示例。
在下文中一共展示了PipelineManager::commonOptions方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: execute
int SmoothKernel::execute()
{
PointTable table;
Stage& readerStage(makeReader(m_inputFile, ""));
// go ahead and prepare/execute on reader stage only to grab input
// PointViewSet, this makes the input PointView available to both the
// processing pipeline and the visualizer
readerStage.prepare(table);
PointViewSet viewSetIn = readerStage.execute(table);
// the input PointViewSet will be used to populate a BufferReader that is
// consumed by the processing pipeline
PointViewPtr input_view = *viewSetIn.begin();
PipelineManager manager;
manager.commonOptions() = m_manager.commonOptions();
manager.stageOptions() = m_manager.stageOptions();
BufferReader& bufferReader =
static_cast<BufferReader&>(manager.makeReader("", "readers.buffer"));
bufferReader.addView(input_view);
std::ostringstream ss;
ss << "{";
ss << " \"pipeline\": {";
ss << " \"filters\": [{";
ss << " \"name\": \"MovingLeastSquares\"";
ss << " }]";
ss << " }";
ss << "}";
Options smoothOptions;
smoothOptions.add("json", ss.str());
Stage& smoothStage = manager.makeFilter("filters.pclblock", bufferReader);
smoothStage.addOptions(smoothOptions);
Stage& writer(Kernel::makeWriter(m_outputFile, smoothStage, ""));
writer.prepare(table);
// process the data, grabbing the PointViewSet for visualization of the
// resulting PointView
PointViewSet viewSetOut = writer.execute(table);
if (isVisualize())
visualize(*viewSetOut.begin());
//visualize(*viewSetIn.begin(), *viewSetOut.begin());
return 0;
}
示例2: getFileInfo
TIndexKernel::FileInfo TIndexKernel::getFileInfo(KernelFactory& factory,
const std::string& filename)
{
FileInfo fileInfo;
PipelineManager manager;
manager.commonOptions() = m_manager.commonOptions();
manager.stageOptions() = m_manager.stageOptions();
// Need to make sure options get set.
Stage& reader = manager.makeReader(filename, "");
if (m_fastBoundary)
{
QuickInfo qi = reader.preview();
std::stringstream polygon;
polygon << "POLYGON ((";
polygon << qi.m_bounds.minx << " " << qi.m_bounds.miny;
polygon << ", " << qi.m_bounds.maxx << " " << qi.m_bounds.miny;
polygon << ", " << qi.m_bounds.maxx << " " << qi.m_bounds.maxy;
polygon << ", " << qi.m_bounds.minx << " " << qi.m_bounds.maxy;
polygon << ", " << qi.m_bounds.minx << " " << qi.m_bounds.miny;
polygon << "))";
fileInfo.m_boundary = polygon.str();
if (!qi.m_srs.empty())
fileInfo.m_srs = qi.m_srs.getWKT();
}
else
{
Stage& hexer = manager.makeFilter("filters.hexbin", reader);
PointTable table;
hexer.prepare(table);
PointViewSet set = hexer.execute(table);
MetadataNode m = table.metadata();
m = m.findChild("filters.hexbin:boundary");
fileInfo.m_boundary = m.value();
PointViewPtr v = *set.begin();
if (!v->spatialReference().empty())
fileInfo.m_srs = v->spatialReference().getWKT();
}
FileUtils::fileTimes(filename, &fileInfo.m_ctime, &fileInfo.m_mtime);
fileInfo.m_filename = filename;
return fileInfo;
}
示例3: visualize
void Kernel::visualize(PointViewPtr view)
{
PipelineManager manager;
manager.commonOptions() = m_manager.commonOptions();
manager.stageOptions() = m_manager.stageOptions();
BufferReader& reader =
static_cast<BufferReader&>(manager.makeReader("", "readers.buffer"));
reader.addView(view);
Stage& writer = manager.makeWriter("", "writers.pclvisualizer", reader);
PointTable table;
writer.prepare(table);
writer.execute(table);
}