Пример #1
0
        public void NaNWithValidation()
        {
            GlobalSettings.ValidationLevel = 0xff;

            var partition = new DualPartition <int>();

            partition.EnableSelfOverlaps = true;
            partition.GetAabbForItem     = GetAabbForItem;

            partition.Add(1);
            partition.Add(4);
            partition.Add(2);
            partition.Add(3);

            // Full rebuild.
            Assert.Throws <GeometryException>(() => partition.Update(true));

            partition = new DualPartition <int>();
            partition.EnableSelfOverlaps = true;
            partition.GetAabbForItem     = GetAabbForItem;

            partition.Add(1);
            partition.Add(2);
            partition.Add(3);
            partition.Update(true);
            partition.Add(4);

            // Partial rebuild.
            Assert.Throws <GeometryException>(() => partition.Update(false));
        }
Пример #2
0
        public void NaN()
        {
            GlobalSettings.ValidationLevel = 0x00;

            var partition = new DualPartition <int>
            {
                EnableSelfOverlaps = true,
                GetAabbForItem     = GetAabbForItem
            };

            partition.Add(1);
            partition.Add(4);
            partition.Add(2);
            partition.Add(3);

            // No exception expected because internal tree is built top down (default
            // BottomUpBuildThreshold is 0). However, tree will not be useful.
            partition.Update(true);
        }
Пример #3
0
        public void NaN()
        {
            GlobalSettings.ValidationLevel = 0x00;

              var partition = new DualPartition<int>
              {
            EnableSelfOverlaps = true,
            GetAabbForItem = GetAabbForItem
              };

              partition.Add(1);
              partition.Add(4);
              partition.Add(2);
              partition.Add(3);

              // No exception expected because internal tree is built top down (default
              // BottomUpBuildThreshold is 0). However, tree will not be useful.
              partition.Update(true);
        }
Пример #4
0
        public void NaNWithValidation()
        {
            GlobalSettings.ValidationLevel = 0xff;

              var partition = new DualPartition<int>();
              partition.EnableSelfOverlaps = true;
              partition.GetAabbForItem = GetAabbForItem;

              partition.Add(1);
              partition.Add(4);
              partition.Add(2);
              partition.Add(3);

              // Full rebuild.
              Assert.Throws<GeometryException>(() => partition.Update(true));

              partition = new DualPartition<int>();
              partition.EnableSelfOverlaps = true;
              partition.GetAabbForItem = GetAabbForItem;

              partition.Add(1);
              partition.Add(2);
              partition.Add(3);
              partition.Update(true);
              partition.Add(4);

              // Partial rebuild.
              Assert.Throws<GeometryException>(() => partition.Update(false));
        }