当前位置: 首页>>代码示例>>C++>>正文


C++ PointRef类代码示例

本文整理汇总了C++中PointRef的典型用法代码示例。如果您正苦于以下问题:C++ PointRef类的具体用法?C++ PointRef怎么用?C++ PointRef使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了PointRef类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: readDimMajor

// This isn't lovely as we have to seek for each dimension access.
void BpfReader::readDimMajor(PointRef& point)
{
    double x(0), y(0), z(0);

    for (size_t dim = 0; dim < m_dims.size(); ++dim)
    {
        seekDimMajor(dim, m_index);

        float f;
        m_stream >> f;
        double d = f + m_dims[dim].m_offset;
        if (m_dims[dim].m_id == Dimension::Id::X)
            x = d;
        else if (m_dims[dim].m_id == Dimension::Id::Y)
            y = d;
        else if (m_dims[dim].m_id == Dimension::Id::Z)
            z = d;
        else
            point.setField(m_dims[dim].m_id, d);
    }

    // Transformation only applies to X, Y and Z
    m_header.m_xform.apply(x, y, z);
    point.setField(Dimension::Id::X, x);
    point.setField(Dimension::Id::Y, y);
    point.setField(Dimension::Id::Z, z);
    m_index++;
}
开发者ID:EricAlex,项目名称:PDAL,代码行数:29,代码来源:BpfReader.cpp

示例2: readPointMajor

void BpfReader::readPointMajor(PointRef& point)
{
    double x(0), y(0), z(0);

    seekPointMajor(m_index);
    for (size_t dim = 0; dim < m_dims.size(); ++dim)
    {
        float f;

        m_stream >> f;
        double d = f + m_dims[dim].m_offset;
        if (m_dims[dim].m_id == Dimension::Id::X)
            x = d;
        else if (m_dims[dim].m_id == Dimension::Id::Y)
            y = d;
        else if (m_dims[dim].m_id == Dimension::Id::Z)
            z = d;
        else
            point.setField(m_dims[dim].m_id, d);
    }

    m_header.m_xform.apply(x, y, z);
    point.setField(Dimension::Id::X, x);
    point.setField(Dimension::Id::Y, y);
    point.setField(Dimension::Id::Z, z);
    m_index++;
}
开发者ID:EricAlex,项目名称:PDAL,代码行数:27,代码来源:BpfReader.cpp

示例3: filter

void ColorizationFilter::filter(PointView& view)
{
    PointRef point = view.point(0);
    for (PointId idx = 0; idx < view.size(); ++idx)
    {
        point.setPointId(idx);
        processOne(point);
    }
}
开发者ID:EricAlex,项目名称:PDAL,代码行数:9,代码来源:ColorizationFilter.cpp

示例4: processOne

        bool processOne(PointRef& point)
        {
            PointRef bulkPoint = m_view->point(m_cnt);

            bulkPoint.getPackedData(m_dims, m_bulkBuf.data());
            point.getPackedData(m_dims, m_buf.data());
            EXPECT_EQ(memcmp(m_buf.data(), m_bulkBuf.data(),
                m_view->pointSize()), 0);
            m_cnt++;
            return true;
        }
开发者ID:pblottiere,项目名称:PDAL,代码行数:11,代码来源:LasReaderTest.cpp

示例5: read

point_count_t TileDBReader::read(PointViewPtr view, point_count_t count)
{
    PointRef point = view->point(0);
    PointId id;
    for (id = 0; id < count; ++id)
    {
        point.setPointId(id);
        if (!processOne(point))
            break;
    }
    return id;   
}
开发者ID:PDAL,项目名称:PDAL,代码行数:12,代码来源:TileDBReader.cpp

示例6: processOne

bool FauxReader::processOne(PointRef& point)
{
    double x(0);
    double y(0);
    double z(0);

    if (m_index >= m_count)
        return false;

    switch (m_mode)
    {
    case Random:
        x = Utils::random(m_minX, m_maxX);
        y = Utils::random(m_minY, m_maxY);
        z = Utils::random(m_minZ, m_maxZ);
        break;
    case Constant:
        x = m_minX;
        y = m_minY;
        z = m_minZ;
        break;
    case Ramp:
        x = m_minX + m_delX * m_index;
        y = m_minY + m_delY * m_index;
        z = m_minZ + m_delZ * m_index;
        break;
    case Uniform:
        x = Utils::uniform(m_minX, m_maxX, m_seed++);
        y = Utils::uniform(m_minY, m_maxY, m_seed++);
        z = Utils::uniform(m_minZ, m_maxZ, m_seed++);
        break;
    case Normal:
        x = Utils::normal(m_mean_x, m_stdev_x, m_seed++);
        y = Utils::normal(m_mean_y, m_stdev_y, m_seed++);
        z = Utils::normal(m_mean_z, m_stdev_z, m_seed++);
        break;
    }

    point.setField(Dimension::Id::X, x);
    point.setField(Dimension::Id::Y, y);
    point.setField(Dimension::Id::Z, z);
    point.setField(Dimension::Id::OffsetTime, m_time++);
    if (m_numReturns > 0)
    {
        point.setField(Dimension::Id::ReturnNumber, m_returnNum);
        point.setField(Dimension::Id::NumberOfReturns, m_numReturns);
        m_returnNum = (m_returnNum % m_numReturns) + 1;
    }
    m_index++;
    return true;
}
开发者ID:EricAlex,项目名称:PDAL,代码行数:51,代码来源:FauxReader.cpp

示例7: ostream

point_count_t LasWriter::fillWriteBuf(const PointView& view,
    PointId startId, std::vector<char>& buf)
{
    point_count_t blocksize = buf.size() / m_lasHeader.pointLen();
    blocksize = (std::min)(blocksize, view.size() - startId);
    PointId lastId = startId + blocksize;

    LeInserter ostream(buf.data(), buf.size());
    PointRef point = (const_cast<PointView&>(view)).point(0);
    for (PointId idx = startId; idx < lastId; idx++)
    {
        point.setPointId(idx);
        fillPointBuf(point, ostream);
    }
    return blocksize;
}
开发者ID:connormanning,项目名称:PDAL,代码行数:16,代码来源:LasWriter.cpp

示例8: processOne

        bool processOne(PointRef& point)
        {
            static int i = 0;

            if (i == 0)
            {
                point.setField(Id::X, 2);
                point.setField(Id::Y, 2);
            }
            else if (i == 1)
            {
                point.setField(Id::X, 6);
                point.setField(Id::Y, 2);
            }
            else if (i == 2)
            {
                point.setField(Id::X, 8);
                point.setField(Id::Y, 2);
            }
            else if (i == 3)
            {
                point.setField(Id::X, 10);
                point.setField(Id::Y, 2);
            }
            else if (i == 4)
            {
                point.setField(Id::X, 12);
                point.setField(Id::Y, 2);
            }
            else
                return false;
            i++;
            return true;
        }
开发者ID:GEO-IASS,项目名称:PDAL,代码行数:34,代码来源:CropFilterTest.cpp

示例9: PointRef

point_count_t Ilvis2Reader::read(PointViewPtr view, point_count_t count)
{
    PointId idx = view->size();
    point_count_t numRead = 0;

    PointRef point = PointRef(*view, 0);
    while (numRead < count)
    {
        point.setPointId(idx++);
        if (!processOne(point))
            break;
        if (m_cb)
            m_cb(*view, idx);
        numRead++;
    }

    return numRead;
}
开发者ID:EricAlex,项目名称:PDAL,代码行数:18,代码来源:Ilvis2Reader.cpp

示例10: processOne

bool FerryFilter::processOne(PointRef& point)
{
    for (const auto& dim_par : m_dimensions_map)
    {
        double v = point.getFieldAs<double>(dim_par.first);
        point.setField(dim_par.second, v);
    }
    return true;
}
开发者ID:Rafaelaniemann,项目名称:PDAL,代码行数:9,代码来源:FerryFilter.cpp

示例11: processOne

bool SbetReader::processOne(PointRef& point)
{
    for (auto di = m_dims.begin(); di != m_dims.end(); ++di)
    {
        double d;
        *m_stream >> d;
        Dimension::Id dim = *di;
        point.setField(dim, d);
    }
    return (m_stream->good());
}
开发者ID:Rafaelaniemann,项目名称:PDAL,代码行数:11,代码来源:SbetReader.cpp

示例12: loadPoint

bool NumpyReader::loadPoint(PointRef& point, point_count_t position)
{
    using namespace Dimension;

    for (const Field& f : m_fields)
        point.setField(f.m_id, f.m_type, (void*)(p_data + f.m_offset));

    if (m_storeXYZ)
    {
        point.setField(Dimension::Id::X, (position % m_xIter) / m_xDiv);
        if (m_ndims > 1)
        {
            point.setField(Dimension::Id::Y, (position % m_yIter) / m_yDiv);
            if (m_ndims > 2)
                point.setField(Dimension::Id::Z, (position % m_zIter) / m_zDiv);
        }
    }

    return (nextPoint());
}
开发者ID:connormanning,项目名称:PDAL,代码行数:20,代码来源:NumpyReader.cpp

示例13: processOne

bool FerryFilter::processOne(PointRef& point)
{
    for (const auto& info : m_dims)
    {
        if (info.m_fromId != Dimension::Id::Unknown)
        {
            double v = point.getFieldAs<double>(info.m_fromId);
            point.setField(info.m_toId, v);
        }
    }
    return true;
}
开发者ID:PDAL,项目名称:PDAL,代码行数:12,代码来源:FerryFilter.cpp

示例14: readByteMajor

void BpfReader::readByteMajor(PointRef& point)
{
    // We need a temp buffer for the point data
    union uu
    {
        float f;
        uint32_t u32;
    } u;
    double x(0), y(0), z(0);
    uint8_t u8;

    for (size_t dim = 0; dim < m_dims.size(); ++dim)
    {
        u.u32 = 0;
        for (size_t b = 0; b < sizeof(float); ++b)
        {
            seekByteMajor(dim, b, m_index);

            m_stream >> u8;
            u.u32 |= ((uint32_t)u8 << (b * CHAR_BIT));
        }
        double d = u.f + m_dims[dim].m_offset;
        if (m_dims[dim].m_id == Dimension::Id::X)
            x = d;
        else if (m_dims[dim].m_id == Dimension::Id::Y)
            y = d;
        else if (m_dims[dim].m_id == Dimension::Id::Z)
            z = d;
        else
            point.setField(m_dims[dim].m_id, d);
    }

    m_header.m_xform.apply(x, y, z);
    point.setField(Dimension::Id::X, x);
    point.setField(Dimension::Id::Y, y);
    point.setField(Dimension::Id::Z, z);
    m_index++;
}
开发者ID:EricAlex,项目名称:PDAL,代码行数:38,代码来源:BpfReader.cpp

示例15: writeValue

void PlyWriter::writeValue(PointRef& point, Dimension::Id dim,
    Dimension::Type type)
{
    if (m_format == Format::Ascii)
    {
        double d = point.getFieldAs<double>(dim);
        *m_stream << d;
    }
    else if (m_format == Format::BinaryLe)
    {
        OLeStream out(m_stream);
        Everything e;
        point.getField((char *)&e, dim, type);
        Utils::insertDim(out, type, e);
    }
    else if (m_format == Format::BinaryBe)
    {
        OBeStream out(m_stream);
        Everything e;
        point.getField((char *)&e, dim, type);
        Utils::insertDim(out, type, e);
    }
}
开发者ID:pblottiere,项目名称:PDAL,代码行数:23,代码来源:PlyWriter.cpp


注:本文中的PointRef类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。