本文整理汇总了C++中dimension::IdList类的典型用法代码示例。如果您正苦于以下问题:C++ IdList类的具体用法?C++ IdList怎么用?C++ IdList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了IdList类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: ready
void GeoWaveWriter::ready(PointTableRef table)
{
// get a list of all the dimensions & their types
Dimension::IdList all = table.layout()->dims();
for (auto di = all.begin(); di != all.end(); ++di)
if (!Utils::contains(m_dims, *di))
m_dims.push_back(*di);
}
开发者ID:PDAL,项目名称:PDAL,代码行数:8,代码来源:GeoWaveWriter.cpp
示例2: getDefaultDimensions
Dimension::IdList FauxReader::getDefaultDimensions()
{
Dimension::IdList ids;
ids.push_back(Dimension::Id::X);
ids.push_back(Dimension::Id::Y);
ids.push_back(Dimension::Id::Z);
ids.push_back(Dimension::Id::OffsetTime);
return ids;
}
开发者ID:EricAlex,项目名称:PDAL,代码行数:10,代码来源:FauxReader.cpp
示例3:
Dimension::IdList Ilvis2Reader::getDefaultDimensions()
{
using namespace pdal::Dimension;
Dimension::IdList ids;
ids.push_back(Id::GpsTime);
ids.push_back(Id::Y);
ids.push_back(Id::X);
ids.push_back(Id::Z);
return ids;
}
开发者ID:EricAlex,项目名称:PDAL,代码行数:11,代码来源:Ilvis2Reader.cpp
示例4: write
void SbetWriter::write(const PointViewPtr view)
{
Dimension::IdList dims = fileDimensions();
for (PointId idx = 0; idx < view->size(); ++idx)
{
for (auto di = dims.begin(); di != dims.end(); ++di)
{
// If a dimension doesn't exist, write 0.
Dimension::Id dim = *di;
*m_stream << (view->hasDim(dim) ?
view->getFieldAs<double>(dim, idx) : 0.0);
}
}
}
开发者ID:chambbj,项目名称:PDAL,代码行数:14,代码来源:SbetWriter.cpp
示例5: loadBpfDimensions
void BpfWriter::loadBpfDimensions(PointLayoutPtr layout)
{
// Verify that we have X, Y and Z and that they're the first three
// dimensions.
Dimension::IdList dims = layout->dims();
std::sort(dims.begin(), dims.end());
if (dims.size() < 3 || dims[0] != Dimension::Id::X ||
dims[1] != Dimension::Id::Y || dims[2] != Dimension::Id::Z)
{
throw pdal_error("Missing one of dimensions X, Y or Z. "
"Can't write BPF.");
}
for (auto id : dims)
{
BpfDimension dim;
dim.m_id = id;
dim.m_label = layout->dimName(id);
m_dims.push_back(dim);
}
}
开发者ID:adam-erickson,项目名称:PDAL,代码行数:21,代码来源:BpfWriter.cpp
示例6: loadBpfDimensions
void BpfWriter::loadBpfDimensions(PointLayoutPtr layout)
{
Dimension::IdList dims;
if (m_outputDims.size())
{
for (std::string& s : m_outputDims)
{
Dimension::Id::Enum id = layout->findDim(s);
if (id == Dimension::Id::Unknown)
{
std::ostringstream oss;
oss << "Invalid dimension '" << s << "' specified for "
"'output_dims' option.";
throw pdal_error(oss.str());
}
dims.push_back(id);
}
}
else
dims = layout->dims();
// Verify that we have X, Y and Z and that they're the first three
// dimensions.
std::sort(dims.begin(), dims.end());
if (dims.size() < 3 || dims[0] != Dimension::Id::X ||
dims[1] != Dimension::Id::Y || dims[2] != Dimension::Id::Z)
{
throw pdal_error("Missing one of dimensions X, Y or Z. "
"Can't write BPF.");
}
for (auto id : dims)
{
BpfDimension dim;
dim.m_id = id;
dim.m_label = layout->dimName(id);
m_dims.push_back(dim);
}
}
开发者ID:neteler,项目名称:PDAL,代码行数:40,代码来源:BpfWriter.cpp
示例7: getDefaultDimensions
Dimension::IdList OptechReader::getDefaultDimensions()
{
Dimension::IdList dims;
dims.push_back(Dimension::Id::X);
dims.push_back(Dimension::Id::Y);
dims.push_back(Dimension::Id::Z);
dims.push_back(Dimension::Id::GpsTime);
dims.push_back(Dimension::Id::ReturnNumber);
dims.push_back(Dimension::Id::NumberOfReturns);
dims.push_back(Dimension::Id::EchoRange);
dims.push_back(Dimension::Id::Intensity);
dims.push_back(Dimension::Id::ScanAngleRank);
return dims;
}
开发者ID:Rafaelaniemann,项目名称:PDAL,代码行数:14,代码来源:OptechReader.cpp
示例8: usedDims
Dimension::IdList LasHeader::usedDims() const
{
using namespace Dimension;
Dimension::Id::Enum dims[] = { Id::ReturnNumber, Id::NumberOfReturns,
Id::X, Id::Y, Id::Z, Id::Intensity, Id::ScanChannel,
Id::ScanDirectionFlag, Id::EdgeOfFlightLine, Id::Classification,
Id::UserData, Id::ScanAngleRank, Id::PointSourceId };
// This mess is because MSVC doesn't support initializer lists.
Dimension::IdList ids;
std::copy(std::begin(dims), std::end(dims), std::back_inserter(ids));
if (hasTime())
ids.push_back(Id::GpsTime);
if (hasColor())
{
ids.push_back(Id::Red);
ids.push_back(Id::Green);
ids.push_back(Id::Blue);
}
if (hasInfrared())
ids.push_back(Id::Infrared);
return ids;
}
开发者ID:cugwhp,项目名称:PDAL,代码行数:26,代码来源:LasHeader.cpp
示例9: inspect
QuickInfo LasReader::inspect()
{
QuickInfo qi;
std::unique_ptr<PointLayout> layout(new PointLayout());
addDimensions(layout.get());
initialize();
Dimension::IdList dims = layout->dims();
for (auto di = dims.begin(); di != dims.end(); ++di)
qi.m_dimNames.push_back(layout->dimName(*di));
qi.m_pointCount =
Utils::saturation_cast<point_count_t>(m_lasHeader.pointCount());
qi.m_bounds = m_lasHeader.getBounds();
qi.m_srs = getSrsFromVlrs();
qi.m_valid = true;
PointTable table;
done(table);
return qi;
}
开发者ID:wenzeslaus,项目名称:PDAL,代码行数:22,代码来源:LasReader.cpp
示例10: inspect
QuickInfo LasReader::inspect()
{
QuickInfo qi;
std::unique_ptr<PointLayout> layout(new PointLayout());
PointTable table;
initialize(table);
addDimensions(layout.get());
Dimension::IdList dims = layout->dims();
for (auto di = dims.begin(); di != dims.end(); ++di)
qi.m_dimNames.push_back(layout->dimName(*di));
if (!Utils::numericCast(m_lasHeader.pointCount(), qi.m_pointCount))
qi.m_pointCount = std::numeric_limits<point_count_t>::max();
qi.m_bounds = m_lasHeader.getBounds();
qi.m_srs = getSpatialReference();
qi.m_valid = true;
done(table);
return qi;
}
开发者ID:davijo,项目名称:PDAL,代码行数:22,代码来源:LasReader.cpp
示例11: read
point_count_t SbetReader::read(PointBuffer& buf, point_count_t count)
{
PointId nextId = buf.size();
PointId idx = m_index;
point_count_t numRead = 0;
seek(idx);
Dimension::IdList dims = getDefaultDimensions();
while (numRead < count && idx < m_numPts)
{
for (auto di = dims.begin(); di != dims.end(); ++di)
{
double d;
*m_stream >> d;
Dimension::Id::Enum dim = *di;
buf.setField(dim, nextId, d);
}
idx++;
nextId++;
numRead++;
}
m_index = idx;
return numRead;
}
开发者ID:pramsey,项目名称:PDAL,代码行数:23,代码来源:SbetReader.cpp
示例12: ready
void TextWriter::ready(PointTableRef table)
{
m_stream->precision(m_precision);
*m_stream << std::fixed;
typedef boost::tokenizer<boost::char_separator<char>> tokenizer;
// Find the dimensions listed and put them on the id list.
boost::char_separator<char> separator(",");
boost::erase_all(m_dimOrder, " "); // Wipe off spaces
tokenizer sdims(m_dimOrder, separator);
for (tokenizer::iterator ti = sdims.begin(); ti != sdims.end(); ++ti)
{
Dimension::Id::Enum d = table.layout()->findDim(*ti);
if (d == Dimension::Id::Unknown)
{
std::ostringstream oss;
oss << "Dimension not found with name '" << *ti <<"'";
throw pdal::dimension_not_found(oss.str());
}
m_dims.push_back(d);
}
// Add the rest of the dimensions to the list if we're doing that.
// Yes, this isn't efficient when, but it's simple.
if (m_dimOrder.empty() || m_writeAllDims)
{
Dimension::IdList all = table.layout()->dims();
for (auto di = all.begin(); di != all.end(); ++di)
if (!contains(m_dims, *di))
m_dims.push_back(*di);
}
if (!m_writeHeader)
log()->get(LogLevel::Debug) << "Not writing header" << std::endl;
else
writeHeader(table);
}
开发者ID:devrimgunduz,项目名称:PDAL,代码行数:37,代码来源:TextWriter.cpp
示例13: ready
void TextWriter::ready(PointTableRef table)
{
m_stream->precision(m_precision);
*m_stream << std::fixed;
// Find the dimensions listed and put them on the id list.
StringList dimNames = Utils::split2(m_dimOrder, ',');
for (std::string dim : dimNames)
{
Utils::trim(dim);
Dimension::Id d = table.layout()->findDim(dim);
if (d == Dimension::Id::Unknown)
{
std::ostringstream oss;
oss << getName() << ": Dimension not found with name '" <<
dim << "'.";
throw pdal_error(oss.str());
}
m_dims.push_back(d);
}
// Add the rest of the dimensions to the list if we're doing that.
// Yes, this isn't efficient when, but it's simple.
if (m_dimOrder.empty() || m_writeAllDims)
{
Dimension::IdList all = table.layout()->dims();
for (auto di = all.begin(); di != all.end(); ++di)
if (!Utils::contains(m_dims, *di))
m_dims.push_back(*di);
}
if (!m_writeHeader)
log()->get(LogLevel::Debug) << "Not writing header" << std::endl;
else
writeHeader(table);
}
开发者ID:Rafaelaniemann,项目名称:PDAL,代码行数:36,代码来源:TextWriter.cpp
示例14: getDefaultDimensions
Dimension::IdList Reader::getDefaultDimensions()
{
Dimension::IdList ids;
using namespace Dimension;
ids.push_back(Id::OffsetTime);
ids.push_back(Id::Y);
ids.push_back(Id::X);
ids.push_back(Id::Z);
ids.push_back(Id::StartPulse);
ids.push_back(Id::ReflectedPulse);
ids.push_back(Id::ScanAngleRank);
ids.push_back(Id::Pitch);
ids.push_back(Id::Roll);
ids.push_back(Id::Pdop);
ids.push_back(Id::PulseWidth);
ids.push_back(Id::GpsTime);
return ids;
}
开发者ID:simonsonc,项目名称:PDAL,代码行数:20,代码来源:Reader.cpp
示例15: read
point_count_t IcebridgeReader::read(PointViewPtr view, point_count_t count)
{
//All data we read for icebridge is currently 4 bytes wide, so
// just allocate once and forget it.
//This could be a huge allocation. Perhaps we should do something
// in the icebridge handler?
PointId startId = view->size();
point_count_t remaining = m_hdf5Handler.getNumPoints() - m_index;
count = std::min(count, remaining);
std::unique_ptr<unsigned char>
rawData(new unsigned char[count * sizeof(float)]);
//Not loving the position-linked data, but fine for now.
Dimension::IdList dims = getDefaultDimensions();
auto di = dims.begin();
for (auto ci = hdf5Columns.begin(); ci != hdf5Columns.end(); ++ci, ++di)
{
PointId nextId = startId;
PointId idx = m_index;
const hdf5::Hdf5ColumnData& column = *ci;
try
{
m_hdf5Handler.getColumnEntries(rawData.get(), column.name, count,
m_index);
void *p = (void *)rawData.get();
// This is ugly but avoids a test in a tight loop.
if (column.predType == H5::PredType::NATIVE_FLOAT)
{
// Offset time is in ms but icebridge stores in seconds.
if (*di == Dimension::Id::OffsetTime)
{
float *fval = (float *)p;
for (PointId i = 0; i < count; ++i)
{
view->setField(*di, nextId++, *fval * 1000);
fval++;
}
}
else
{
float *fval = (float *)p;
for (PointId i = 0; i < count; ++i)
view->setField(*di, nextId++, *fval++);
}
}
else if (column.predType == H5::PredType::NATIVE_INT)
{
int32_t *ival = (int32_t *)p;
for (PointId i = 0; i < count; ++i)
view->setField(*di, nextId++, *ival++);
}
}
catch(...)
{
throw icebridge_error("Error fetching column data");
}
}
return count;
}
开发者ID:adam-erickson,项目名称:PDAL,代码行数:63,代码来源:IcebridgeReader.cpp
示例16: getDefaultDimensions
Dimension::IdList QfitReader::getDefaultDimensions()
{
Dimension::IdList ids;
ids.push_back(Dimension::Id::OffsetTime);
ids.push_back(Dimension::Id::Y);
ids.push_back(Dimension::Id::X);
ids.push_back(Dimension::Id::Z);
ids.push_back(Dimension::Id::StartPulse);
ids.push_back(Dimension::Id::ReflectedPulse);
ids.push_back(Dimension::Id::ScanAngleRank);
ids.push_back(Dimension::Id::Pitch);
ids.push_back(Dimension::Id::Roll);
ids.push_back(Dimension::Id::Pdop);
ids.push_back(Dimension::Id::PulseWidth);
ids.push_back(Dimension::Id::PassiveSignal);
ids.push_back(Dimension::Id::PassiveY);
ids.push_back(Dimension::Id::PassiveX);
ids.push_back(Dimension::Id::PassiveZ);
return ids;
}
开发者ID:pramsey,项目名称:PDAL,代码行数:22,代码来源:QfitReader.cpp
注:本文中的dimension::IdList类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论