本文整理汇总了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");
}
示例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);
}
}
示例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");
}
示例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");
}
示例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");
}
示例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");
}
示例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");
}