本文整理汇总了C++中PointLayoutPtr::dimType方法的典型用法代码示例。如果您正苦于以下问题:C++ PointLayoutPtr::dimType方法的具体用法?C++ PointLayoutPtr::dimType怎么用?C++ PointLayoutPtr::dimType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PointLayoutPtr
的用法示例。
在下文中一共展示了PointLayoutPtr::dimType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: writePoint
void PlyWriter::writePoint(PointRef& point, PointLayoutPtr layout)
{
for (auto it = m_dims.begin(); it != m_dims.end();)
{
Dimension::Id dim = *it;
writeValue(point, dim, layout->dimType(dim));
++it;
if (m_format == Format::Ascii && it != m_dims.end())
*m_stream << " ";
}
if (m_format == Format::Ascii)
*m_stream << std::endl;
}
示例2: addDimensions
void FerryFilter::addDimensions(PointLayoutPtr layout)
{
for (auto& info : m_dims)
{
const Dimension::Id fromId = layout->findDim(info.m_fromName);
// Dimensions being created with the "=>Dim" syntax won't
// be in the layout, so we have to assign a default type.
Dimension::Type fromType = layout->dimType(fromId);
if (fromType == Dimension::Type::None)
fromType = Dimension::Type::Double;
info.m_toId = layout->registerOrAssignDim(info.m_toName, fromType);
}
}
示例3: toMetadata
inline MetadataNode toMetadata(PointTableRef table)
{
const PointLayoutPtr layout(table.layout());
MetadataNode root;
for (const auto& id : layout->dims())
{
MetadataNode dim("dimensions");
dim.add("name", layout->dimName(id));
Dimension::Type::Enum t = layout->dimType(id);
dim.add("type", Dimension::toName(Dimension::base(t)));
dim.add("size", layout->dimSize(id));
root.addList(dim);
}
return root;
}
示例4: writeHeader
void PlyWriter::writeHeader(PointLayoutPtr layout) const
{
*m_stream << "ply" << std::endl;
*m_stream << "format " << m_format << " 1.0" << std::endl;
*m_stream << "comment Generated by PDAL" << std::endl;
*m_stream << "element vertex " << pointCount() << std::endl;
auto ni = m_dimNames.begin();
for (auto dim : m_dims)
{
std::string name = *ni++;
std::string typeString = getType(layout->dimType(dim));
*m_stream << "property " << typeString << " " << name << std::endl;
}
if (m_faces)
{
*m_stream << "element face " << faceCount() << std::endl;
*m_stream << "property list uint8 uint32 vertex_indices" << std::endl;
}
*m_stream << "end_header" << std::endl;
}