Exemple #1
0
        public void Include_2D()
        {
            var bound = new BoundingWorldExtent3D(0, 0, 0, 0, 0, 0);

            bound.Include(10, 11);
            bound.Should().BeEquivalentTo(new BoundingWorldExtent3D(0, 0, 10, 11, 0, 0));

            bound.Include(-10, -11);
            bound.Should().BeEquivalentTo(new BoundingWorldExtent3D(-10, -11, 10, 11, 0, 0));
        }
Exemple #2
0
        public void ScalePlan()
        {
            var bound = new BoundingWorldExtent3D(1, 1, 2, 2, 0, 0);

            bound.ScalePlan(2.0);
            bound.Should().BeEquivalentTo(new BoundingWorldExtent3D(0.5, 0.5, 2.5, 2.5, 0, 0));
        }
Exemple #3
0
        public void Set()
        {
            var bound = new BoundingWorldExtent3D();

            bound.Set(0, 1, 100, 102);
            bound.Should().BeEquivalentTo(new BoundingWorldExtent3D(0, 1, 100, 102, 0, 0));
        }
Exemple #4
0
        public void Creation_FromSource()
        {
            var bound = new BoundingWorldExtent3D(1, 1, 100, 100);

            var bound2 = new BoundingWorldExtent3D(bound);

            bound2.Should().BeEquivalentTo(bound);
        }
Exemple #5
0
        public void Assign()
        {
            var bound = new BoundingWorldExtent3D(1, 1, 100, 100);

            var bound2 = new BoundingWorldExtent3D();

            bound2.Assign(bound);

            bound2.Should().BeEquivalentTo(bound);
        }
Exemple #6
0
        public void Clear()
        {
            var bound = new BoundingWorldExtent3D();

            bound.Set(0, 1, 100, 102);
            var bound2 = new BoundingWorldExtent3D();

            bound.Clear();

            bound.Should().BeEquivalentTo(bound2);
        }
Exemple #7
0
        public void Test_CellSpatialFilter_CalculateIntersectionWithExtents_Positional()
        {
            var data = new CellSpatialFilter {
                IsPositional = true, PositionX = 100, PositionY = 100, PositionRadius = 50
            };

            BoundingWorldExtent3D expectedExtent = new BoundingWorldExtent3D(50, 50, 150, 150);
            BoundingWorldExtent3D startingExtent = new BoundingWorldExtent3D(0, 0, 1000, 1000);

            data.CalculateIntersectionWithExtents(startingExtent);
            startingExtent.Should().BeEquivalentTo(expectedExtent);
        }
Exemple #8
0
        public void Test_CellSpatialFilter_CalculateIntersectionWithExtents_Spatial()
        {
            var data = new CellSpatialFilter {
                IsSpatial = true, Fence = new Fence(1, 1, 100, 100)
            };

            BoundingWorldExtent3D expectedExtent = new BoundingWorldExtent3D(1, 1, 100, 100);
            BoundingWorldExtent3D startingExtent = new BoundingWorldExtent3D(0, 0, 101, 101);

            data.CalculateIntersectionWithExtents(startingExtent);
            startingExtent.Should().BeEquivalentTo(expectedExtent);
        }
Exemple #9
0
        public void FromToBinary()
        {
            var cp1    = new BoundingWorldExtent3D(1, 2, 3, 4, 5, 6);
            var writer = new TestBinaryWriter();

            cp1.ToBinary(writer);

            var cp2 = new BoundingWorldExtent3D();

            cp2.FromBinary(new TestBinaryReader(writer._stream.BaseStream as MemoryStream));

            cp1.Should().BeEquivalentTo(cp2);
        }
Exemple #10
0
        public void Test_FilterSet_FromToBinary_ApplyFilterAndSubsetBoundariesToExtents()
        {
            var data = new FilterSet(
                new CombinedFilter
            {
                AttributeFilter =
                {
                    GPSAccuracy     = GPSAccuracy.Fine,
                    HasDesignFilter = false
                },
                SpatialFilter = new CellSpatialFilter
                {
                    IsSpatial = true,
                    Fence     = new Fence(1, 1, 100, 100)
                }
            });

            BoundingWorldExtent3D expectedExtent = new BoundingWorldExtent3D(1, 1, 100, 100);
            BoundingWorldExtent3D startingExtent = new BoundingWorldExtent3D(0, 0, 101, 101);

            data.ApplyFilterAndSubsetBoundariesToExtents(startingExtent);
            startingExtent.Should().BeEquivalentTo(expectedExtent);
        }