当前位置: 首页>>代码示例>>C#>>正文


C# Envelope.Equals方法代码示例

本文整理汇总了C#中Envelope.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# Envelope.Equals方法的具体用法?C# Envelope.Equals怎么用?C# Envelope.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Envelope的用法示例。


在下文中一共展示了Envelope.Equals方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CoordToEnvelope_SimpleGridsetTopOrgin_ReturnsEnvelope

        public void CoordToEnvelope_SimpleGridsetTopOrgin_ReturnsEnvelope()
        {
            GridSet g = new GridSet(
                "test",
                "epsg:test",
                new Envelope(0, 0, 100, 100),
                new List<double>() { 10, 5, 2.5 },
                10,
                10
            );

            Envelope expected = new Envelope(0, 0, 100, 100);
            Assert.IsTrue(expected.Equals(g.CoordToEnvelope(new Coord(0, 0, 0, true))));

            expected = new Envelope(0, 0, 50, 50);
            Assert.IsTrue(expected.Equals(g.CoordToEnvelope(new Coord(1, 0, 1, true))));

            expected = new Envelope(75, 75, 100, 100);
            Assert.IsTrue(expected.Equals(g.CoordToEnvelope(new Coord(2, 3, 0, true))));
        }
开发者ID:jbrwn,项目名称:tc,代码行数:20,代码来源:GridSetTests.cs

示例2: EnvelopeAll

        public void EnvelopeAll()
        {
            IList results = session.CreateCriteria(typeof(County))
                .SetProjection(SpatialProjections.Envelope("Boundaries"))
                .List();

            Assert.AreEqual(1, results.Count);

            IGeometry aggregated = (IGeometry)results[0];
            IEnvelope expected = new Envelope(1, 3, 0, 2);

            Assert.IsTrue(expected.Equals(aggregated.EnvelopeInternal));
        }
开发者ID:hazzik,项目名称:nh-contrib-everything,代码行数:13,代码来源:ProjectionsFixture.cs

示例3: OnTileRendered

        /// <summary>
        /// Method to raise the map tile available event
        /// </summary>
        /// <param name="ptInsert"></param>
        /// <param name="env"></param>
        /// <param name="bmp"></param>
        protected virtual void OnTileRendered(Point ptInsert, Envelope env, Bitmap bmp)
        {
            if (!env.Equals(_lastViewport))
            {
                System.Threading.Monitor.Enter(_renderLock);
                using (var g = Graphics.FromImage(_bitmap))
                    g.DrawImageUnscaled(bmp, ptInsert);
                System.Threading.Monitor.Exit(_renderLock);
            }

            var h1 = MapNewTileAvaliable;
            if (h1 != null)
            {
                h1(null, env, bmp, bmp.Width, bmp.Height, _imageAttributes);
            }

            var h2 = DownloadProgressChanged;
            if (h2 != null)
            {
                System.Threading.Interlocked.Decrement(ref _numPendingDownloads);
                h2(_numPendingDownloads);
            }
        }
开发者ID:lishxi,项目名称:_SharpMap,代码行数:29,代码来源:AsyncLayerProxyLayer.cs

示例4: TestParse

 private static void TestParse(string envString, Envelope env)
 {
     var envFromString = Envelope.Parse(envString);
     Assert.IsTrue(env.Equals(envFromString));
 }
开发者ID:Walt-D-Cat,项目名称:NetTopologySuite,代码行数:5,代码来源:EnvelopeTest.cs

示例5: TestEquals

        public void TestEquals()
        {
            Envelope e1 = new Envelope(1, 2, 3, 4);
            Envelope e2 = new Envelope(1, 2, 3, 4);
            Assert.AreEqual(e1, e2);
            Assert.AreEqual(e1.GetHashCode(), e2.GetHashCode());

            Envelope e3 = new Envelope(1, 2, 3, 5);
            Assert.IsTrue(!e1.Equals(e3));
            Assert.IsTrue(e1.GetHashCode() != e3.GetHashCode());
            e1.SetToNull();
            Assert.IsTrue(!e1.Equals(e2));
            Assert.IsTrue(e1.GetHashCode() != e2.GetHashCode());
            e2.SetToNull();
            Assert.AreEqual(e1, e2);
            Assert.AreEqual(e1.GetHashCode(), e2.GetHashCode());
        }
开发者ID:Walt-D-Cat,项目名称:NetTopologySuite,代码行数:17,代码来源:EnvelopeTest.cs


注:本文中的Envelope.Equals方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。