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


C++ PointLayoutPtr::findDim方法代码示例

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


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

示例1: ready

void FerryFilter::ready(PointTableRef table)
{
    const PointLayoutPtr layout(table.layout());
    for (const auto& dim_par : m_name_map)
    {
        Dimension::Id f = layout->findDim(dim_par.first);
        Dimension::Id t = layout->findDim(dim_par.second);
        m_dimensions_map.insert(std::make_pair(f,t));
    }
}
开发者ID:Rafaelaniemann,项目名称:PDAL,代码行数:10,代码来源:FerryFilter.cpp

示例2:

TEST(TextReaderTest, insertHeader)
{
    TextReader reader;
    Options options;
    options.add("header", "A,B,C,G");
    options.add("filename", Support::datapath("text/crlf_test.txt"));
    reader.setOptions(options);

    PointTable table;
    reader.prepare(table);
    PointViewSet pointViewSet = reader.execute(table);
    PointViewPtr pointViewPtr = *pointViewSet.begin();

    EXPECT_EQ(pointViewPtr->size(), 11U);
    PointLayoutPtr layout = table.layout();
    EXPECT_TRUE(layout->findDim("A") != Dimension::Id::Unknown);
    EXPECT_TRUE(layout->findDim("B") != Dimension::Id::Unknown);
    EXPECT_TRUE(layout->findDim("C") != Dimension::Id::Unknown);
    EXPECT_TRUE(layout->findDim("G") != Dimension::Id::Unknown);
}
开发者ID:PDAL,项目名称:PDAL,代码行数:20,代码来源:TextReaderTest.cpp

示例3: prepared

void RangeFilter::prepared(PointTableRef table)
{
    const PointLayoutPtr layout(table.layout());

    for (auto& r : m_range_list)
    {
        r.m_id = layout->findDim(r.m_name);
        if (r.m_id == Dimension::Id::Unknown)
            throwError("Invalid dimension name in 'limits' option: '" +
                r.m_name + "'.");
    }
    std::sort(m_range_list.begin(), m_range_list.end());
}
开发者ID:pblottiere,项目名称:PDAL,代码行数:13,代码来源:RangeFilter.cpp

示例4: verify

TEST(GDALReaderTest, simple)
{
    Options ro;
    ro.add("filename", Support::datapath("png/autzen-height.png"));

    GDALReader gr;
    gr.setOptions(ro);

    PointTable t;
    gr.prepare(t);
    PointViewSet s = gr.execute(t);
    PointViewPtr v = *s.begin();
    PointLayoutPtr l = t.layout();
    Dimension::Id::Enum id1 = l->findDim("band-1");
    Dimension::Id::Enum id2 = l->findDim("band-2");
    Dimension::Id::Enum id3 = l->findDim("band-3");
    EXPECT_EQ(v->size(), (size_t)(735 * 973));

    auto verify = [v, id1, id2, id3]
        (PointId idx, double xx, double xy, double xr, double xg, double xb)
    {
        double r, g, b, x, y;
        x = v->getFieldAs<double>(Dimension::Id::X, idx);
        y = v->getFieldAs<double>(Dimension::Id::Y, idx);
        r = v->getFieldAs<double>(id1, idx);
        g = v->getFieldAs<double>(id2, idx);
        b = v->getFieldAs<double>(id3, idx);
        EXPECT_DOUBLE_EQ(x, xx);
        EXPECT_DOUBLE_EQ(y, xy);
        EXPECT_DOUBLE_EQ(r, xr);
        EXPECT_DOUBLE_EQ(g, xg);
        EXPECT_DOUBLE_EQ(b, xb);
    };

    verify(0, .5, .5, 0, 0, 0);
    verify(120000, 195.5, 163.5, 255, 213, 0);
    verify(290000, 410.5, 394.5, 0, 255, 206);
    verify(715154, 734.5, 972.5, 0, 0, 0);
}
开发者ID:EricAlex,项目名称:PDAL,代码行数:39,代码来源:GDALReaderTest.cpp

示例5: 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);
    }
}
开发者ID:PDAL,项目名称:PDAL,代码行数:14,代码来源:FerryFilter.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


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