コード例 #1
0
ファイル: QFITReaderTest.cpp プロジェクト: AsherBond/PDAL
void Check_Point(const pdal::PointBuffer& data,
                 std::size_t index,
                 double xref, double yref, double zref,
                 boost::int32_t tref)
{
    const ::pdal::Schema& schema = data.getSchema();

    Dimension const& dimX = schema.getDimension("X");
    Dimension const& dimY = schema.getDimension("Y");
    Dimension const& dimZ = schema.getDimension("Z");
    Dimension const& dimTime = schema.getDimension("Time");


    boost::int32_t x = data.getField<boost::int32_t>(dimX, index);
    boost::int32_t y = data.getField<boost::int32_t>(dimY, index);
    boost::int32_t z = data.getField<boost::int32_t>(dimZ, index);
    boost::int32_t t = data.getField<boost::int32_t>(dimTime, index);

    double x0 = dimX.applyScaling<boost::int32_t>(x);
    double y0 = dimY.applyScaling<boost::int32_t>(y);
    double z0 = dimZ.applyScaling<boost::int32_t>(z);

    Compare(x0, xref);
    Compare(y0, yref);
    Compare(z0, zref);
    BOOST_CHECK_EQUAL(t, tref);
}
コード例 #2
0
ファイル: Support.cpp プロジェクト: dakcarto/PDAL
void Support::check_pN(const pdal::PointBuffer& data,
                       std::size_t index,
                       double xref, double yref, double zref)
{
    const ::pdal::Schema& schema = data.getSchema();

    pdal::Dimension const& dimX = schema.getDimension("X");
    pdal::Dimension const& dimY = schema.getDimension("Y");
    pdal::Dimension const& dimZ = schema.getDimension("Z");

    boost::int32_t x0raw = data.getField<boost::int32_t>(dimX, index);
    boost::int32_t y0raw = data.getField<boost::int32_t>(dimY, index);
    boost::int32_t z0raw = data.getField<boost::int32_t>(dimZ, index);

    double x0 = dimX.applyScaling<boost::int32_t>(x0raw);
    double y0 = dimY.applyScaling<boost::int32_t>(y0raw);
    double z0 = dimZ.applyScaling<boost::int32_t>(z0raw);

    BOOST_CHECK_CLOSE(x0, xref, 0.001);
    BOOST_CHECK_CLOSE(y0, yref, 0.001);
    BOOST_CHECK_CLOSE(z0, zref, 0.001);
}
コード例 #3
0
ファイル: Support.cpp プロジェクト: dakcarto/PDAL
void Support::check_pN(const pdal::PointBuffer& data,
                       std::size_t index,
                       double xref, double yref, double zref,
                       double tref,
                       boost::uint16_t rref, boost::uint16_t gref, boost::uint16_t bref)
{
    check_pN(data, index, xref, yref, zref);

    const ::pdal::Schema& schema = data.getSchema();


    boost::optional<pdal::Dimension const&> dimTime = schema.getDimensionOptional("Time");

    if (dimTime)
    {
        double t0 = data.getField<double>(*dimTime, index);
        BOOST_CHECK_EQUAL(t0, tref);

    }

    boost::optional<pdal::Dimension const&> dimRed = schema.getDimensionOptional("Red");
    boost::optional<pdal::Dimension const&> dimGreen = schema.getDimensionOptional("Green");
    boost::optional<pdal::Dimension const&> dimBlue = schema.getDimensionOptional("Blue");

    if (dimRed)
    {
        boost::uint16_t r0 = data.getField<boost::uint16_t>(*dimRed, index);
        boost::uint16_t g0 = data.getField<boost::uint16_t>(*dimGreen, index);
        boost::uint16_t b0 = data.getField<boost::uint16_t>(*dimBlue, index);
        BOOST_CHECK_EQUAL(r0, rref);
        BOOST_CHECK_EQUAL(g0, gref);
        BOOST_CHECK_EQUAL(b0, bref);
    }

    return;
}
コード例 #4
0
ファイル: ScalingFilterTest.cpp プロジェクト: PingYang/PDAL
static void getDoublePoint(const pdal::PointBuffer& data, double& x, double& y, double& z, 
                            boost::uint16_t& intensity, boost::int8_t& scan_angle, boost::uint16_t& green)
{
    using namespace pdal;

    const Schema& schema = data.getSchema();

    const int indexX = schema.getDimensionIndex(Dimension::Field_X, Dimension::Double);
    const int indexY = schema.getDimensionIndex(Dimension::Field_Y, Dimension::Double);
    const int indexZ = schema.getDimensionIndex(Dimension::Field_Z, Dimension::Double);
    const int indexIntensity = schema.getDimensionIndex(Dimension::Field_Intensity, Dimension::Uint8);
    const int indexScanAngle = schema.getDimensionIndex(Dimension::Field_ScanAngleRank, Dimension::Int8);
    const int indexGreen = schema.getDimensionIndex(Dimension::Field_Green, Dimension::Uint16);


    x = data.getField<double>(0, indexX);
    y = data.getField<double>(0, indexY);
    z = data.getField<double>(0, indexZ);
    scan_angle = data.getField<boost::int8_t>(0, indexScanAngle);
    intensity = data.getField<boost::uint16_t>(0, indexIntensity);
    green = data.getField<boost::uint16_t>(0, indexGreen);

    return;
}