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


C# IGeometry.GeometryChanged方法代码示例

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


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

示例1: RemoveCommonBits

 /// <summary>
 /// Removes the common coordinate bits from a Geometry.
 /// The coordinates of the Geometry are changed.
 /// </summary>
 /// <param name="geom">The Geometry from which to remove the common coordinate bits.</param>
 /// <returns>The shifted Geometry.</returns>
 public IGeometry RemoveCommonBits(IGeometry geom)
 {
     if (commonCoord.X == 0.0 && commonCoord.Y == 0.0)
         return geom;
     ICoordinate invCoord = new Coordinate(commonCoord);
     invCoord.X = -invCoord.X;
     invCoord.Y = -invCoord.Y;
     Translater trans = new Translater(invCoord);            
     geom.Apply(trans);
     geom.GeometryChanged();
     return geom;
 }
开发者ID:ExRam,项目名称:DotSpatial-PCL,代码行数:18,代码来源:CommonBitsRemover.cs

示例2: Move

        /// <summary>
        /// Whenever the first or last coordinate is moved, make sure to also move the other one. This makes sure the 
        /// first and last coordinate always remain the same (which is a requirement for LinearRings / Polygons)
        /// </summary>
        /// <param name="targetGeometry"></param>
        /// <param name="sourceGeometry"></param>
        /// <param name="geometries"></param>
        /// <param name="handleIndices"></param>
        /// <param name="mouseIndex"></param>
        /// <param name="deltaX"></param>
        /// <param name="deltaY"></param>
        public override void Move(IGeometry targetGeometry, IGeometry sourceGeometry, IList<IGeometry> geometries, IList<int> handleIndices, int mouseIndex, double deltaX, double deltaY)
        {
            var adjustedIndices = new List<int>(handleIndices);

            var length = sourceGeometry.Coordinates.Length;

            if (length > 1)
            {
                var lastCoordinateIndex = length - 1;

                if (handleIndices.Contains(0) && !handleIndices.Contains(lastCoordinateIndex))
                {
                    adjustedIndices.Add(lastCoordinateIndex);
                }
                else if (handleIndices.Contains(lastCoordinateIndex) && !handleIndices.Contains(0))
                {
                    adjustedIndices.Add(0);
                }
            }

            base.Move(targetGeometry, sourceGeometry, geometries, adjustedIndices, mouseIndex, deltaX, deltaY);
            targetGeometry.GeometryChanged(); //force update of envelope
        }
开发者ID:lishxi,项目名称:_SharpMap,代码行数:34,代码来源:RingFallOffPolicy.cs

示例3: AddCommonBits

 /// <summary>
 /// Adds the common coordinate bits back into a Geometry.
 /// The coordinates of the Geometry are changed.
 /// </summary>
 /// <param name="geom">The Geometry to which to add the common coordinate bits.</param>
 public virtual void AddCommonBits(IGeometry geom)
 {
     Translater trans = new Translater(_commonCoord);
     geom.Apply(trans);
     geom.GeometryChanged();
 }
开发者ID:ExRam,项目名称:DotSpatial-PCL,代码行数:11,代码来源:CommonBitsRemover.cs

示例4: FlipXY

 private static void FlipXY(IGeometry geom)
 {
     var coords = geom.Coordinates;
     for (var i = 0; i < coords.Length; i++)
     {
         var x = coords[i].X;
         coords[i].X = coords[i].Y;
         coords[i].Y = x;
     }
     geom.GeometryChanged();
 }
开发者ID:lishxi,项目名称:_SharpMap,代码行数:11,代码来源:SqlServer2008.cs


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