namespace R2C2 {
+TrackAppearance::TrackAppearance():
+ gauge(1.524),
+ tie_length(0),
+ tie_spacing(1)
+{ }
+
float TrackAppearance::get_rail_elevation() const
{
return ballast_profile.get_height()+rail_profile.get_height();
ObjectLoader<TrackAppearance>(a)
{
add("ballast_profile", &Loader::ballast_profile);
+ add("gauge", &Loader::gauge);
add("rail_profile", &Loader::rail_profile);
add("technique", &TrackAppearance::technique);
+ add("tie_length", &Loader::tie_length);
+ add("tie_profile", &Loader::tie_profile);
+ add("tie_spacing", &Loader::tie_spacing);
}
void TrackAppearance::Loader::ballast_profile()
load_sub(obj.ballast_profile);
}
+void TrackAppearance::Loader::gauge(float g)
+{
+ obj.gauge = g/1000;
+}
+
void TrackAppearance::Loader::rail_profile()
{
load_sub(obj.rail_profile);
}
+void TrackAppearance::Loader::tie_length(float l)
+{
+ obj.tie_length = l/1000;
+}
+
+void TrackAppearance::Loader::tie_profile()
+{
+ load_sub(obj.tie_profile);
+}
+
+void TrackAppearance::Loader::tie_spacing(float s)
+{
+ obj.tie_spacing = s/1000;
+}
+
} // namespace R2C2