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


C# IEnvelope.Expand方法代码示例

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


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

示例1: SetDynamicValues


//.........这里部分代码省略.........
                                                                    for (int i = 0; i < sourceFieldNums.Length; i++)
                                                                    {
                                                                        int fnum = sourceLayer.FeatureClass.FindField(sourceFieldNames[i].Trim());
                                                                        if (fnum < 0)
                                                                        {
                                                                            missingFieldMess = sourceFieldNames[i].Trim() + " in table " + sourceLayerName;
                                                                            break;
                                                                        }
                                                                        sourceFieldNums[i] = fnum;
                                                                    }
                                                                    if (missingFieldMess == null)
                                                                    {
                                                                        for (int i = 0; i < destFieldNums.Length; i++)
                                                                        {
                                                                            int fnum = inFeature.Fields.FindField(destFieldNames[i].Trim());
                                                                            if (fnum < 0)
                                                                            {
                                                                                missingFieldMess = destFieldNames[i].Trim() + " in table " + tableName;
                                                                                break;
                                                                            }
                                                                            destFieldNums[i] = fnum;
                                                                        }
                                                                    }
                                                                    if (missingFieldMess == null)
                                                                    {
                                                                        AAState.WriteLine("                  Field Mapping verified");

                                                                        // found source and destination fields.
                                                                        sFilter = new SpatialFilterClass();

                                                                        if (searchDistance > 0)
                                                                        {
                                                                            searchEnvelope = inFeature.ShapeCopy.Envelope;
                                                                            searchEnvelope.Expand(searchDistance, searchDistance, false);
                                                                            sFilter.Geometry = searchEnvelope;
                                                                        }
                                                                        else
                                                                            sFilter.Geometry = inFeature.ShapeCopy;

                                                                        sFilter.GeometryField = sourceLayer.FeatureClass.ShapeFieldName;
                                                                        sFilter.SpatialRel = esriSpatialRelEnum.esriSpatialRelIntersects;
                                                                        AAState.WriteLine("                  Searching for Nearest Feature");

                                                                        fCursor = sourceLayer.FeatureClass.Search(sFilter, false);
                                                                        sourceFeature = fCursor.NextFeature();
                                                                        nearestFeature = null;

                                                                        proxOp = (IProximityOperator)inFeature.Shape;
                                                                        lastDistance = searchDistance;
                                                                        if (sourceFeature != null)
                                                                        {
                                                                            AAState.WriteLine("                  Features Found, looping for closest");

                                                                            while (sourceFeature != null)
                                                                            {

                                                                                distance = proxOp.ReturnDistance(sourceFeature.Shape);
                                                                                if (distance <= lastDistance)
                                                                                {
                                                                                    nearestFeature = sourceFeature;
                                                                                    lastDistance = distance;
                                                                                }
                                                                                sourceFeature = fCursor.NextFeature();
                                                                            }
                                                                        }
                                                                        if (nearestFeature != null)
开发者ID:riordabr,项目名称:3d-cities-template,代码行数:67,代码来源:Copy+of+AttributeAssistantEditorExtension.cs

示例2: ZoomTo

 private void ZoomTo(IEnvelope extent)
 {
     if (extent.Height == 0)
         extent.Height = extent.Width / 4;
     if (extent.Width == 0)
         extent.Width = extent.Height / 4;
     extent.Expand(1.2, 1.2, true);
     ArcMap.Document.ActivatedView.Extent = extent;
     ArcMap.Document.ActivatedView.Refresh();
     ArcMap.Document.ActivatedView.ScreenDisplay.UpdateWindow();
 }
开发者ID:travisval,项目名称:ParcelFabricCurveByInference,代码行数:11,代码来源:CurveByInferenceWindow.xaml.cs

示例3: CenterBase

        public void CenterBase(IEnvelope envelope)
        {
            IPoint point = new PointClass();
            try
            {
                point.PutCoords((envelope.XMin + envelope.XMax) / 2, (envelope.YMin + envelope.YMax) / 2);
            }
            catch
            {
                envelope = axMapControl1.ActiveView.Extent;
                point.PutCoords((envelope.XMin + envelope.XMax) / 2, (envelope.YMin + envelope.YMax) / 2);
            }

            //axMapControl1.CenterAt(point);
            //居中方法二

            envelope.Expand(this.Expand, this.Expand, true);

            var env2 = axMapControl1.ActiveView.Extent;
            env2.CenterAt(point);
            axMapControl1.ActiveView.Extent = envelope;//env2  时  当前视图显示范围

            axMapControl1.ActiveView.Refresh();
        }
开发者ID:LooWooTech,项目名称:Traffic,代码行数:24,代码来源:MainForm.cs


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