X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Fbeamgate.cpp;h=20a218b22e22a7926b52f20bf4b067d0aa5f51a5;hb=5929b101ee38b5668b328e7b1eac4bf49c912412;hp=550c97c4ca457ace5deed6f5c9fdec7ae8fe8562;hpb=c4daf1cc6b53cae34e46d4125a993ceed500de1a;p=r2c2.git diff --git a/source/libr2c2/beamgate.cpp b/source/libr2c2/beamgate.cpp index 550c97c..20a218b 100644 --- a/source/libr2c2/beamgate.cpp +++ b/source/libr2c2/beamgate.cpp @@ -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; @@ -34,11 +34,6 @@ const BeamGateType &BeamGate::get_type() const return BeamGateType::instance(); } -void BeamGate::set_address(unsigned a) -{ - address = a; -} - void BeamGate::set_position(const Vector &p) { position = p; @@ -55,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) { - TrackPoint tp = track->get_point(track.entry(), offset); - position = tp.pos; - rotation = tp.dir; + OrientedPoint p = track.point(); + position = p.position; + rotation = p.rotation; + tilt = p.tilt; } }