public GridInterpolationModalForm(List <VectorLayer> vectorLayers, AbstractLayer selectedLayer)
        {
            InitializeComponent();

            TypeGeometryComboBox.SelectedIndexChanged     -= UpdateGeometry;
            VectorLayersListComboBox.SelectedIndexChanged -= UpdateGeometry;
            numericUpDownGridStep.ValueChanged            -= UpdateGeometry;
            numericUpDownX.ValueChanged -= UpdateXStepGeometry;
            numericUpDownY.ValueChanged -= UpdateYStepGeometry;

            VectorLayersListComboBox.Items.Clear();
            VectorLayersListComboBox.DataSource    = vectorLayers;
            VectorLayersListComboBox.DisplayMember = "Name";
            VectorLayersListComboBox.ValueMember   = "Name";

            SelectedLayer = selectedLayer;
            //selectedGeometry = gridGeometry;

            GetDefaultGeometry();

            UpdateGeometry(new object(), new EventArgs());

            TypeGeometryComboBox.SelectedIndexChanged     += UpdateGeometry;
            VectorLayersListComboBox.SelectedIndexChanged += UpdateGeometry;
            numericUpDownGridStep.ValueChanged            += UpdateGeometry;
            numericUpDownX.ValueChanged += UpdateXStepGeometry;
            numericUpDownY.ValueChanged += UpdateYStepGeometry;
        }
示例#2
0
        /// <summary>
        /// 节点Check事件,用于查询图层内容
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void advTreeMain_AfterCheck(object sender, AdvTreeCellEventArgs e)
        {
            Node checkNode = e.Cell.Parent;

            AbstractLayer lyr = this.GetLayerByName(checkNode.Text);

            //影像图层加载
            if (lyr == null)
            {
                string path = Path.Combine(Path.GetDirectoryName(_projectPath), checkNode.Text + ".xml");
                if (File.Exists(path) == false)
                {
                    return;
                }
                DomLayerInfo lyrInfo = XmlHelper.Deserialize <DomLayerInfo>(path);
                if (lyrInfo == null)
                {
                    return;
                }
                lyr = LayerLoader.CreateDomLyr(lyrInfo, _globeView);
            }
            if (lyr != null)
            {
                lyr.Visible = e.Cell.Checked;
            }
            //飞行
            if (e.Cell.Checked)
            {
                this.LocLyrByName(checkNode.Text);
            }
        }
示例#3
0
        public BackPropagationLearning(ActivationNetwork network)
        {
            this.network = network;

            // create error and deltas arrays
            _neuronErrors      = new double[network.LayersCount][];
            _weightsUpdates    = new double[network.LayersCount][][];
            _thresholdsUpdates = new double[network.LayersCount][];

            // initialize errors and deltas arrays for each layer
            for (int i = 0, n = network.LayersCount; i < n; i++)
            {
                AbstractLayer layer = network[i];

                _neuronErrors[i]      = new double[layer.NeuronsCount];
                _weightsUpdates[i]    = new double[layer.NeuronsCount][];
                _thresholdsUpdates[i] = new double[layer.NeuronsCount];

                // for each neuron
                for (int j = 0; j < layer.NeuronsCount; j++)
                {
                    _weightsUpdates[i][j] = new double[layer.InputsCount];
                }
            }
        }
示例#4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ArtifactEditorDialog"/> class.
 /// </summary>
 /// <param name="layer">The layer.</param>
 public ArtifactEditorDialog(AbstractLayer layer)
 {
     _layer = layer;
     InitializeComponent();
     pnlActions.Location = pnlEdition.Location;
     PopulateList();
 }
示例#5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ManageArtifactsCommand"/> class.
 /// </summary>
 /// <param name="model">The model.</param>
 public ManageArtifactsCommand(object model)
 {
     _layer = null;
     if (model is NodeShape)
     {
         _layer = ((NodeShape)model).ModelElement as AbstractLayer;
     }
 }
示例#6
0
        private void toolStripButton6_Click(object sender, EventArgs e)
        {
            double searchRadius = 1;
            int    power        = 1;

            if (map.LayerControl.SelectedLayer != null &&
                map.LayerControl.SelectedLayer is VectorLayer &&
                map.LayerControl.SelectedLayer.Visible)
            {
                VectorLayer  vectorLayer  = (VectorLayer)map.LayerControl.SelectedLayer;
                GridGeometry gridGeometry = null;
                GridInterpolationModalForm interpolationForm = new GridInterpolationModalForm();

                interpolationForm.InitializeForm(map.LayerControl.VectorLayers, ref vectorLayer, ref gridGeometry, ref searchRadius, ref power);
                if (interpolationForm.DialogResult == DialogResult.OK)
                {
                    GridLayer gridLayer = new GridLayer(gridGeometry, map);
                    foreach (var layer in map.Layers)
                    {
                        if (layer.Name == gridLayer.Name)
                        {
                            gridLayer.Name = Interaction.InputBox("Grid для данного слоя уже существует. Введите уникальное название для нового слоя.", "Название слоя", vectorLayer.Name) + ".grd";
                        }
                        else
                        {
                            gridLayer.Name = vectorLayer.Name + ".grd";
                        }
                    }
                    map.AddLayer(gridLayer);
                    List <GeoPoint> points = new List <GeoPoint>();

                    gridLayer.ColorMin = MinStripButton.BackColor;
                    gridLayer.ColorMax = MaxStripButton.BackColor;

                    points = GetPoints(vectorLayer);

                    if (points.Count == 0)
                    {
                        MessageBox.Show("Количество точек равно 0");
                    }
                    else
                    {
                        selectedLayer = gridLayer;
                        gridLayer.DoInterpolation(points, searchRadius, power);
                        ShowColors();
                    }
                }
                else
                {
                }
                map.Refresh();
            }
            else
            {
                MessageBox.Show("Необходимо выбрать векторный слой !");
            }
        }
示例#7
0
        public void InitiateLevel(AbstractLayer terrainLayer, int dimensionX, int dimensionY)
        {
            terrains = new DisplayTerrain[dimensionX, dimensionY];
            terrains.FillWithDefault(terrainLayer);
            terrains.SetPosition();

            LevelWidth = terrains[0, 0].ContentSize.Width * dimensionX;
            LevelHeight = terrains[0, 0].ContentSize.Height * dimensionY;
        }
示例#8
0
        public void AddLayer(AbstractLayer Layer)
        {
            Layers.Add(Layer);
            if (LayerControl != null)
            {
                LayerControl.RefreshList();
            }

            Layer.map = this;
        }
示例#9
0
 /// <summary>
 /// Récupère les configurations
 /// </summary>
 /// <param name="layer">The layer.</param>
 private void RetrieveConfigurations(AbstractLayer layer)
 {
     foreach (ConfigurationPart part in layer.Configurations)
     {
         if (part.Visibility == Visibility.Public)
         {
             _configurations.Add(part);
         }
     }
 }
示例#10
0
        public void LoadLevel(AbstractLayer terrainLayer)
        {
            CurrentLevel = new Level();
            CurrentLevel.InitiateLevel(terrainLayer, 3, 2);

            // set player positions
            MinPlayerPositionX = Screen.MiddleX;
            MinPlayerPositionY = Screen.MiddleY;
            MaxPlayerPositionX = CurrentLevel.LevelWidth - Screen.MiddleX;
            MaxPlayerPositionY = CurrentLevel.LevelHeight - Screen.MiddleY;
        }
示例#11
0
        public static Graphic GetRandomGraphic <T>(this AbstractLayer <T> layer) where T : IDisplayableGeoElement
        {
            Random            random   = new Random();
            GraphicCollection graphics = layer.GetOverlay().Graphics;

            if (graphics.Count == 0)
            {
                return(null);
            }

            return(graphics[random.Next(0, graphics.Count)]);
        }
        protected void Reset()
        {
            if (this.rigid == null)
            {
                this.rigid = GetComponent <T>();
            }

            if (this.layer == null)
            {
                this.layer = GetComponent <AbstractLayer>();
            }
        }
示例#13
0
        public override void Compile(AbstractCostFunction lossFunction, AbstractOptimizer optimizer)
        {
            AbstractLayer previousLayer = null;

            // compile each layer and check dimension
            // of input and output
            //layers.Reverse();
            foreach (AbstractLayer layer in layers)
            {
                previousLayer = layer.Compile(previousLayer);
            }

            this.lossFunction = lossFunction;
            this.optimizer    = optimizer;
        }
示例#14
0
        private List <GeoPoint> GetPoints(AbstractLayer layer)
        {
            List <GeoPoint> points = new List <GeoPoint>();

            foreach (MapObject m in layer.Objects)
            {
                if (m is Labs.MapObjects.Points.Point)
                {
                    var p = (Labs.MapObjects.Points.Point)m;
                    points.Add(new GeoPoint(p.location.x, p.location.y, p.location.z));
                }
            }

            return(points);
        }
示例#15
0
文件: Layer.cs 项目: aragoubi/Project
        public Layer(LayerStack layerStack, Lessons.Lesson lessonModel, AbstractLayer layerModel)
        {
            this.layerStack  = layerStack;
            this.lessonModel = lessonModel;
            this.layerModel  = layerModel;
            Strokes          = StrokeConverter.ToWindowsStrokes(layerModel.Strokes);

            if (layerModel.GetType() == typeof(QuizAnswerLayer))
            {
                DisplayChart();
            }
            else if (layerModel.GetType() == typeof(GraphicalAnswerLayer))
            {
                DisplaySaliencyMap();
            }
        }
        public static int PhysicsLayer(this GameObject obj, bool containsUnityLayer = true)
        {
            AbstractLayer layer = null;

            if (!(Dic.TryGetValue(obj, out layer) == true && layer != null))
            {
                layer = obj.GetComponent <AbstractLayer>();
            }

            if (layer == null || (containsUnityLayer == false && layer.LayerID < LayersManager.UnityLayerCount))
            {
                return(-1);
            }

            Dic[obj] = layer;
            return(layer.LayerID);
        }
示例#17
0
        /// <summary>
        /// </summary>
        /// <param name="e">Provides data for the ElementDeleted event.</param>
        public override void ElementDeleted(ElementDeletedEventArgs e)
        {
            LayerPackage layerPackage = e.ModelElement as LayerPackage;

            if (layerPackage == null)
            {
                return;
            }

            if (layerPackage.Store.InUndoRedoOrRollback)
            {
                return;
            }

            SoftwareComponent component = CandleModel.GetInstance(layerPackage.Store).SoftwareComponent;

            if (component != null)
            {
                // Suppression de la couche d'interface
                AbstractLayer interfaceLayer = null;
                foreach (AbstractLayer al in component.Layers)
                {
                    ISortedLayer sl = al as ISortedLayer;
                    if (sl != null && sl.Level == layerPackage.LayerLevel)
                    {
                        interfaceLayer = al;
                        break;
                    }
                }
                if (interfaceLayer != null)
                {
                    interfaceLayer.Delete();
                }
                IList <PresentationViewsSubject> shapes = PresentationViewsSubject.GetLinksToPresentation(component);
                foreach (PresentationViewsSubject link in shapes)
                {
                    ((SoftwareComponentShape)link.Presentation).ArrangeShapes();
                }
            }
        }
示例#18
0
        /// <summary>
        /// Handles the Click event of the btnOK control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void btnOK_Click(object sender, EventArgs e)
        {
            if (_currentComponent == null)
            {
                return;
            }

            using (
                Transaction transaction =
                    _currentComponent.Store.TransactionManager.BeginTransaction("Set configuration status"))
            {
                bool flag = false;
                foreach (Item item in _items)
                {
                    if (item.InitialEnabled != item.Enabled && !item.IsExternal)
                    {
                        AbstractLayer layer =
                            (AbstractLayer)_currentComponent.Store.ElementDirectory.FindElement(item.LayerId);
                        ConfigurationPart part =
                            layer.Configurations.Find(
                                delegate(ConfigurationPart cp) { return(cp.Name == item.ConfigName); });
                        if (part != null)
                        {
                            part.Visibility = item.Visibility;
                            part.Enabled    = item.Enabled;
                            flag            = true; // Il va falloir commiter
                        }
                    }
                }

                if (flag)
                {
                    transaction.Commit();
                }
            }
        }
示例#19
0
 /// <summary>
 ///     Layers the doesnt exist anymore (called when a Layer is deleted)
 ///     We keep the LayerLink instance but we can tell the user that the link is broken
 /// </summary>
 public void LayerDoesntExistAnymore()
 {
     Layer = null;
     _dead = true;
 }
示例#20
0
 public LayerLink(AbstractLayer layer)
 {
     Layer = layer;
     Layer.References.Add(this);
     _dead = false;
 }
示例#21
0
 public DataSet GetAllMoviesBySearchCriteria(AbstractLayer.MovieSearchCriteria criteria)
 {
     LogWrapper.LogInfo("Retrieving movies from PlanetM for given search criteria.");
     return DBAObj.GetAllMoviesBySearchCriteria(criteria);
 }
示例#22
0
 public override void ImportLayer(AbstractLayer layer)
 {
     throw new NotImplementedException();
 }
示例#23
0
 public override void ImportLayer(AbstractLayer layer)
 {
     layer.UID = Guid.NewGuid().GetHashCode();
     Layers.Add(layer);
 }
示例#24
0
 public abstract void ImportLayer(AbstractLayer layer);
示例#25
0
 public LayerLink(AbstractLayer layer)
 {
     Layer = layer;
     Layer.References.Add(this);
     _dead = false;
 }
示例#26
0
 /// <summary>
 ///     Layers the doesnt exist anymore (called when a Layer is deleted)
 ///     We keep the LayerLink instance but we can tell the user that the link is broken
 /// </summary>
 public void LayerDoesntExistAnymore()
 {
     Layer = null;
     _dead = true;
 }
示例#27
0
 public void InsertLayers(int Index, AbstractLayer Layer)
 {
     Layers.Insert(Index, Layer);
 }
示例#28
0
 public void Delete(AbstractLayer layer)
 {
     Layers.Remove(layer);
 }
示例#29
0
 public override void Add(AbstractLayer layer)
 {
     layers.Add(layer);
 }
示例#30
0
 /// <summary>
 ///     Adds the layer (internal as it only should be called by the AnchoredTag)
 /// </summary>
 /// <param name="l">The layer.</param>
 internal void AddLayer(AbstractLayer l)
 {
     ConcernedLayers.Add(l);
 }
示例#31
0
 /// <summary>
 /// Method for adding new layer into model of convolutional neural network
 /// </summary>
 /// <param name="layer">e.g. ConvolutionalLayer</param>
 public abstract void Add(AbstractLayer layer);
示例#32
0
 /// <summary>
 ///     Removes the layer. (internal as it only should be called by the AnchoredTag)
 /// </summary>
 /// <param name="l">The layer.</param>
 internal void RemoveLayer(AbstractLayer l)
 {
     ConcernedLayers.Remove(l);
 }