]> git.tdb.fi Git - r2c2.git/blobdiff - source/libr2c2/trackappearance.cpp
Render ties between rails on tracks
[r2c2.git] / source / libr2c2 / trackappearance.cpp
index b97d69668a3ecd9e61a6f2d4907c11a55db281b4..b5d8b354082c7d5b022bdd99dbb16428fa91d327 100644 (file)
@@ -5,6 +5,11 @@ using namespace Msp;
 
 namespace R2C2 {
 
+TrackAppearance::TrackAppearance():
+       tie_length(0),
+       tie_spacing(1)
+{ }
+
 float TrackAppearance::get_rail_elevation() const
 {
        return ballast_profile.get_height()+rail_profile.get_height();
@@ -17,6 +22,9 @@ TrackAppearance::Loader::Loader(TrackAppearance &a):
        add("ballast_profile", &Loader::ballast_profile);
        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()
@@ -29,4 +37,19 @@ 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