]> git.tdb.fi Git - r2c2.git/blobdiff - source/libr2c2/tracktype.cpp
Support multiple TrackAppearances in Catalogue
[r2c2.git] / source / libr2c2 / tracktype.cpp
index c2740f1d39b33ccfe10f819863ea26da220544f8..6b16c553809dc7941a9523aac7889ee34f8a4f34 100644 (file)
@@ -1,4 +1,5 @@
 #include <cmath>
+#include <msp/datafile/collection.h>
 #include <msp/geometry/union.h>
 #include "trackappearance.h"
 #include "tracktype.h"
@@ -8,9 +9,9 @@ using namespace Msp;
 
 namespace R2C2 {
 
-TrackType::TrackType(const ArticleNumber &an, const TrackAppearance *ta):
+TrackType::TrackType(const ArticleNumber &an):
        ObjectType(an),
-       appearance(ta),
+       appearance(0),
        state_bits(0),
        autofit_preference(1)
 { }
@@ -221,10 +222,12 @@ TrackType::Endpoint::Endpoint(float x, float y, const Angle &d, unsigned p):
 { }
 
 
-TrackType::Loader::Loader(TrackType &t):
+TrackType::Loader::Loader(TrackType &t, Collection &c):
        DataFile::DerivedObjectLoader<TrackType, ObjectType::Loader>(t),
+       coll(c),
        state_bits_set(false)
 {
+       add("appearance",  &TrackType::appearance);
        add("autofit_preference", &TrackType::autofit_preference);
        add("object",      &TrackType::object);
        add("state_bits",  &Loader::state_bits);