本文整理汇总了C#中DotSpatial.Data.Extent.Copy方法的典型用法代码示例。如果您正苦于以下问题:C# Extent.Copy方法的具体用法?C# Extent.Copy怎么用?C# Extent.Copy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DotSpatial.Data.Extent
的用法示例。
在下文中一共展示了Extent.Copy方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CalculateCategoryExtent
/// <summary>
/// This calculates the extent for the category and caches it in the extents collection
/// </summary>
/// <param name="category">
/// </param>
protected virtual Extent CalculateCategoryExtent(IFeatureCategory category)
{
Extent ext = new Extent(new[] { double.MaxValue, double.MaxValue, double.MinValue, double.MinValue });
if (_editMode)
{
IDictionary<IFeature, IDrawnState> features = _drawingFilter.DrawnStates;
foreach (IFeature f in DataSet.Features)
{
if (category == features[f].SchemeCategory)
{
ext.ExpandToInclude(new Extent(f.Envelope));
}
}
if (_categoryExtents.Keys.Contains(category))
{
_categoryExtents[category] = ext.Copy();
}
else
{
_categoryExtents.Add(category, ext.Copy());
}
}
else
{
FastDrawnState[] states = DrawnStates;
List<ShapeRange> ranges = DataSet.ShapeIndices;
for (int shp = 0; shp < DrawnStates.Length; shp++)
{
if (states[shp].Category != null)
{
if (!_categoryExtents.ContainsKey(states[shp].Category))
{
_categoryExtents.Add(states[shp].Category, ranges[shp].Extent.Copy());
}
else
{
_categoryExtents[states[shp].Category].ExpandToInclude(ranges[shp].Extent);
}
}
}
}
return ext;
}