]> git.tdb.fi Git - r2c2.git/blobdiff - source/libr2c2/beamgate.cpp
Move gauge to TrackAppearance
[r2c2.git] / source / libr2c2 / beamgate.cpp
index ad559120f491c22a45d4c6337bbdce2aab639912..20a218b22e22a7926b52f20bf4b067d0aa5f51a5 100644 (file)
@@ -13,17 +13,17 @@ BeamGate::BeamGate(Layout &l):
 {
        invert = true;
 
-       layout.add(*this);
+       TrackAttachment::layout.add(*this);
 }
 
 BeamGate::~BeamGate()
 {
-       layout.remove(*this);
+       TrackAttachment::layout.remove(*this);
 }
 
 BeamGate *BeamGate::clone(Layout *to_layout) const
 {
-       BeamGate *gate = new BeamGate(to_layout ? *to_layout : layout);
+       BeamGate *gate = new BeamGate(to_layout ? *to_layout : TrackAttachment::layout);
        gate->set_position(position);
        gate->set_rotation(rotation);
        return gate;
@@ -50,13 +50,14 @@ void BeamGate::set_rotation(const Angle &r)
 
 void BeamGate::update_attachment()
 {
-       attach_to_closest(100*layout.get_catalogue().get_gauge());
+       attach_to_closest(100);
 
        if(track)
        {
                OrientedPoint p = track.point();
                position = p.position;
                rotation = p.rotation;
+               tilt = p.tilt;
        }
 }