Home | History | Annotate | Download | only in geometry

Lines Matching refs:RT

14   typedef RTree<int> RT;
18 void ValidateRTree(RTreeBase* rt) {
20 if (!rt->root()->count()) {
21 EXPECT_TRUE(rt->root()->rect().IsEmpty());
22 EXPECT_EQ(0, rt->root()->Level());
27 EXPECT_LE(rt->root()->count(), rt->max_children_);
29 EXPECT_GT(rt->root()->Level(), -1);
31 EXPECT_TRUE(rt->root()->parent() == NULL);
33 CheckBoundsConsistent(rt->root());
34 for (size_t i = 0; i < rt->root()->count(); ++i) {
36 rt->root()->child(i), rt->min_children_, rt->max_children_);
71 void AddStackedSquares(RT* rt, int count) {
73 rt->Insert(Rect(0, 0, i, i), i);
74 ValidateRTree(static_cast<RTreeBase*>(rt));
80 void VerifyAllKeys(const RT::Matches& keys) {
104 typedef RT::Record RTreeRecord;
806 RT rt(2, 10);
807 ValidateRTree(&rt);
808 RT::Matches results;
810 rt.AppendIntersectingRecords(test_rect, &results);
812 ValidateRTree(&rt);
818 RT rt(2, 5);
819 rt.Insert(Rect(0, 0, 100, 100), 1);
820 rt.Clear();
821 RT::Matches results;
823 rt.AppendIntersectingRecords(test_rect, &results);
825 ValidateRTree(&rt);
831 RT rt(2, 5);
832 AddStackedSquares(&rt, 100);
833 rt.Clear();
834 RT::Matches results;
836 rt.AppendIntersectingRecords(test_rect, &results);
838 ValidateRTree(&rt);
843 RT rt(2, 5);
846 rt.Insert(Rect(0, 0, i, i), 0);
847 ValidateRTree(&rt);
849 RT::Matches results;
851 rt.AppendIntersectingRecords(test_rect, &results);
858 RT rt(3, 9);
859 AddStackedSquares(&rt, 25);
861 rt.Insert(Rect(0, 0, i, i), 26);
862 ValidateRTree(&rt);
864 rt.Remove(26);
865 RT::Matches results;
867 rt.AppendIntersectingRecords(test_rect, &results);
874 RT rt(7, 15);
875 AddStackedSquares(&rt, 101);
877 rt.Remove(101);
878 ValidateRTree(&rt);
880 RT::Matches results;
882 rt.AppendIntersectingRecords(test_rect, &results);
889 RT rt(2, 5);
890 AddStackedSquares(&rt, 100);
891 RT::Matches results;
893 rt.AppendIntersectingRecords(test_rect, &results);
901 RT rt(2, 10);
902 AddStackedSquares(&rt, 100);
903 RT::Matches results;
905 rt.AppendIntersectingRecords(test_rect, &results);
913 RT rt(2, 7);
914 AddStackedSquares(&rt, 100);
915 RT::Matches results;
917 rt.AppendIntersectingRecords(test_rect, &results);
923 RT rt(2, 11);
924 AddStackedSquares(&rt, 200);
926 rt.Remove(i);
927 ValidateRTree(&rt);
929 RT::Matches results;
931 rt.AppendIntersectingRecords(test_rect, &results);
937 rt.Insert(Rect(0, 0, i, i), i);
938 ValidateRTree(&rt);
941 rt.AppendIntersectingRecords(test_rect, &results);
947 RT rt(2, 5);
948 rt.Insert(Rect(0, 0, 1, 2), 1);
949 ValidateRTree(&rt);
950 rt.Insert(Rect(0, 0, 2, 1), 1);
951 ValidateRTree(&rt);
955 RT rt(5, 11);
957 rt.Insert(Rect(-i, -i, i, i), (i * 2) - 1);
958 ValidateRTree(&rt);
959 rt.Insert(Rect(0, 0, i, i), i * 2);
960 ValidateRTree(&rt);
962 RT::Matches results;
964 rt.AppendIntersectingRecords(test_rect, &results);
970 RT rt(7, 21);
973 AddStackedSquares(&rt, 100);
977 rt.Insert(Rect(100 - i, 100 - i, i - 100, i - 100), 301 - i);
978 ValidateRTree(&rt);
983 rt.Remove(301 - i);
984 ValidateRTree(&rt);
988 RT::Matches results;
990 rt.AppendIntersectingRecords(test_rect, &results);
996 RT rt(10, 31);
997 AddStackedSquares(&rt, 50);
998 ValidateRTree(&rt);
1001 rt.Insert(Rect(), 50);
1002 ValidateRTree(&rt);
1005 RT::Matches results;
1007 rt.AppendIntersectingRecords(test_rect, &results);
1015 RT rt(2, 5);
1016 AddStackedSquares(&rt, 100);
1017 ValidateRTree(&rt);
1020 rt.Insert(Rect(0, 0, 0, 0), i);
1021 ValidateRTree(&rt);