Пример #1
0
		internal override void ParseXml(XmlElement xml)
		{
			base.ParseXml(xml);
			string startDistAlong = xml.GetAttribute("StartDistAlong");
			if (!string.IsNullOrEmpty(startDistAlong))
				double.TryParse(startDistAlong, out mStartDistAlong);
			foreach (XmlNode child in xml.ChildNodes)
			{
				string name = child.Name;
				if (string.Compare(name, "Segments") == 0)
				{
					foreach (XmlNode cn in child.ChildNodes)
					{
						IfcAlignmentHorizontalSegment s = mDatabase.ParseXml<IfcAlignmentHorizontalSegment>(cn as XmlElement);
						if (s != null)
							Segments.Add(s);
					}
				}
			}
		}
Пример #2
0
        internal override Plane computePlaneAtLength(double length, double tol)
        {
            double distAlong = 0;
            List <IfcAlignmentHorizontalSegment> segments = HorizontalSegments.ToList();

            for (int icounter = 0; icounter < segments.Count; icounter++)
            {
                IfcAlignmentHorizontalSegment segment = segments[icounter];
                if (distAlong + segment.SegmentLength + tol > length)
                {
                    Plane plane = segment.PlaneAtLength(length - distAlong, tol);
                    if (plane.IsValid)
                    {
                        return(plane);
                    }

                    return(Plane.Unset);
                }
                distAlong += segment.SegmentLength;
            }
            return(Plane.Unset);
        }