Files
secondo/Tests/Testspecs/planesweepalgebra/planesweep.test
2026-01-23 17:03:45 +08:00

474 lines
16 KiB
Plaintext

#This file is part of SECONDO.
#
#Copyright (C) 2004, University in Hagen, Department of Computer Science,
#Database Systems for New Applications.
#
#SECONDO is free software; you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation; either version 2 of the License, or
#(at your option) any later version.
#
#SECONDO is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU General Public License for more details.
#
#You should have received a copy of the GNU General Public License
#along with SECONDO; if not, write to the Free Software
#Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# A test for the PlaneSweepAlgebra
# June 2006 Frank Hoffmann
# Run with : Go to directory $(SECONODO_BUILD_DIR)/bin and type
# SecondoBDB -test -i $(SECONODO_BUILD_DIR)/Tests/Testspecs/planesweepalgebra/planesweep.test
# Duration: about 25 minutes (Microsoft Windows Platform)
# clean up what may be left over from e.g. a segfault
delete database planesweeptest;
#setup
create database planesweeptest;
open database planesweeptest;
let testreg1 = [const region value((((1 1)(3 3)(8 3)(6 1))))];
let testreg2 = [const region value((((5 2)(7 4)(12 4)(10 2))))];
let testline1 = [const line value((13 1 16 4))];
let testline2 = [const line value((16 1 13 4))];
let testline3 = [const line value((2 0 6 4))];
let testline40 = [const line value((1 1 4 4))];
let testline41 = [const line value((3 1 2 2)(2 2 3 3)(3 3 2 4))];
let testreg30 = [const region value((((6.0 1.0)(8.0 3.0)(13.0 3.0)(11.0 1.0))))];
let testreg31 = [const region value((((3.0 3.0)(5.0 5.0)(10.0 5.0)(8.0 3.0))))];
let testline4 = [const line value ((1 1 1 4))];
let testline5 = [const line value ((3 1 3 4))];
let testline6 = [const line value ((5 1 5 4))];
let testline7 = [const line value ((7 1 7 4))];
let testline8 = [const line value ((9 1 9 4))];
let testline9 = [const line value ((11 1 11 4))];
let testline10 = [const line value ((1 2 1 3))];
let testline11 = [const line value ((3 1 3 2))];
let testline12 = [const line value ((5 3 5 4))];
let testline13 = [const line value ((7 3 8 3))];
let testline14 = [const line value ((9 4 10 4))];
let testline15 = [const line value ((11 1 12 1))];
let testline16 = [const line value ((13 1 14.5 4))];
let testline17 = [const line value ((13.5 2 14 3))];
let testline18 = [const line value ((14 1 15.5 4))];
let testline19 = [const line value ((15 3 15.5 4))];
let testline20 = [const line value ((15 1 16.0 3))];
let testline21 = [const line value ((15.5 2 16.5 4))];
let testline32 = [const line value ((1 1 1 3))];
let testline33 = [const line value ((1 2 1 4))];
let testline34 = [const line value ((1 1 1 4))];
let testline35 = [const line value ((0 2 2 2))];
let testreg3 = [const region value((((1 1)(1 5)(4 5)(4 1))))];
let testreg4 = [const region value((((1 3)(1 4)(4 4)(4 3))))];
let testreg5 = [const region value((((6 1)(6 5)(9 5)(9 1))))];
let testreg6 = [const region value((((6 1)(6 2)(9 2)(9 1))))];
let testreg7 = [const region value((((11 1)(11 3)(14 3)(14 1))))];
let testreg8 = [const region value((((14 2)(14 5)(17 5)(17 2))))];
let testreg9 = [const region value((((19 1)(19 3)(22 3)(22 1))))];
let testreg10 = [const region value((((20 2)(20 4)(23 4)(23 2))))];
#testcase Realm Simple Regions 1
#yields (region((( (6.0 1.0) (1.0 1.0) (3.0 3.0) (6.0 3.0) (8.0 3.0) (7.0 2.0) ))))
query realm(testreg1, testreg2);
#testcase Realm Simple Regions 2
#yields (region((( (7.0 2.0)(5.0 2.0) (6.0 3.0) (7.0 4.0) (12.0 4.0) (10.0 2.0) ))))
query realm(testreg2, testreg1);
#testcase Realm Simple Lines 1
#yields (line( (13.0 1.0 14.5 2.5)(14.5 2.5 16.0 4.0) ))
query realm(testline1, testline2);
#testcase Realm Simple Lines 2
#yields (line( (13.0 4.0 14.5 2.5)(14.5 2.5 16.0 1.0) ))
query realm(testline2, testline1);
#testcase Realm Simple Lines 3
#yields (line((1.0 1.0 2.0 2.0)(2.0 2.0 3.0 3.0)(3.0 3.0 4.0 4.0)))
query realm(testline40, testline41);
#testcase Realm Simple Lines 4
#yields (line((2.0 2.0 3.0 1.0)(2.0 2.0 3.0 3.0)(2.0 4.0 3.0 3.0)))
query realm(testline41, testline40);
#testcase Realm Simple Region x Line 1
#yields (region((( (3.0 1.0)(1.0 1.0) (3.0 3.0) (5.0 3.0) (8.0 3.0) (6.0 1.0) ))))
query realm(testreg1, testline3);
#testcase Realm Simple Line x Region 1
#yields (line( (2.0 0.0 3.0 1.0)(3.0 1.0 5.0 3.0)(5.0 3.0 6.0 4.0) ))
query realm(testline3, testreg1);
#testcase Union Simple Regions 1
#yields (region((((6.0 1.0) (1.0 1.0) (3.0 3.0) (6.0 3.0) (7.0 4.0) (12.0 4.0) (10.0 2.0) (7.0 2.0)))))
query union_new(testreg1, testreg2);
#testcase Union Simple Regions 2
#yields (region((((6.0 1.0)(1.0 1.0)(3.0 3.0)(8.0 3.0)(13.0 3.0) (11.0 1.0)))))
query union_new(testreg1, testreg30);
#testcase Union Simple Regions 3
#yields (region((((6.0 1.0)(1.0 1.0)(3.0 3.0)(5.0 5.0)(10.0 5.0)(8.0 3.0)))))
query union_new(testreg1, testreg31);
#testcase Intersection Simple Regions 1
#yields (region((((7.0 2.0) (5.0 2.0) (6.0 3.0) (8.0 3.0)))))
query intersection_new(testreg1, testreg2);
#testcase Intersection Simple Regions 2
#yields (region())
query intersection_new(testreg1, testreg30);
#testcase Intersection Simple Regions 3
#yields (region ())
query intersection_new(testreg1, testreg31);
#testcase Minus Simple Regions 1
#yields (region((((6.0 1.0) (1.0 1.0) (3.0 3.0) (6.0 3.0) (5.0 2.0) (7.0 2.0)))))
query minus_new(testreg1, testreg2);
#testcase Minus Simple Regions 2
#yields (region((((8.0 3.0) (6.0 3.0) (7.0 4.0) (12.0 4.0) (10.0 2.0) (7.0 2.0)))))
query minus_new(testreg2, testreg1);
#testcase Minus Simple Regions 3
#yields (region((((6.0 1.0)(1.0 1.0)(3.0 3.0)(8.0 3.0)))))
query minus_new(testreg1, testreg30);
#testcase Minus Simple Regions 4
#yields (region((((6.0 1.0)(1.0 1.0)(3.0 3.0)(8.0 3.0)))))
query minus_new(testreg1, testreg31);
#testcase Minus Simple Regions 5
#yields (region((((11.0 1.0)(6.0 1.0)(8.0 3.0)(13.0 3.0)))))
query minus_new(testreg30, testreg1);
#testcase Minus Simple Regions 6
#yields (region((((8.0 3.0)(3.0 3.0)(5.0 5.0)(10.0 5.0)))))
query minus_new(testreg31, testreg1);
#testcase Intersects Simple Regions 1
#yields (bool TRUE)
query testreg1 intersects_new testreg2;
#testcase Intersects Simple Regions 2
#yields (bool TRUE)
query testreg1 intersects_new testreg30;
#testcase Intersects Simple Regions 3
#yields (bool TRUE)
query testreg1 intersects_new testreg31;
#testcase PIntersects Simple Regions 1
#yields (bool TRUE)
query testreg1 p_intersects testreg2;
#testcase PIntersects Simple Regions 2
#yields (bool FALSE)
query testreg1 p_intersects testreg30;
#testcase PIntersects Simple Regions 3
#yields (bool FALSE)
query testreg1 p_intersects testreg31;
#testcase Union Simple Lines 1
#yields (line ((13.0 1.0 14.5 2.5) (13.0 4.0 14.5 2.5) (14.5 2.5 16.0 1.0) (14.5 2.5 16.0 4.0)))
query union_new(testline1, testline2);
#testcase Union Simple Lines 2
#yields (line((1.0 1.0 2.0 2.0)(2.0 2.0 3.0 1.0)(2.0 2.0 3.0 3.0)(2.0 4.0 3.0 3.0)(3.0 3.0 4.0 4.0)))
query union_new(testline40, testline41);
#testcase Intersection Simple Lines 1
#yields (line ())
query intersection_new(testline1, testline2);
#testcase Intersection Simple Lines 2
#yields (line ((2.0 2.0 3.0 3.0)))
query intersection_new(testline40, testline41);
#testcase Minus Simple Lines 1
#yields (line ((13.0 1.0 14.5 2.5)(14.5 2.5 16.0 4.0)))
query minus_new(testline1, testline2);
#testcase Minus Simple Lines 2
#yields (line ((13.0 4.0 14.5 2.5)(14.5 2.5 16.0 1.0)))
query minus_new(testline2, testline1);
#testcase Minus Simple Lines 3
#yields (line ((1.0 1.0 2.0 2.0)(3.0 3.0 4.0 4.0)))
query minus_new(testline40, testline41);
#testcase Minus Simple Lines 4
#yields (line ((2.0 2.0 3.0 1.0)(2.0 4.0 3.0 3.0)))
query minus_new(testline41, testline40);
#testcase Intersects Simple Lines 1
#yields (bool TRUE)
query testline1 intersects_new testline2;
#testcase Intersects Simple Lines 2
#yields (bool TRUE)
query testline40 intersects_new testline41;
#testcase PIntersects Simple Lines 1
#yields (bool FALSE)
query testline1 p_intersects testline2;
#testcase PIntersects Simple Lines 2
#yields (bool TRUE)
query testline40 p_intersects testline41;
#testcase Union Simple Region x Line 1
#yields (region ( ( ( (1.0 1.0) (6.0 1.0) (8.0 3.0) (3.0 3.0)))))
query union_new(testreg1, testline3);
#testcase Union Simple Line x Region 1
#yields (region ( ( ( (1.0 1.0) (6.0 1.0) (8.0 3.0) (3.0 3.0)))))
query union_new(testline3, testreg1);
#testcase Intersection Simple Region x Line 1
#yields (line((3.0 1.0 5.0 3.0)))
query intersection_new(testreg1, testline3);
#testcase Intersection Simple Line x Region 1
#yields (line((3.0 1.0 5.0 3.0)))
query intersection_new(testline3, testreg1);
#testcase Minus Simple Region x Line 1
#yields (region ( ( ( (1.0 1.0) (6.0 1.0) (8.0 3.0) (3.0 3.0)))))
query minus_new(testreg1, testline3);
#testcase Minus Simple Line x Region 1
#yields (line((2.0 0.0 3.0 1.0)(5.0 3.0 6.0 4.0)))
query minus_new(testline3, testreg1);
#testcase Intersects Simple Region x Line 1
#yields (bool TRUE)
query testreg1 intersects_new testline3;
#testcase Intersects Simple Line x Region 1
#yields (bool TRUE)
query testline3 intersects_new testreg1;
#testcase PIntersects Simple Region x Line 1
#yields (bool TRUE)
query testreg1 p_intersects testline3;
#testcase PIntersects Simple Line x Region 1
#yields (bool TRUE)
query testline3 p_intersects testreg1;
#testcase Realm Special Lines 1
#yields (line((1.0 1.0 1.0 2.0)(1.0 2.0 1.0 3.0)(1.0 3.0 1.0 4.0)))
query realm(testline4, testline10);
#testcase Realm Special Lines 2
#yields (line((1.0 2.0 1.0 3.0)))
query realm(testline10, testline4);
#testcase Realm Special Lines 3
#yields (line((3.0 1.0 3.0 2.0)(3.0 2.0 3.0 4.0)))
query realm(testline5, testline11);
#testcase Realm Special Lines 4
#yields (line((3.0 1.0 3.0 2.0)))
query realm(testline11, testline5);
#testcase Realm Special Lines 5
#yields (line((5.0 1.0 5.0 3.0)(5.0 3.0 5.0 4.0)))
query realm(testline6, testline12);
#testcase Realm Special Lines 6
#yields (line((5.0 3.0 5.0 4.0)))
query realm(testline12, testline6);
#testcase Realm Special Lines 7
#yields (line((7.0 1.0 7.0 3.0)(7.0 3.0 7.0 4.0)))
query realm(testline7, testline13);
#testcase Realm Special Lines 8
#yields (line((7.0 3.0 8.0 3.0)))
query realm(testline13, testline7);
#testcase Realm Special Lines 9
#yields (line((9.0 1.0 9.0 4.0)))
query realm(testline8, testline14);
#testcase Realm Special Lines 10
#yields (line((9.0 4.0 10.0 4.0)))
query realm(testline14, testline8);
#testcase Realm Special Lines 11
#yields (line((11.0 1.0 11.0 4.0)))
query realm(testline9, testline15);
#testcase Realm Special Lines 12
#yields (line((11.0 1.0 12.0 1.0)))
query realm(testline15, testline9);
#testcase Realm Special Lines 13
#yields (line((13.0 1.0 13.5 2.0)(13.5 2.0 14.0 3.0)(14.0 3.0 14.5 4.0)))
query realm(testline16, testline17);
#testcase Realm Special Lines 14
#yields (line((13.5 2.0 14.0 3.0)))
query realm(testline17, testline16);
#testcase Realm Special Lines 15
#yields (line((14.0 1.0 15.0 3.0)(15.0 3.0 15.5 4.0)))
query realm(testline18, testline19);
#testcase Realm Special Lines 16
#yields (line((15.0 3.0 15.5 4.0)))
query realm(testline19, testline18);
#testcase Realm Special Lines 17
#yields (line((15.0 1.0 15.5 2.0)(15.5 2.0 16.0 3.0)))
query realm(testline20, testline21);
#testcase Realm Special Lines 18
#yields (line((15.5 2.0 16.0 3.0)(16.0 3.0 16.5 4.0)))
query realm(testline21, testline20);
#testcase Realm Special Lines 19
#yields (line((1.0 1.0 1.0 2.0)(1.0 2.0 1.0 3.0)))
query realm(testline32, testline33);
#testcase Realm Special Lines 20
#yields (line((1.0 2.0 1.0 3.0)(1.0 3.0 1.0 4.0)))
query realm(testline33, testline32);
#testcase Realm Special Lines 21
#yields (line((1.0 1.0 1.0 2.0)(1.0 2.0 1.0 4.0)))
query realm(testline34, testline35);
#testcase Realm Special Lines 22
#yields (line((0.0 2.0 1.0 2.0)(1.0 2.0 2.0 2.0)))
query realm(testline35, testline34);
#testcase Union Special Lines 1
#yields (line((1.0 1.0 1.0 2.0)(1.0 2.0 1.0 3.0)(1.0 3.0 1.0 4.0)))
query union_new(testline4, testline10);
#testcase Realm Special Regions 1
#yields (region((((4.0 1.0)(1.0 1.0)(1.0 3.0)(1.0 4.0)(1.0 5.0)(4.0 5.0)(4.0 4.0)(4.0 3.0)))))
query realm(testreg3, testreg4);
#testcase Realm Special Regions 2
#yields (region((((4.0 3.0)(1.0 3.0)(1.0 4.0)(4.0 4.0)))))
query realm(testreg4, testreg3);
#testcase Realm Special Regions 3
#yields (region((((9.0 1.0)(6.0 1.0)(6.0 2.0)(6.0 5.0)(9.0 5.0) (9.0 2.0)))))
query realm(testreg5, testreg6);
#testcase Realm Special Regions 4
#yields (region((((9.0 1.0)(6.0 1.0)(6.0 2.0)(9.0 2.0)))))
query realm(testreg6, testreg5);
#testcase Realm Special Regions 5
#yields (region((((14.0 1.0)(11.0 1.0)(11.0 3.0)(14.0 3.0)(14.0 2.0)))))
query realm(testreg7, testreg8);
#testcase Realm Special Regions 6
#yields (region((((17.0 2.0)(14.0 2.0)(14.0 3.0)(14.0 5.0)(17.0 5.0)))))
query realm(testreg8, testreg7);
#testcase Realm Special Regions 7
#yields (region((((22.0 1.0)(19.0 1.0)(19.0 3.0)(20.0 3.0)(22.0 3.0)(22.0 2.0)))))
query realm(testreg9, testreg10);
#testcase Realm Special Regions 8
#yields (region((((22.0 2.0)(20.0 2.0)(20.0 3.0)(20.0 4.0)(23.0 4.0)(23.0 2.0)))))
query realm(testreg10, testreg9);
#testcase Union Special Regions 1
#yields (region((((4.0 1.0)(1.0 1.0)(1.0 3.0)(1.0 4.0)(1.0 5.0)(4.0 5.0)(4.0 4.0)(4.0 3.0)))))
query union_new(testreg3, testreg4);
#testcase Union Special Regions 2
#yields (region((((9.0 1.0)(6.0 1.0)(6.0 2.0)(6.0 5.0)(9.0 5.0)(9.0 2.0)))))
query union_new(testreg5, testreg6);
#testcase Union Special Regions 3
#yields (region((((14.0 1.0)(11.0 1.0)(11.0 3.0)(14.0 3.0)(14.0 5.0)(17.0 5.0)(17.0 2.0)(14.0 2.0)))))
query union_new(testreg7, testreg8);
#testcase Union Special Regions 4
#yields (region((((22.0 1.0)(19.0 1.0)(19.0 3.0)(20.0 3.0)(20.0 4.0)(23.0 4.0)(23.0 2.0)(22.0 2.0)))))
query union_new(testreg9, testreg10);
#testcase Intersection Special Regions 1
#yields (region((((4.0 3.0)(1.0 3.0)(1.0 4.0)(4.0 4.0)))))
query intersection_new(testreg3, testreg4);
#testcase Intersection Special Regions 2
#yields (region((((9.0 1.0)(6.0 1.0)(6.0 2.0)(9.0 2.0)))))
query intersection_new(testreg5, testreg6);
#testcase Intersection Special Regions 3
#yields (region())
query intersection_new(testreg7, testreg8);
#testcase Intersection Special Regions 4
#yields (region((((22.0 2.0)(20.0 2.0)(20.0 3.0)(22.0 3.0)))))
query intersection_new(testreg9, testreg10);
#testcase Minus Special Regions 1
#yields (region((((4.0 1.0)(1.0 1.0)(1.0 3.0)(4.0 3.0)))(((4.0 4.0)(1.0 4.0)(1.0 5.0)(4.0 5.0)))))
query minus_new(testreg3, testreg4);
#testcase Minus Special Regions 2
#yields (region((((9.0 2.0)(6.0 2.0)(6.0 5.0)(9.0 5.0)))))
query minus_new(testreg5, testreg6);
#testcase Minus Special Regions 3
#yields (region((((14.0 1.0)(11.0 1.0)(11.0 3.0)(14.0 3.0)(14.0 2.0)))))
query minus_new(testreg7, testreg8);
#testcase Minus Special Regions 4
#yields (region((((22.0 1.0)(19.0 1.0)(19.0 3.0)(20.0 3.0)(20.0 2.0)(22.0 2.0)))))
query minus_new(testreg9, testreg10);
#testcase Intersects Special Regions 1
#yields (bool TRUE)
query testreg3 intersects_new testreg4;
#testcase Intersects Special Regions 2
#yields (bool TRUE)
query testreg5 intersects_new testreg6;
#testcase Intersects Special Regions 3
#yields (bool TRUE)
query testreg7 intersects_new testreg8;
#testcase Intersects Special Regions 4
#yields (bool TRUE)
query testreg9 intersects_new testreg10;
#testcase PIntersects Special Regions 1
#yields (bool TRUE)
query testreg3 p_intersects testreg4;
#testcase PIntersects Special Regions 2
#yields (bool TRUE)
query testreg5 p_intersects testreg6;
#testcase PIntersects Special Regions 3
#yields (bool FALSE)
query testreg7 p_intersects testreg8;
#testcase PIntersects Special Regions 4
#yields (bool TRUE)
query testreg9 p_intersects testreg10;
#teardown
close database;
delete database planesweeptest;