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


C++ AnnotationTest::checkRendering方法代码示例

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


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

示例1:

TEST(Annotations, FillAnnotation) {
    AnnotationTest test;

    Polygon<double> polygon = {{ {{ { 0, 0 }, { 0, 45 }, { 45, 45 }, { 45, 0 } }} }};
    FillAnnotation annotation { polygon };
    annotation.color = { 255, 0, 0, 1 };

    test.map.setStyleJSON(util::read_file("test/fixtures/api/empty.json"));
    test.map.addAnnotation(annotation);
    test.checkRendering("fill_annotation");

    test.map.setZoom(test.map.getMaxZoom());
    test.checkRendering("fill_annotation_max_zoom");
}
开发者ID:CyberLight,项目名称:mapbox-gl-native,代码行数:14,代码来源:annotations.cpp

示例2: namedMarker

TEST(Annotations, SymbolAnnotation) {
    AnnotationTest test;

    test.map.setStyleJSON(util::read_file("test/fixtures/api/empty.json"));
    test.map.addAnnotationIcon("default_marker", namedMarker("default_marker.png"));
    test.map.addAnnotation(SymbolAnnotation { Point<double>(0, 0), "default_marker" });
    test.checkRendering("point_annotation");

    auto size = test.view.size;
    auto screenBox = ScreenBox { {}, { double(size.width), double(size.height) } };
    for (uint8_t zoom = test.map.getMinZoom(); zoom <= test.map.getMaxZoom(); ++zoom) {
        test.map.setZoom(zoom);
        test.checkRendering("point_annotation");
        EXPECT_EQ(test.map.queryPointAnnotations(screenBox).size(), 1u);
    }
}
开发者ID:Mappy,项目名称:mapbox-gl-native,代码行数:16,代码来源:annotations.test.cpp

示例3:

TEST(Annotations, SwitchStyle) {
    AnnotationTest test;

    test.map.getStyle().loadJSON(util::read_file("test/fixtures/api/empty.json"));
    test.map.addAnnotationImage(namedMarker("default_marker"));
    test.map.addAnnotation(SymbolAnnotation { Point<double> { 0, 0 }, "default_marker" });

    test.frontend.render(test.map);

    test.map.getStyle().loadJSON(util::read_file("test/fixtures/api/empty.json"));
    test.checkRendering("switch_style");
}
开发者ID:1SpatialGroupLtd,项目名称:mapbox-gl-native,代码行数:12,代码来源:annotations.test.cpp

示例4: namedImage

TEST(Annotations, ReaddImage) {
    AnnotationTest test;

    test.map.getStyle().loadJSON(util::read_file("test/fixtures/api/empty.json"));
    test.map.addAnnotationImage(namedMarker("default_marker"));
    test.map.addAnnotation(SymbolAnnotation { Point<double> { 0, 0 }, "default_marker" });

    test.frontend.render(test.map);

    test.map.addAnnotationImage(std::make_unique<style::Image>("default_marker", namedImage("flipped_marker"), 1.0));
    test.checkRendering("readd_image");
}
开发者ID:1SpatialGroupLtd,项目名称:mapbox-gl-native,代码行数:12,代码来源:annotations.test.cpp

示例5: namedMarker

TEST(Annotations, AddMultiple) {
    AnnotationTest test;

    test.map.setStyleJSON(util::read_file("test/fixtures/api/empty.json"));
    test.map.addAnnotationIcon("default_marker", namedMarker("default_marker.png"));
    test.map.addAnnotation(SymbolAnnotation { Point<double> { -10, 0 }, "default_marker" });

    test::render(test.map);

    test.map.addAnnotation(SymbolAnnotation { Point<double> { 10, 0 }, "default_marker" });
    test.checkRendering("add_multiple");
}
开发者ID:CyberLight,项目名称:mapbox-gl-native,代码行数:12,代码来源:annotations.cpp

示例6:

TEST(Annotations, DebugEmpty) {
    // This test should render nothing, not even the tile borders. Tile borders are only rendered
    // when there is an actual tile we're trying to render, but since there is no annotation, we
    // should not render them.
    AnnotationTest test;

    test.map.setStyleJSON(util::read_file("test/fixtures/api/empty.json"));
    test.map.setDebug(MapDebugOptions::TileBorders);
    test.map.setZoom(1);

    test.checkRendering("debug_empty");
}
开发者ID:Mappy,项目名称:mapbox-gl-native,代码行数:12,代码来源:annotations.test.cpp

示例7:

TEST(Annotations, UpdateFillAnnotationStyle) {
    AnnotationTest test;

    Polygon<double> polygon = {{ {{ { 0, 0 }, { 0, 45 }, { 45, 45 }, { 45, 0 } }} }};
    FillAnnotation annotation { polygon };
    annotation.color = { { 255, 0, 0, 1 } };

    test.map.setStyleJSON(util::read_file("test/fixtures/api/empty.json"));
    AnnotationID fill = test.map.addAnnotation(annotation);

    test::render(test.map, test.view);

    annotation.color = { { 0, 255, 0, 1 } };
    test.map.updateAnnotation(fill, annotation);
    test.checkRendering("update_fill_style");
}
开发者ID:manimaul,项目名称:mapbox-gl-native,代码行数:16,代码来源:annotations.test.cpp


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