[geometry] 2-parameter touches() properly dispatched for non-areal geometries, fixed sub_geometry::get() for multi geometries - const correctness

This commit is contained in:
Adam Wulkiewicz
2013-12-15 03:43:07 +01:00
parent 1016b34992
commit 8f5aa8f236
3 changed files with 70 additions and 13 deletions

View File

@@ -32,6 +32,8 @@ void test_all()
{
typedef bg::model::polygon<P> polygon;
typedef bg::model::multi_polygon<polygon> mp;
typedef bg::model::linestring<P> linestring;
typedef bg::model::multi_linestring<linestring> ml;
test_self_touches<mp>("MULTIPOLYGON(((0 0,0 100,100 100,100 0,0 0)))",
false);
@@ -62,10 +64,22 @@ void test_all()
true);
// Touch plus inside
// TODO fix this
test_touches<mp, mp>("MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((20 0,20 10,30 10,30 0,20 0)))",
"MULTIPOLYGON(((10 10,10 20,20 20,20 10,10 10)),((22 2,28 2,28 8,22 8,22 2)))",
false);
test_touches<mp, ml>("MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((20 0,20 10,30 10,30 0,20 0)))",
"MULTILINESTRING((10 10,10 20,20 20,20 10,10 10),(30 10,30 20,40 20,40 10,30 10))",
true);
test_touches<mp, ml>("MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((20 0,20 10,30 10,30 0,20 0)))",
"MULTILINESTRING((10 10,10 20,20 20,20 10,10 10),(22 2,28 2,28 8,22 8,22 2))",
false);
test_touches<mp, ml>("MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((20 0,20 10,30 10,30 0,20 0)))",
"MULTILINESTRING((10 10,10 20,20 20,20 10,10 10),(50 2,60 2,60 8,50 8,50 2))",
true);
}
int test_main( int , char* [] )