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


C# IGeometry.GeometryChangedAction方法代码示例

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


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

示例1: Move

        public virtual void Move(IGeometry targetGeometry, IGeometry sourceGeometry, IList<IGeometry> geometries, IList<int> handleIndices, 
                         int mouseIndex, double deltaX, double deltaY)
        {
            if ((targetGeometry != null) && (sourceGeometry != null))
            {
                if (targetGeometry.Coordinates.Length != sourceGeometry.Coordinates.Length)
                {
                    throw new ArgumentException("Source and target geometries should have same number of coordinates.");
                }

                //for performance reasons, get the coordinates once: for example for polygons this is a heavy call
                var targetCoordinates = targetGeometry.Coordinates; 
                var sourceCoordinates = sourceGeometry.Coordinates;

                for (int i = 0; i < handleIndices.Count; i++)
                {
                    GeometryHelper.MoveCoordinate(targetCoordinates, sourceCoordinates, handleIndices[i], deltaX, deltaY);
                    targetGeometry.GeometryChangedAction();

                    if (null != geometries)
                    {
                        IGeometry tracker = geometries[handleIndices[i]];
                        GeometryHelper.MoveCoordinate(tracker, 0, deltaX, deltaY);
                        tracker.GeometryChangedAction();
                    }
                }
            }
        }
开发者ID:lishxi,项目名称:_SharpMap,代码行数:28,代码来源:NoFallOffPolicy.cs

示例2: Move

        public virtual void Move(IGeometry targetGeometry, IGeometry sourceGeometry, IList<IGeometry> geometries, IList<int> handleIndices, 
                         int mouseIndex, double deltaX, double deltaY)
        {
            if ((targetGeometry != null) && (sourceGeometry != null))
            {
                if (targetGeometry.Coordinates.Length != sourceGeometry.Coordinates.Length)
                {
                    throw new ArgumentException("Source and target geometries should have same number of coordinates.");
                }
            }
            for (int i = 0; i < handleIndices.Count; i++)
            {
                GeometryHelper.MoveCoordinate(targetGeometry, sourceGeometry, handleIndices[i], deltaX, deltaY);
                targetGeometry.GeometryChangedAction();

                if (null != geometries)
                {
                    IGeometry tracker = geometries[handleIndices[i]];
                    GeometryHelper.MoveCoordinate(tracker, 0, deltaX, deltaY);
                    tracker.GeometryChangedAction();
                }
            }
        }
开发者ID:lishxi,项目名称:_SharpMap,代码行数:23,代码来源:NoFallOffPolicy.cs

示例3: Move

 /// <summary>
 /// See IFallOffPolicy
 /// 
 /// TODO: move geometries to Tool
 /// </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)
 {
     if (targetGeometry.Coordinates.Length != sourceGeometry.Coordinates.Length)
         throw new ArgumentException("FallOffPolicy source and target mus have same number of coordinates.");
     if (handleIndices.Count > targetGeometry.Coordinates.Length)
         throw new ArgumentException("FallOffPolicy number of handles can not exceed number of coordinates.");
     if (-1 == mouseIndex)
     {
         base.Move(targetGeometry, sourceGeometry, geometries, handleIndices, mouseIndex, deltaX, deltaY);
         return;
     }
     if (null == distances)
         BuildList(sourceGeometry);
     double center = distances[mouseIndex];
     double left = center - distances[0];
     double right = distances[distances.Count - 1] - center;
     for (int i = 1; i <= mouseIndex - 1; i++) // skip boundaries
     {
         if (-1 == handleIndices.IndexOf(i))
         {
             double factor = Math.Max(0, 1 - (Math.Abs(distances[i] - center) / left));
             GeometryHelper.MoveCoordinate(targetGeometry, sourceGeometry, i, factor * deltaX, factor * deltaY);
             //GeometryHelper.UpdateEnvelopeInternal(sourceGeometry);
             // todo optimize; only 1 UpdateEnvelopeInternal per geometry
             if (null != geometries)
             {
                 IGeometry tracker = geometries[i];
                 GeometryHelper.MoveCoordinate(tracker, 0, factor * deltaX, factor * deltaY);
                 tracker.GeometryChangedAction();
             }
         }
     }
     //for (int i = mouseIndex + 1; i < geometries.Count - 1; i++)  // skip boundaries
     for (int i = mouseIndex + 1; i < sourceGeometry.Coordinates.Length - 1; i++)  // skip boundaries
     {
         if (-1 == handleIndices.IndexOf(i))
         {
             double factor = Math.Max(0, 1 - (Math.Abs(distances[i] - center) / right));
             GeometryHelper.MoveCoordinate(targetGeometry, sourceGeometry, i, factor * deltaX, factor * deltaY);
             //GeometryHelper.UpdateEnvelopeInternal(sourceGeometry);
             // todo optimize; only 1 UpdateEnvelopeInternal per geometry
             if (null != geometries)
             {
                 IGeometry tracker = geometries[i];
                 GeometryHelper.MoveCoordinate(tracker, 0, factor * deltaX, factor * deltaY);
                 tracker.GeometryChangedAction();
             }
         }
     }
     for (int i = 0; i < handleIndices.Count; i++)  // skip boundaries
     {
         GeometryHelper.MoveCoordinate(targetGeometry, sourceGeometry, handleIndices[i], deltaX, deltaY);
         //GeometryHelper.UpdateEnvelopeInternal(sourceGeometry);
         // todo optimize; only 1 UpdateEnvelopeInternal per geometry
         if (null != geometries)
         {
             IGeometry tracker = geometries[handleIndices[i]];
             GeometryHelper.MoveCoordinate(tracker, 0, deltaX, deltaY);
             tracker.GeometryChangedAction();
         }
     }
     targetGeometry.GeometryChangedAction();
 }
开发者ID:lishxi,项目名称:_SharpMap,代码行数:76,代码来源:LinearFallOffPolicy.cs

示例4: Filter

 public void Filter(IGeometry geom)
 {
     geom.GeometryChangedAction();
 }
开发者ID:joelmuzz,项目名称:DotSpatial,代码行数:4,代码来源:Geometry.cs

示例5: MoveCoordinate

 public static void MoveCoordinate(IGeometry targetGeometry, IGeometry sourceGeometry, int coordinateIndex, double deltaX, double deltaY)
 {
     MoveCoordinate(targetGeometry.Coordinates, sourceGeometry.Coordinates, coordinateIndex, deltaX, deltaY);
     targetGeometry.GeometryChangedAction();
 }
开发者ID:lishxi,项目名称:_SharpMap,代码行数:5,代码来源:GeometryHelper.cs


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