本文整理汇总了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);
}
}
示例2: LayersLayerAdded
void LayersLayerAdded(ILayer layer)
{
layer.DataChanged += AsyncLayerDataChanged;
layer.Feedback += LayerFeedback;
layer.PropertyChanged += LayerPropertyChanged;
layer.Transformation = Transformation;
}
示例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;
}
示例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;
}
示例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();
}
}
示例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");
}
}
示例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;
}
示例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;
}
示例9: SetDataSource
private void SetDataSource(IDataSource dataSource, ILayer layer)
{
this.Clear();
this.activeDataSources.Add(dataSource);
this.videoControl.AddLayer(layer);
dataSource.Start();
}
示例10: KohonenLearning
public KohonenLearning(ILayer layer)
{
int neuronsCount = layer.Neurons.Count;
this._width = (int) Math.Sqrt( neuronsCount );
this._layer = layer;
}
示例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);
}
}
}
示例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;
}
示例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);
}
示例14: ModifyShape
public ModifyShape(ILayer pCurrentLayer)
{
//
// TODO: Define values for the public properties
//
m_CurrentLayer = pCurrentLayer;
}
示例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\" },
};
}