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


C# ILayer类代码示例

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


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


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