67 lines
1.9 KiB
C#
67 lines
1.9 KiB
C#
using System.Xml.Serialization;
|
|
|
|
namespace ShrlAlgoToolkit.RevitAddins.RvIndependent.MetroGauges.LandXMLData
|
|
{
|
|
[XmlType("Roadway")]
|
|
[Serializable]
|
|
public class Roadway
|
|
{
|
|
public Roadway()
|
|
{
|
|
Speeds = new List<DesignSpeed>();
|
|
}
|
|
|
|
[XmlAttribute("staStart")]
|
|
public double StationStart { get; set; }
|
|
|
|
[XmlAttribute("staEnd")]
|
|
public double StationEnd { get; set; }
|
|
|
|
[XmlArray("Speeds")]
|
|
public List<DesignSpeed> Speeds { get; set; }
|
|
|
|
[XmlIgnore]
|
|
public Model LandXml { get; internal set; }
|
|
|
|
[XmlAttribute("CorridorID")]
|
|
public string CorridorID { get; set; }
|
|
|
|
[XmlAttribute("name")]
|
|
public string Name { get; set; }
|
|
|
|
[XmlAttribute("description")]
|
|
public string Description { get; set; }
|
|
|
|
[XmlAttribute("surfaceRefs")]
|
|
public string SurfaceRefs { get; set; }
|
|
|
|
[XmlAttribute("alignmentRefs")]
|
|
public string AlignmentRefs { get; set; }
|
|
|
|
[XmlAttribute("aIDs")]
|
|
public string AlignmentIDs { get; set; }
|
|
|
|
public void AddAlignment(Alignment alignment)
|
|
{
|
|
AlignmentIDs += alignment.Id;
|
|
AlignmentRefs = AlignmentRefs + (string.IsNullOrWhiteSpace(AlignmentRefs) ? string.Empty : " ") + alignment.Name;
|
|
alignment.Roadway = this;
|
|
}
|
|
|
|
public void ConnectAlignments()
|
|
{
|
|
foreach (Alignment alignment in LandXml.Alignments)
|
|
{
|
|
alignment.Roadway = this;
|
|
}
|
|
}
|
|
|
|
public void RemoveAlignment(Alignment alignment)
|
|
{
|
|
AlignmentIDs.Replace(alignment.Id, string.Empty);
|
|
AlignmentRefs.Replace(AlignmentRefs.StartsWith(alignment.Name) ? alignment.Name : " " + alignment.Name, string.Empty);
|
|
alignment.Roadway = null;
|
|
}
|
|
}
|
|
}
|