public void LoadFromFile(Stream file, string path) { XmlDocument dataDoc = new XmlDocument(); dataDoc.Load(file); _currentLine.Clear(); _linesList.Clear(); _linesNumbers.Clear(); XmlNodeList lines = dataDoc.GetElementsByTagName("Line"); foreach(XmlNode lineNode in lines) { List<Vector2> line = new List<Vector2>(); XmlNode pointNode = lineNode.FirstChildWithName("Point"); while(pointNode != null) { Vector2 point = new Vector2(); var imgx = pointNode.Attributes["x"]; if(imgx != null) point.X = double.Parse(imgx.Value); var imgy = pointNode.Attributes["y"]; if(imgy != null) point.Y = double.Parse(imgy.Value); line.Add(point); pointNode = pointNode.NextSibling; } _linesList.Add(line); _linesNumbers.Add(_linesList.Count - 1); } }
public void LoadFromFile(Stream file, string path) { XmlDocument dataDoc = new XmlDocument(); dataDoc.Load(file); _pointList.Clear(); XmlNodeList points = dataDoc.GetElementsByTagName("Point"); foreach(XmlNode pointNode in points) { Vector2 point = new Vector2(); var imgx = pointNode.Attributes["imgx"]; if(imgx != null) point.X = double.Parse(imgx.Value); var imgy = pointNode.Attributes["imgy"]; if(imgy != null) point.Y = double.Parse(imgy.Value); _pointList.Add(point); } }
private void AddPoint(object sender, RoutedEventArgs e) { Vector2 point = new Vector2(); _pointList.Add(point); }
public CalibrationPoint() { _img = new Vector2(); _real = new Vector3(); _realGridPos = new TPoint2D<int>(-1, -1); }