private void AddPoint(RaycastMapResult rayCastPoint) { Console.WriteLine($"Add point: {rayCastPoint}"); // TODO: Add 3d models to scene as map points //RectangleVisual3D myCube = new RectangleVisual3D(); //myCube.Origin = rayCastPoint.HitPoint; //myCube.Width = 200; //myCube.Length = 200; //myCube.Normal = new Vector3D(0, 1, 0); //myCube.LengthDirection = new Vector3D(0, 1, 0); //myCube.Material = new DiffuseMaterial(Brushes.Red); //myCube.UpdateModel(); //viewport.Children.Add(myCube); //viewport.UpdateLayout(); pointsList.Add(rayCastPoint); if (pointsList.Count == 1) { countOfSources = Convert.ToInt32(Microsoft.VisualBasic.Interaction.InputBox("Count of sources", "Please, enter the field", "1")); } }
private void AddPointWithCheck(RaycastMapResult rayCastPoint) { if (rayCastPoint == null) { return; } RaycastMapResult resultPoint = pointsList.FirstOrDefault((point) => point.TileLatLng.IsEquals(rayCastPoint.TileLatLng) && point.PointLatLng.InRange(rayCastPoint.PointLatLng, range)); if (resultPoint == null) { AddPoint(rayCastPoint); } else { RemovePoint(resultPoint); } }
private void RemovePoint(RaycastMapResult rayCastPoint) { Console.WriteLine($"Remove point: {rayCastPoint}"); pointsList.Remove(rayCastPoint); }