private static AbLine LoadAbLinePattern(XmlNode inputNode, XmlNode lineNode) { var pattern = new AbLine { GuidancePatternType = GuidancePatternTypeEnum.AbLine }; var pointNodes = lineNode.SelectNodes("PNT"); if (pointNodes.Count != 2) { return(null); } var aPointNode = pointNodes[0]; var bPointNode = pointNodes[1]; pattern.A = ShapeLoader.LoadPoint(aPointNode); pattern.B = ShapeLoader.LoadPoint(bPointNode); if (pattern.A == null || pattern.B == null) { return(null); } pattern.Heading = GetHeading(inputNode.GetXmlNodeValue("@G")); return(pattern); }
private static APlus LoadAPlusPattern(XmlNode inputNode, XmlNode lineNode) { var pattern = new APlus { GuidancePatternType = GuidancePatternTypeEnum.APlus }; var pointNodes = lineNode.SelectNodes("PNT"); if (pointNodes.Count != 1) { return(null); } var aPointNode = pointNodes[0]; pattern.Point = ShapeLoader.LoadPoint(aPointNode); if (pattern.Point == null) { return(null); } pattern.Heading = GetHeading(inputNode.GetXmlNodeValue("@G")); return(pattern); }
private static CenterPivot LoadCenterPivotPattern(XmlNode lineNode) { var pattern = new CenterPivot { GuidancePatternType = GuidancePatternTypeEnum.CenterPivot }; var pointNodes = lineNode.SelectNodes("PNT"); if (pointNodes.Count < 1 || pointNodes.Count > 3) { return(null); } pattern.Center = ShapeLoader.LoadPoint(pointNodes[0]); if (pattern.Center == null) { return(null); } pattern.StartPoint = pointNodes.Count > 1 ? ShapeLoader.LoadPoint(pointNodes[1]) : null; pattern.EndPoint = pointNodes.Count > 2 ? ShapeLoader.LoadPoint(pointNodes[2]) : null; return(pattern); }