本文整理汇总了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;
}
示例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
}
示例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();
}
示例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();
}