#include "beamgate.h"
-#include "catalogue.h"
#include "layout.h"
using namespace std;
{
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;
void BeamGate::update_attachment()
{
- attach_to_closest(100*layout.get_catalogue().get_gauge());
+ attach_to_closest(100);
if(track)
{
- TrackPoint tp = track.point();
- position = tp.pos;
- rotation = tp.dir;
+ OrientedPoint p = track.point();
+ position = p.position;
+ rotation = p.rotation;
+ tilt = p.tilt;
}
}