예제 #1
0
파일: LineHelper.cs 프로젝트: fel88/GeomPad
        public LineHelper(XElement item) : base(item)
        {
            if (item.Attribute("showCrosses") != null)
            {
                ShowCrosses = bool.Parse(item.Attribute("showCrosses").Value);
            }

            var pos = item.Attribute("start").Value.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries).Select(z => double.Parse(z.Replace(",", "."), CultureInfo.InvariantCulture)).ToArray();

            Start = new Vector3d(pos[0], pos[1], pos[2]);
            var nrm = item.Attribute("end").Value.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries).Select(z => double.Parse(z.Replace(",", "."), CultureInfo.InvariantCulture)).ToArray();

            End = new Vector3d(nrm[0], nrm[1], nrm[2]);
            if (item.Attribute("drawSize") != null)
            {
                DrawSize = StaticHelpers.ParseFloat(item.Attribute("drawSize").Value);
            }
        }