• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ILayer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ILayer的典型用法代码示例。如果您正苦于以下问题:C# ILayer类的具体用法?C# ILayer怎么用?C# ILayer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ILayer类属于命名空间,在下文中一共展示了ILayer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: AddContextMenuItems

        private void AddContextMenuItems(ILayer addedLayer)
        {
            IMapGroup grp = addedLayer as IMapGroup;
            if (grp != null)
            {
                // map.layerAdded event doesn't fire for groups. Therefore, it's necessary
                // to handle this event separately for groups.
                grp.LayerAdded += Map_LayerAdded;
            }

            if (addedLayer.ContextMenuItems.Exists(item => item.Name == contextMenuItemName))
            {
                // assume menu item already exists. Do nothing.
                return;
            }

            // add context menu item.
            var menuItem = new SymbologyMenuItem(contextMenuItemName, delegate { ShowAttributes(addedLayer as IFeatureLayer); });
            menuItem.Image = Resources.table_16x16;
            var cmi = addedLayer.ContextMenuItems;
            if (cmi.Count > 2)
            {
                addedLayer.ContextMenuItems.Insert(2, menuItem);
            }
            else
            {
                addedLayer.ContextMenuItems.Add(menuItem);
            }
       }
开发者ID:ExRam,项目名称:DotSpatial-PCL,代码行数:29,代码来源:TableEditorPlugin.cs


示例2: LayersLayerAdded

 void LayersLayerAdded(ILayer layer)
 {
     layer.DataChanged += AsyncLayerDataChanged;
     layer.Feedback += LayerFeedback;
     layer.PropertyChanged += LayerPropertyChanged;
     layer.Transformation = Transformation;
 }
开发者ID:HackatonArGP,项目名称:Guardianes,代码行数:7,代码来源:Map.cs


示例3: RenderFeaturesForLayer

		private static string RenderFeaturesForLayer(IViewport viewport, ILayer layer)
		{
			if (layer.Enabled == false) return null;

			/*
			if (layer is BasicLayer) {
				var renderedFeatures = SymbolRenderer.RenderStackedLabelLayer (viewport, layer as BasicLayer);

				if (renderedFeatures != null && renderedFeatures.Count > 0){
					renderQueue.PutLayer (layer.Name, renderedFeatures);
					return layer.Name;
				}
			}
			else*/ if (layer is LabelLayer) {
				var renderedFeatures = LabelRenderer.RenderStackedLabelLayer (viewport, layer as LabelLayer);

				if (renderedFeatures != null && renderedFeatures.Count > 0){
					renderQueue.PutLayer (layer.Name, renderedFeatures);
					return layer.Name;
				}
			} else {
				var renderedFeatures = RenderVectorLayerFeatures (viewport, layer);// new List<CALayer> ();

				if (renderedFeatures != null && renderedFeatures.Count > 0){
					//renderQueue.PutLayer (layer.Name, renderedFeatures);
					_featuresForLayer.Add(layer.Name, renderedFeatures);
					return layer.Name;
				}
			}

			return null;
		}
开发者ID:jdeksup,项目名称:Mapsui.Net4,代码行数:32,代码来源:FeatureRenderer.cs


示例4: Get_ChargeDensity_Deriv

        public override SpinResolved_Data Get_ChargeDensity_Deriv(ILayer[] layers, SpinResolved_Data carrier_density_deriv, SpinResolved_Data dopent_density_deriv, Band_Data chem_pot)
        {
            for (int i = 0; i < nz; i++)
            {
                double z = dz * i + zmin;

                // get the relevant layer and if it's frozen out, don't recalculate the dopent charge
                ILayer current_Layer = Solver_Bases.Geometry.Geom_Tool.GetLayer(layers, z);

                ZeroD_Density charge_calc = new ZeroD_Density(current_Layer, temperature);
                if (!current_Layer.Dopents_Frozen_Out(temperature))
                {
                    double local_dopent_density_deriv = charge_calc.Get_DopentDensityDeriv(chem_pot.vec[i]);
                    dopent_density_deriv.Spin_Up.vec[i] = 0.5 * local_dopent_density_deriv;
                    dopent_density_deriv.Spin_Down.vec[i] = 0.5 * local_dopent_density_deriv;
                }
                else
                {
                    dopent_density_deriv.Spin_Up.vec[i] = 0.0;
                    dopent_density_deriv.Spin_Down.vec[i] = 0.0;
                }

                carrier_density_deriv.Spin_Up.vec[i] = 0.5 * charge_calc.Get_CarrierDensityDeriv(chem_pot.vec[i]);
                carrier_density_deriv.Spin_Down.vec[i] = 0.5 * charge_calc.Get_CarrierDensityDeriv(chem_pot.vec[i]);
            }

            return carrier_density_deriv + dopent_density_deriv;
        }
开发者ID:EdmundOwen,项目名称:QuMESHS,代码行数:28,代码来源:OneD_Density_Base.cs


示例5: Network

        //public Network(double[][] inputValues, double[] desiredOutput, int numberOfLayers, int[] numberOfNeuronsInLayers)
        public Network(int inputWidth, int numberOfLayers, int[] numberOfNeuronsInLayers)
        {
            //_input = inputValues;
            //_desiredOutput = desiredOutput;

            _inputWidth = inputWidth;
            _numberOfLayers = numberOfLayers;

            Layers = new ILayer[_numberOfLayers + 2]; // nie liczymy warstwy wejściowej i wyjściowej

            //najpierw warstwa wejciowa
            Layers[0] = new InputLayer(_inputWidth, _inputWidth);
            //Layers[0] = new InputLayer();

            for (int i = 1; i < numberOfLayers+1; i++)
            {
                Layers[i] = new Layer(numberOfNeuronsInLayers[i - 1], Layers[i - 1].Neurons.Length);
            }

            //warstwa wyjściowa co ma tylko 1 neuron
            Layers[numberOfLayers+1] = new Layer(1, Layers[numberOfLayers].Neurons.Length);

            _totalNumberOfWeights = 0;
            foreach (var layer in Layers)
            {
                _totalNumberOfWeights += layer.NumberOfWeights();
            }
        }
开发者ID:ciasteczko-i-mleczko,项目名称:magisterka,代码行数:29,代码来源:Network.cs


示例6: OpenAttributeTable

        public OpenAttributeTable(ILayer pLayer)
        {
            //
            // TODO: Define values for the public properties
            //
            base.m_category = ""; //localizable text
            base.m_caption = "打开属性表";  //localizable text
            base.m_message = "打开属性表";  //localizable text
            base.m_toolTip = "打开属性表";  //localizable text
            base.m_name = "打开属性表";   //unique id, non-localizable (e.g. "MyCategory_MyCommand")
            m_pLayer = pLayer;

            try
            {
            //
            // TODO: change bitmap name if necessary
            //
            string bitmapResourceName = GetType().Name + ".bmp";
            base.m_bitmap = new Bitmap(GetType(), bitmapResourceName);
            }
            catch (Exception ex)
            {
            System.Diagnostics.Trace.WriteLine(ex.Message, "Invalid Bitmap");
            }
        }
开发者ID:Krystal001025,项目名称:temp,代码行数:25,代码来源:OpenAttributeTable.cs


示例7: Render

        public override bool Render(IFeature feature, Graphics g, ILayer layer)
        {
            var segmentsLayer = (NetworkCoverageSegmentLayer) layer;
            var coverage = ((NetworkCoverageFeatureCollection)layer.DataSource).RenderedCoverage;
            IEnvelope mapExtents = layer.Map.Envelope;
            
            var sliceValues = coverage.GetValues();

            // 1 find the segments withing the current extend
            var segments = coverage.Segments.Values;//.Where(seg => seg.Geometry.EnvelopeInternal.Intersects(mapExtents)).ToList();

            for (int i = 0; i < segments.Count; i++)
            {
                INetworkSegment segment = segments[i];
                if (segment.Geometry.EnvelopeInternal.Intersects(mapExtents) && sliceValues.Count > 0)
                {
                    // 2 get the values for this segment
                    // if SegmentGenerationMethod == SegmentGenerationMethod.RouteBetweenLocations the segments and 
                    // location do not have to match; return default value
                    double value = coverage.SegmentGenerationMethod == SegmentGenerationMethod.RouteBetweenLocations
                                       ? 0
                                       : (double) sliceValues[i];

                    // 3 use the Theme of the layer to draw 
                    var style = (VectorStyle)segmentsLayer.Theme.GetStyle(value);
                    VectorRenderingHelper.RenderGeometry(g, layer.Map, segment.Geometry, style, null, true);
                }
            }
            return true;
        }
开发者ID:lishxi,项目名称:_SharpMap,代码行数:30,代码来源:NetworkCoverageSegmentRenderer.cs


示例8: GetFeatures

 //Why ask the renderer when you know already?
 public override IList GetFeatures(IEnvelope box, ILayer layer)
 {
     var coverage = ((NetworkCoverageSegmentLayer)layer).Coverage;
     var segments = coverage.Segments.Values
         .Where(networkLocation => networkLocation.Geometry.EnvelopeInternal.Intersects(box)).ToList();
     return segments;
 }
开发者ID:lishxi,项目名称:_SharpMap,代码行数:8,代码来源:NetworkCoverageSegmentRenderer.cs


示例9: SetDataSource

 private void SetDataSource(IDataSource dataSource, ILayer layer)
 {
     this.Clear();
     this.activeDataSources.Add(dataSource);
     this.videoControl.AddLayer(layer);
     dataSource.Start();
 }
开发者ID:an83,项目名称:KinectTouch2,代码行数:7,代码来源:MainForm.cs


示例10: KohonenLearning

        public KohonenLearning(ILayer layer)
        {
            int neuronsCount = layer.Neurons.Count;
            this._width = (int) Math.Sqrt( neuronsCount );

            this._layer	= layer;
        }
开发者ID:spolnik,项目名称:Neural_Network_Sample,代码行数:7,代码来源:KohonenLearning.cs


示例11: Calculate

        /// <summary>
        /// Called internally to calculate a depth. 
        /// </summary>
        /// <param name="currentDepth">The current depth.</param>
        /// <param name="layer">The layer we are on.</param>
        private void Calculate(int currentDepth, ILayer layer)
        {

            // record this layer
            if (this.depths.ContainsKey(layer))
            {
                int oldDepth = this.depths[layer];
                if (currentDepth > oldDepth)
                {
                    this.depths[layer] = currentDepth;
                }
            }
            else
            {
                this.depths[layer] = currentDepth;
            }

            // traverse all of the ways to get to that layer
            ICollection<ILayer> prev = this.network.Structure
                    .GetPreviousLayers(layer);

            foreach (ILayer nextLayer in prev)
            {
                if (!this.depths.ContainsKey(nextLayer))
                {
                    Calculate(currentDepth + 1, nextLayer);
                }
            }
        }
开发者ID:encog,项目名称:encog-silverlight-core,代码行数:34,代码来源:CalculateDepth.cs


示例12: AddNewFeatureByGeometry

        public virtual IFeature AddNewFeatureByGeometry(ILayer layer, IGeometry geometry)
        {
            if (CreateNewFeature != null)
            {
                var feature = CreateNewFeature(layer);
                feature.Geometry = geometry;
                AddFeatureToDataSource(layer, feature);
                return feature;
            }

            if(addingNewFeature)
            {
                throw new InvalidOperationException("loop detected, something is wrong with your feature provider (check AddNewFeatureFromGeometryDelegate)");
            }

            addingNewFeature = true;
            IFeature newFeature = null;

            try
            {
                newFeature = (IFeature)Activator.CreateInstance(layer.DataSource.FeatureType);
                newFeature.Geometry = geometry;
                AddFeatureToDataSource(layer, newFeature);
            }
            finally
            {
                addingNewFeature = false;
            }

            return newFeature;
        }
开发者ID:lishxi,项目名称:_SharpMap,代码行数:31,代码来源:FeatureEditor.cs


示例13: CreateInteractor

        public virtual IFeatureInteractor CreateInteractor(ILayer layer, IFeature feature)
        {
            if (null == feature)
                return null;

            var vectorLayer = layer as VectorLayer;
            var vectorStyle = (vectorLayer != null ? vectorLayer.Style : null);

            // most specific type should be first
            if (feature is RegularGridCoverageCell)
                return new LineStringInteractor(layer, feature, vectorStyle, null);

            if (feature is IGridFace || feature is IGridVertex)
                return new LineStringInteractor(layer, feature, vectorStyle, null);
            
            if (feature.Geometry is ILineString)
                return new LineStringInteractor(layer, feature, vectorStyle, null);
            
            if (feature.Geometry is IPoint)
                return new PointInteractor(layer, feature, vectorStyle, null);
            
            // todo implement custom mutator for Polygon and MultiPolygon
            // LineStringMutator will work as long as moving is not supported.
            if (feature.Geometry is IPolygon)
                return new LineStringInteractor(layer, feature, vectorStyle, null);
            
            if (feature.Geometry is IMultiPolygon)
                return new LineStringInteractor(layer, feature, vectorStyle, null);
            
            return null;
            //throw new ArgumentException("Unsupported type " + feature.Geometry);
        }
开发者ID:lishxi,项目名称:_SharpMap,代码行数:32,代码来源:FeatureEditor.cs


示例14: ModifyShape

 public ModifyShape(ILayer pCurrentLayer)
 {
     //
     // TODO: Define values for the public properties
     //
     m_CurrentLayer = pCurrentLayer;
 }
开发者ID:chinasio,项目名称:minegis,代码行数:7,代码来源:ModifyShape+.cs


示例15: SetUp

        public void SetUp()
        {
            threadingPolicy = new SingleThreadingPolicy();
            transactionFactory = new TransactionFactory(threadingPolicy);

            layer = MockRepository.GenerateMock<ILayer>();

            serverManager = MockRepository.GenerateMock<IServerManager>();

            serverManagerFactory = MockRepository.GenerateMock<IServerManagerFactory>();

            operationFactory = new OperationFactory(layer, serverManagerFactory);

            sut = new Deployer(transactionFactory, operationFactory);

            project = new Project
            {
                Name = "Search.API",
                Source = @"\\ystage01.ywebfarm.lcl\e$\ServiceArtifacts\Yoox.API\Search.API\1.1_new",
                Path = @"Test\Yoox.API\Search.API\1.0",
                Application = "Search.API",
                Site = "Yoox.API",
                Servers = new[] { @"\\serverA\", @"\\serverB\" },
            };
        }
开发者ID:repne,项目名称:WitchHunter,代码行数:25,代码来源:DeployerTest.cs


示例16: Snap

        ///// <summary>
        ///// snapping specific for a tool. Called before layer specific snappping is applied.
        ///// </summary>
        ///// <param name="sourceLayer"></param>
        ///// <param name="snapSource"></param>
        ///// <param name="worldPos"></param>
        ///// <param name="Envelope"></param>
        ///// <returns></returns>
        public void Snap(ILayer sourceLayer, IGeometry snapSource, ICoordinate worldPos, IEnvelope Envelope)
        {
            SnapResult = null;
            IFeature sourceFeature = MapControl.SelectTool.FeatureEditors[0].SourceFeature;
            if (sourceFeature.Geometry != snapSource)
                return;
            SnapRole snapRole = SnapRole.FreeAtObject;
            if ((Control.ModifierKeys & Keys.Control) == Keys.Control)
                snapRole = SnapRole.Free;
            ISnapRule snapRule = new SnapRule
                                     {
                                         SourceLayer = sourceLayer,
                                         TargetLayer = sourceLayer,
                                         Obligatory = true,
                                         SnapRole = snapRole,
                                         PixelGravity = 4
                                     };

            SnapResult = MapControl.SnapTool.ExecuteSnapRule(
                                                snapRule,
                                                sourceFeature,
                                                sourceFeature.Geometry,
                                                new List<IFeature>
                                                    {
                                                        sourceFeature
                                                    },
                                                worldPos,
                                                -1);
        }
开发者ID:lishxi,项目名称:_SharpMap,代码行数:37,代码来源:CurvePointTool.cs


示例17: AttributeTable

        /// <summary>
        /// Overloaded Constructor method
        /// </summary>
        /// <param name="iLayer"> Argument is passed by reference for layer file selected</param>
        public AttributeTable(ILayer iLayer)
        {
            InitializeComponent();

            //intialize variables
            m_iLayer = iLayer;
        }
开发者ID:dmuthami,项目名称:Meru_Water,代码行数:11,代码来源:AttributeTable.cs


示例18: LayerDialog

 /// <summary>
 /// Creates a new instance of LayerDialog form to display the symbology and
 /// other properties of the specified feature layer
 /// </summary>
 /// <param name="selectedLayer">the specified feature layer that is
 /// modified using this form</param>
 /// <param name="control">The control.</param>
 public LayerDialog(ILayer selectedLayer, ICategoryControl control)
     : this()
 {
     _layer = selectedLayer;
     propertyGrid1.SelectedObject = _layer;
     Configure(control);
 }
开发者ID:DIVEROVIEDO,项目名称:DotSpatial,代码行数:14,代码来源:LayerDialog.cs


示例19: InsertLayer

        public void InsertLayer(ILayer layer, int index)
        {
            Layers.Insert(index, layer);
            layerCollection.Insert(index + 1, layer);

            OnLayersChanged(EventArgs.Empty);
        }
开发者ID:HackatonArGP,项目名称:Guardianes,代码行数:7,代码来源:LayerHelper.cs


示例20: GetUnByDataStatistics

 private string[] GetUnByDataStatistics(ILayer layer, String strField)
 {
     IFeatureLayer featureLayer = layer as IFeatureLayer;
     ILayerFields pLayerFields = featureLayer as ILayerFields;
     int nCount=pLayerFields.FieldCount;
     IQueryFilter queryFilter = new QueryFilterClass();
     queryFilter.SubFields = strField;
     IFeatureCursor featureCursor = featureLayer.FeatureClass.Search(queryFilter, true);
     IDataStatistics dataStatistics = new DataStatisticsClass();
     dataStatistics.Field = strField;
     dataStatistics.Cursor = featureCursor as ICursor;
     System.Collections.IEnumerator pEnumvar = dataStatistics.UniqueValues;
     int number = dataStatistics.UniqueValueCount;
     pEnumvar.Reset();
     object obj = null;
     pEnumvar.MoveNext();
     int i = 0;
     string[] str = new string[nCount];
     while (pEnumvar.MoveNext())
     {
         obj = pEnumvar.Current;
         str[i++] = obj.ToString();
     }
     return str;
 }
开发者ID:lovelll,项目名称:FeatureMerge,代码行数:25,代码来源:MainForm.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ILayout类代码示例发布时间:2022-05-24
下一篇:
C# ILanguageService类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap