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


C# EnvelopeClass.DefineFromPoints方法代码示例

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


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

示例1: ToggleOperableStatus

        public static IEnvelope ToggleOperableStatus(IApplication app, IPoint point, bool showMessage, string ISOvalveFeatureLayerName, string ISOsourceFeatureLayerName, string ISOoperableFieldNameValves, string ISOoperableFieldNameSources, string[] ISOoperableValues, double SnapTol)
        {
            //m_ISOsourceFeatureLayerName = ConfigUtil.GetConfigValue("TraceIsolation_Source_FeatureLayer", "");
            //m_ISOvalveFeatureLayerName = ConfigUtil.GetConfigValue("TraceIsolation_Valve_FeatureLayer", "");

            //m_ISOoperableFieldNameValves = ConfigUtil.GetConfigValue("TraceIsolation_Operable_Field_Valves", "");
            //m_ISOoperableFieldNameSources = ConfigUtil.GetConfigValue("TraceIsolation_Operable_Field_Sources", "");
            //m_ISOoperableValues = ConfigUtil.GetConfigValue("TraceIsolation_Operable_Values", "").Split('|');
            IFeatureCursor fcursor = null;
            ICursor ccursor = null;
            IFeature feat = null;
            UID uID = null;
            IEditor editor = null;
            IMxDocument mxdoc = null;
            IMap map = null;
            IFeatureLayer[] valveFLs = null;
            IFeatureClass[] valveFCs = null;
            IFeatureLayer[] sourceFLs = null;
            IFeatureClass[] sourceFCs = null;
            IEnvelope retEnv = null;
            //IGeometry geom = null;
            //IProximityOperator proxOp = null;
            IEnvelope env = null;
            ISpatialFilter sf = null;
            IWorkspace work = null;
            IWorkspaceEdit workEdit = null;
            IField opField = null;
            IPoint pTmpPnt = null;

            IEnvelope ptmpEnv = null;

            IDisplayExpressionProperties pDEP = null;
            IDisplayString pIDS = null;
            try
            {
                //Get editor
                uID = new UID();
                uID.Value = "esriEditor.Editor";
                editor = app.FindExtensionByCLSID(uID) as IEditor;

                mxdoc = app.Document as IMxDocument;
                map = mxdoc.ActiveView.FocusMap;

                string[] strValveFLs = ISOvalveFeatureLayerName.Split('|');
                // string[] strOpValues = .Split('|');
                valveFLs = new IFeatureLayer[strValveFLs.Length];//(IFeatureLayer)Globals.FindLayer(map, valveFLName);
                valveFCs = new IFeatureClass[strValveFLs.Length];
                bool lyrFnd = false;

                for (int i = 0; i < valveFLs.Length; i++)
                {
                    bool FCorLayerTemp = true;

                    valveFLs[i] = (IFeatureLayer)Globals.FindLayer(map, strValveFLs[i], ref FCorLayerTemp);
                    if (valveFLs[i] != null)
                    {
                        valveFCs[i] = valveFLs[i].FeatureClass;
                        lyrFnd = true;
                    }

                }
                string[] strSourceFLs = ISOsourceFeatureLayerName.Split('|');
                // string[] strOpValues = .Split('|');
                sourceFLs = new IFeatureLayer[strSourceFLs.Length];//(IFeatureLayer)Globals.FindLayer(map, valveFLName);
                sourceFCs = new IFeatureClass[strSourceFLs.Length];

                for (int i = 0; i < sourceFLs.Length; i++)
                {
                    bool FCorLayerTemp = true;

                    sourceFLs[i] = (IFeatureLayer)Globals.FindLayer(map, strSourceFLs[i], ref FCorLayerTemp);
                    if (sourceFLs[i] != null)
                    {
                        sourceFCs[i] = sourceFLs[i].FeatureClass;
                        lyrFnd = true;
                    }

                }
                if (lyrFnd == false)
                {
                    MessageBox.Show(A4LGSharedFunctions.Localizer.GetString("GeoNetToolsError_12a") + ISOvalveFeatureLayerName + A4LGSharedFunctions.Localizer.GetString("Or") + ISOsourceFeatureLayerName + A4LGSharedFunctions.Localizer.GetString("GeoNetToolsError_12b"), A4LGSharedFunctions.Localizer.GetString("GeoNetToolsError_12c"));
                    return null;
                }

                // Globals.ClearSelected(map, false);

                foreach (IFeatureLayer valveFLayer in valveFLs)
                {

                    if (point != null)
                    {

                        env = new EnvelopeClass();
                        env.DefineFromPoints(1, ref point);
                        env.Expand(SnapTol / 2, SnapTol / 2, false);

                        sf = new SpatialFilterClass();
                        sf.Geometry = env;
                        sf.GeometryField = valveFLayer.FeatureClass.ShapeFieldName;
                        sf.SpatialRel = esriSpatialRelEnum.esriSpatialRelIntersects;
//.........这里部分代码省略.........
开发者ID:rlwarford,项目名称:local-government-desktop-addins,代码行数:101,代码来源:GeoNetTools.cs


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