コード例 #1
0
        public void NaNWithValidation()
        {
            GlobalSettings.ValidationLevel = 0xff;

            var partition = new AdaptiveAabbTree <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 AdaptiveAabbTree <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 AdaptiveAabbTree <int>
            {
                EnableSelfOverlaps = true,
                GetAabbForItem     = GetAabbForItem
            };

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

            // Aabb builder throws exception.
            Assert.Throws <GeometryException>(() => partition.Update(false));
        }
コード例 #3
0
        public void NaN()
        {
            GlobalSettings.ValidationLevel = 0x00;

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

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

              // Aabb builder throws exception.
              Assert.Throws<GeometryException>(() => partition.Update(false));
        }
コード例 #4
0
        public void NaNWithValidation()
        {
            GlobalSettings.ValidationLevel = 0xff;

              var partition = new AdaptiveAabbTree<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 AdaptiveAabbTree<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));
        }