Skip to content
Permalink
Browse files
[ci] Add lines to better understand changes in labeling engine test (#…
  • Loading branch information
nirvn committed Apr 18, 2021
1 parent 7c96ec8 commit b6e354f46fb621e14d351a7206fd32dc59977675
Showing with 20 additions and 20 deletions.
  1. +20 −20 tests/src/core/testqgslabelingengine.cpp
  2. BIN .../testdata/control_images/labelingengine/expected_curved_anchor_end/expected_curved_anchor_end.png
  3. BIN ...tdata/control_images/labelingengine/expected_curved_anchor_start/expected_curved_anchor_start.png
  4. BIN ...control_images/labelingengine/expected_curved_hint_anchor_end/expected_curved_hint_anchor_end.png
  5. BIN ...rol_images/labelingengine/expected_curved_hint_anchor_start/expected_curved_hint_anchor_start.png
  6. BIN ...rol_images/labelingengine/expected_curved_strict_anchor_end/expected_curved_strict_anchor_end.png
  7. BIN ...images/labelingengine/expected_curved_strict_anchor_start/expected_curved_strict_anchor_start.png
  8. BIN ...a/control_images/labelingengine/expected_horizontal_anchor_end/expected_horizontal_anchor_end.png
  9. BIN ...ntrol_images/labelingengine/expected_horizontal_anchor_start/expected_horizontal_anchor_start.png
  10. BIN ...images/labelingengine/expected_horizontal_hint_anchor_end/expected_horizontal_hint_anchor_end.png
  11. BIN ...es/labelingengine/expected_horizontal_hint_anchor_start/expected_horizontal_hint_anchor_start.png
  12. BIN ...es/labelingengine/expected_horizontal_strict_anchor_end/expected_horizontal_strict_anchor_end.png
  13. BIN ...abelingengine/expected_horizontal_strict_anchor_start/expected_horizontal_strict_anchor_start.png
  14. BIN ...ges/labelingengine/expected_label_curved_label_above_1/v1/expected_label_curved_label_above_1.png
  15. BIN ...ges/labelingengine/expected_label_curved_label_above_1/v2/expected_label_curved_label_above_1.png
  16. BIN ...ges/labelingengine/expected_label_curved_label_below_1/v1/expected_label_curved_label_below_1.png
  17. BIN ...ges/labelingengine/expected_label_curved_label_below_1/v2/expected_label_curved_label_below_1.png
  18. BIN ...gengine/expected_label_curved_label_small_segments/expected_label_curved_label_small_segments.png
  19. BIN ...ne/expected_label_curved_label_small_segments/expected_label_curved_label_small_segments_mask.png
  20. BIN ...abelingengine/expected_label_curved_negative_distance/expected_label_curved_negative_distance.png
  21. BIN ...ngengine/expected_label_curved_negative_distance/expected_label_curved_negative_distance_mask.png
  22. BIN ...ntrol_images/labelingengine/expected_label_curved_no_overrun/expected_label_curved_no_overrun.png
  23. BIN .../control_images/labelingengine/expected_label_curved_overrun/v1/expected_label_curved_overrun.png
  24. BIN .../control_images/labelingengine/expected_label_curved_overrun/v2/expected_label_curved_overrun.png
  25. BIN ...ine/expected_label_curved_small_feature_centered/expected_label_curved_small_feature_centered.png
  26. BIN ...xpected_label_curved_small_feature_centered/expected_label_curved_small_feature_centered_mask.png
  27. BIN ...abelingengine/expected_label_letter_spacing_map_units/expected_label_letter_spacing_map_units.png
  28. BIN ...abelingengine/expected_label_multipart_touching_lines/expected_label_multipart_touching_lines.png
  29. BIN ...ngengine/expected_label_multipart_touching_lines/expected_label_multipart_touching_lines_mask.png
  30. BIN ...control_images/labelingengine/expected_label_parallel_overrun/expected_label_parallel_overrun.png
  31. BIN ...expected_label_repeat_distance_with_small_line/expected_label_repeat_distance_with_small_line.png
  32. BIN ...ted_label_repeat_distance_with_small_line/expected_label_repeat_distance_with_small_line_mask.png
  33. BIN ...es/labelingengine/expected_label_word_spacing_map_units/expected_label_word_spacing_map_units.png
  34. BIN ...tdata/control_images/labelingengine/expected_parallel_anchor_end/expected_parallel_anchor_end.png
  35. BIN ...a/control_images/labelingengine/expected_parallel_anchor_start/expected_parallel_anchor_start.png
  36. BIN ...rol_images/labelingengine/expected_parallel_hint_anchor_end/expected_parallel_hint_anchor_end.png
  37. BIN ...images/labelingengine/expected_parallel_hint_anchor_start/expected_parallel_hint_anchor_start.png
  38. BIN ...a/control_images/labelingengine/expected_parallel_prefer_above/expected_parallel_prefer_above.png
  39. BIN ...trol_images/labelingengine/expected_parallel_prefer_above/expected_parallel_prefer_above_mask.png
  40. BIN ...images/labelingengine/expected_parallel_strict_anchor_end/expected_parallel_strict_anchor_end.png
  41. BIN ...es/labelingengine/expected_parallel_strict_anchor_start/expected_parallel_strict_anchor_start.png
  42. BIN ...ngine/expected_show_all_labels_when_no_candidates/expected_show_all_labels_when_no_candidates.png
@@ -976,7 +976,7 @@ void TestQgsLabelingEngine::testParallelLabelSmallFeature()
settings.placement = QgsPalLayerSettings::Line;

std::unique_ptr< QgsVectorLayer> vl2( new QgsVectorLayer( QStringLiteral( "linestring?crs=epsg:3148&field=id:integer" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) ) );
vl2->setRenderer( new QgsNullSymbolRenderer() );
vl2->setRenderer( new QgsSingleSymbolRenderer( QgsLineSymbol::createSimple( { {QStringLiteral( "color" ), QStringLiteral( "#000000" )}, {QStringLiteral( "outline_width" ), 0.6} } ) ) );

QgsVectorLayerLabelProvider *provider = new QgsVectorLayerLabelProvider( vl2.get(), QStringLiteral( "test" ), true, &settings );
QgsFeature f( vl2->fields(), 1 );
@@ -1099,7 +1099,7 @@ void TestQgsLabelingEngine::testTouchingParts()
// if treated individually, none of these parts are long enough for the label to fit -- but the label should be rendered if the mergeLines setting is true,
// because the parts should be merged into a single linestring
std::unique_ptr< QgsVectorLayer> vl2( new QgsVectorLayer( QStringLiteral( "MultiLineString?crs=epsg:3946&field=id:integer" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) ) );
vl2->setRenderer( new QgsNullSymbolRenderer() );
vl2->setRenderer( new QgsSingleSymbolRenderer( QgsLineSymbol::createSimple( { {QStringLiteral( "color" ), QStringLiteral( "#000000" )}, {QStringLiteral( "outline_width" ), 0.6} } ) ) );

QgsFeature f;
f.setAttributes( QgsAttributes() << 1 );
@@ -1284,7 +1284,7 @@ void TestQgsLabelingEngine::testCurvedLabelsWithTinySegments()
settings.placement = QgsPalLayerSettings::Curved;

std::unique_ptr< QgsVectorLayer> vl2( new QgsVectorLayer( QStringLiteral( "LineString?crs=epsg:3946&field=id:integer" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) ) );
vl2->setRenderer( new QgsNullSymbolRenderer() );
vl2->setRenderer( new QgsSingleSymbolRenderer( QgsLineSymbol::createSimple( { {QStringLiteral( "color" ), QStringLiteral( "#000000" )}, {QStringLiteral( "outline_width" ), 0.6} } ) ) );

QgsFeature f;
f.setAttributes( QgsAttributes() << 1 );
@@ -1343,7 +1343,7 @@ void TestQgsLabelingEngine::testCurvedLabelCorrectLinePlacement()
settings.maxCurvedCharAngleOut = 99;

std::unique_ptr< QgsVectorLayer> vl2( new QgsVectorLayer( QStringLiteral( "LineString?crs=epsg:4326&field=id:integer" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) ) );
vl2->setRenderer( new QgsNullSymbolRenderer() );
vl2->setRenderer( new QgsSingleSymbolRenderer( QgsLineSymbol::createSimple( { {QStringLiteral( "color" ), QStringLiteral( "#000000" )}, {QStringLiteral( "outline_width" ), 0.6} } ) ) );

QgsFeature f;
f.setAttributes( QgsAttributes() << 1 );
@@ -1409,7 +1409,7 @@ void TestQgsLabelingEngine::testCurvedLabelNegativeDistance()
settings.dist = -5;

std::unique_ptr< QgsVectorLayer> vl2( new QgsVectorLayer( QStringLiteral( "LineString?crs=epsg:3946&field=id:integer" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) ) );
vl2->setRenderer( new QgsNullSymbolRenderer() );
vl2->setRenderer( new QgsSingleSymbolRenderer( QgsLineSymbol::createSimple( { {QStringLiteral( "color" ), QStringLiteral( "#000000" )}, {QStringLiteral( "outline_width" ), 0.6} } ) ) );

QgsFeature f;
f.setAttributes( QgsAttributes() << 1 );
@@ -1462,7 +1462,7 @@ void TestQgsLabelingEngine::testCurvedLabelOnSmallLineNearCenter()
settings.labelPerPart = false;

std::unique_ptr< QgsVectorLayer> vl2( new QgsVectorLayer( QStringLiteral( "LineString?crs=epsg:3946&field=id:integer" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) ) );
vl2->setRenderer( new QgsNullSymbolRenderer() );
vl2->setRenderer( new QgsSingleSymbolRenderer( QgsLineSymbol::createSimple( { {QStringLiteral( "color" ), QStringLiteral( "#000000" )}, {QStringLiteral( "outline_width" ), 0.6} } ) ) );

QgsFeature f;
f.setAttributes( QgsAttributes() << 1 );
@@ -1516,7 +1516,7 @@ void TestQgsLabelingEngine::testRepeatDistanceWithSmallLine()
settings.repeatDistance = 55;

std::unique_ptr< QgsVectorLayer> vl2( new QgsVectorLayer( QStringLiteral( "LineString?crs=epsg:3946&field=id:integer" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) ) );
vl2->setRenderer( new QgsNullSymbolRenderer() );
vl2->setRenderer( new QgsSingleSymbolRenderer( QgsLineSymbol::createSimple( { {QStringLiteral( "color" ), QStringLiteral( "#000000" )}, {QStringLiteral( "outline_width" ), 0.6} } ) ) );

QgsFeature f;
f.setAttributes( QgsAttributes() << 1 );
@@ -1570,7 +1570,7 @@ void TestQgsLabelingEngine::testParallelPlacementPreferAbove()
settings.labelPerPart = false;

std::unique_ptr< QgsVectorLayer> vl2( new QgsVectorLayer( QStringLiteral( "LineString?crs=epsg:3946&field=id:integer" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) ) );
vl2->setRenderer( new QgsNullSymbolRenderer() );
vl2->setRenderer( new QgsSingleSymbolRenderer( QgsLineSymbol::createSimple( { {QStringLiteral( "color" ), QStringLiteral( "#000000" )}, {QStringLiteral( "outline_width" ), 0.6} } ) ) );

QgsFeature f;
f.setAttributes( QgsAttributes() << 1 );
@@ -1864,7 +1864,7 @@ void TestQgsLabelingEngine::drawUnplaced()

// test a label with 0 candidates (line is too short for label)
std::unique_ptr< QgsVectorLayer> vl3( new QgsVectorLayer( QStringLiteral( "LineString?crs=epsg:4326&field=id:integer" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) ) );
vl3->setRenderer( new QgsNullSymbolRenderer() );
vl3->setRenderer( new QgsSingleSymbolRenderer( QgsLineSymbol::createSimple( { {QStringLiteral( "color" ), QStringLiteral( "#000000" )}, {QStringLiteral( "outline_width" ), 0.6} } ) ) );
f.setGeometry( QgsGeometry::fromWkt( QStringLiteral( "LineString(-6.250851540391068 60.6, -6.250851640391068 60.6 )" ) ) );
QVERIFY( vl3->dataProvider()->addFeature( f ) );

@@ -2543,7 +2543,7 @@ void TestQgsLabelingEngine::curvedOverrun()
settings.lineSettings().setOverrunDistance( 0 );

std::unique_ptr< QgsVectorLayer> vl2( new QgsVectorLayer( QStringLiteral( "LineString?crs=epsg:3946&field=id:integer" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) ) );
vl2->setRenderer( new QgsNullSymbolRenderer() );
vl2->setRenderer( new QgsSingleSymbolRenderer( QgsLineSymbol::createSimple( { {QStringLiteral( "color" ), QStringLiteral( "#000000" )}, {QStringLiteral( "outline_width" ), 0.6} } ) ) );

QgsFeature f;
f.setAttributes( QgsAttributes() << 1 );
@@ -2616,7 +2616,7 @@ void TestQgsLabelingEngine::parallelOverrun()
settings.lineSettings().setOverrunDistance( 0 );

std::unique_ptr< QgsVectorLayer> vl2( new QgsVectorLayer( QStringLiteral( "LineString?crs=epsg:3946&field=id:integer" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) ) );
vl2->setRenderer( new QgsNullSymbolRenderer() );
vl2->setRenderer( new QgsSingleSymbolRenderer( QgsLineSymbol::createSimple( { {QStringLiteral( "color" ), QStringLiteral( "#000000" )}, {QStringLiteral( "outline_width" ), 0.6} } ) ) );

QgsFeature f;
f.setAttributes( QgsAttributes() << 1 );
@@ -2946,7 +2946,7 @@ void TestQgsLabelingEngine::testMapUnitLetterSpacing()
settings.setFormat( format );

std::unique_ptr< QgsVectorLayer> vl2( new QgsVectorLayer( QStringLiteral( "LineString?crs=epsg:3946&field=id:integer" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) ) );
vl2->setRenderer( new QgsNullSymbolRenderer() );
vl2->setRenderer( new QgsSingleSymbolRenderer( QgsLineSymbol::createSimple( { {QStringLiteral( "color" ), QStringLiteral( "#000000" )}, {QStringLiteral( "outline_width" ), 0.6} } ) ) );

QgsFeature f;
f.setAttributes( QgsAttributes() << 1 );
@@ -3000,7 +3000,7 @@ void TestQgsLabelingEngine::testMapUnitWordSpacing()
settings.setFormat( format );

std::unique_ptr< QgsVectorLayer> vl2( new QgsVectorLayer( QStringLiteral( "LineString?crs=epsg:3946&field=id:integer" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) ) );
vl2->setRenderer( new QgsNullSymbolRenderer() );
vl2->setRenderer( new QgsSingleSymbolRenderer( QgsLineSymbol::createSimple( { {QStringLiteral( "color" ), QStringLiteral( "#000000" )}, {QStringLiteral( "outline_width" ), 0.6} } ) ) );

QgsFeature f;
f.setAttributes( QgsAttributes() << 1 );
@@ -3137,7 +3137,7 @@ void TestQgsLabelingEngine::testLineAnchorParallel()
settings.lineSettings().setLineAnchorPercent( 0.0 );

std::unique_ptr< QgsVectorLayer> vl2( new QgsVectorLayer( QStringLiteral( "LineString?crs=epsg:3946&field=id:integer" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) ) );
vl2->setRenderer( new QgsNullSymbolRenderer() );
vl2->setRenderer( new QgsSingleSymbolRenderer( QgsLineSymbol::createSimple( { {QStringLiteral( "color" ), QStringLiteral( "#000000" )}, {QStringLiteral( "outline_width" ), 0.6} } ) ) );

QgsFeature f;
f.setAttributes( QgsAttributes() << 1 );
@@ -3201,7 +3201,7 @@ void TestQgsLabelingEngine::testLineAnchorParallelConstraints()
settings.lineSettings().setAnchorType( QgsLabelLineSettings::AnchorType::HintOnly );

std::unique_ptr< QgsVectorLayer> vl2( new QgsVectorLayer( QStringLiteral( "LineString?crs=epsg:3946&field=id:integer" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) ) );
vl2->setRenderer( new QgsNullSymbolRenderer() );
vl2->setRenderer( new QgsSingleSymbolRenderer( QgsLineSymbol::createSimple( { {QStringLiteral( "color" ), QStringLiteral( "#000000" )}, {QStringLiteral( "outline_width" ), 0.6} } ) ) );

QgsFeature f;
f.setAttributes( QgsAttributes() << 1 );
@@ -3283,7 +3283,7 @@ void TestQgsLabelingEngine::testLineAnchorCurved()
settings.lineSettings().setLineAnchorPercent( 0.0 );

std::unique_ptr< QgsVectorLayer> vl2( new QgsVectorLayer( QStringLiteral( "LineString?crs=epsg:3946&field=id:integer" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) ) );
vl2->setRenderer( new QgsNullSymbolRenderer() );
vl2->setRenderer( new QgsSingleSymbolRenderer( QgsLineSymbol::createSimple( { {QStringLiteral( "color" ), QStringLiteral( "#000000" )}, {QStringLiteral( "outline_width" ), 0.6} } ) ) );

QgsFeature f;
f.setAttributes( QgsAttributes() << 1 );
@@ -3347,7 +3347,7 @@ void TestQgsLabelingEngine::testLineAnchorCurvedConstraints()
settings.lineSettings().setAnchorType( QgsLabelLineSettings::AnchorType::HintOnly );

std::unique_ptr< QgsVectorLayer> vl2( new QgsVectorLayer( QStringLiteral( "LineString?crs=epsg:3946&field=id:integer" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) ) );
vl2->setRenderer( new QgsNullSymbolRenderer() );
vl2->setRenderer( new QgsSingleSymbolRenderer( QgsLineSymbol::createSimple( { {QStringLiteral( "color" ), QStringLiteral( "#000000" )}, {QStringLiteral( "outline_width" ), 0.6} } ) ) );

QgsFeature f;
f.setAttributes( QgsAttributes() << 1 );
@@ -3429,7 +3429,7 @@ void TestQgsLabelingEngine::testLineAnchorHorizontal()
settings.lineSettings().setLineAnchorPercent( 0.0 );

std::unique_ptr< QgsVectorLayer> vl2( new QgsVectorLayer( QStringLiteral( "LineString?crs=epsg:3946&field=id:integer" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) ) );
vl2->setRenderer( new QgsNullSymbolRenderer() );
vl2->setRenderer( new QgsSingleSymbolRenderer( QgsLineSymbol::createSimple( { {QStringLiteral( "color" ), QStringLiteral( "#000000" )}, {QStringLiteral( "outline_width" ), 0.6} } ) ) );

QgsFeature f;
f.setAttributes( QgsAttributes() << 1 );
@@ -3493,7 +3493,7 @@ void TestQgsLabelingEngine::testLineAnchorHorizontalConstraints()
settings.lineSettings().setAnchorType( QgsLabelLineSettings::AnchorType::HintOnly );

std::unique_ptr< QgsVectorLayer> vl2( new QgsVectorLayer( QStringLiteral( "LineString?crs=epsg:3946&field=l:string" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) ) );
vl2->setRenderer( new QgsNullSymbolRenderer() );
vl2->setRenderer( new QgsSingleSymbolRenderer( QgsLineSymbol::createSimple( { {QStringLiteral( "color" ), QStringLiteral( "#000000" )}, {QStringLiteral( "outline_width" ), 0.6} } ) ) );

QgsFeature f;
f.setAttributes( QgsAttributes() << QVariant() );
@@ -3641,7 +3641,7 @@ void TestQgsLabelingEngine::testShowAllLabelsWhenALabelHasNoCandidates()
settings.lineSettings().setOverrunDistance( 50 );

std::unique_ptr< QgsVectorLayer> vl2( new QgsVectorLayer( QStringLiteral( "LineString?crs=epsg:23700&field=l:string" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) ) );
vl2->setRenderer( new QgsNullSymbolRenderer() );
vl2->setRenderer( new QgsSingleSymbolRenderer( QgsLineSymbol::createSimple( { {QStringLiteral( "color" ), QStringLiteral( "#000000" )}, {QStringLiteral( "outline_width" ), 0.6} } ) ) );

QgsFeature f;
f.setAttributes( QgsAttributes() << QVariant() );
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.

0 comments on commit b6e354f

Please sign in to comment.