]> git.tdb.fi Git - r2c2.git/blob - source/libr2c2/trackattachment.h
Further improve lead route generation
[r2c2.git] / source / libr2c2 / trackattachment.h
1 #ifndef LIBR2C2_TRACKATTACHMENT_H_
2 #define LIBR2C2_TRACKATTACHMENT_H_
3
4 #include "object.h"
5 #include "track.h"
6 #include "trackoffsetiter.h"
7
8 namespace R2C2 {
9
10 class TrackAttachment: public Object, public sigc::trackable
11 {
12 protected:
13         TrackOffsetIter track;
14
15         TrackAttachment(Layout &);
16 public:
17         virtual ~TrackAttachment();
18
19         const TrackOffsetIter &get_track_iter() const { return track; }
20         Track *get_track() const { return track.track(); }
21         unsigned get_entry() const { return track.entry(); }
22         float get_offset() const { return track.offset(); }
23         float get_offset_from_endpoint(unsigned) const;
24 protected:
25         void attach_to(const TrackOffsetIter &);
26         void attach_to_closest(float);
27         float find_offset(const TrackIter &, const Vector &);
28
29 public:
30         virtual Track *get_parent() const { return track.track(); }
31
32 private:
33         void object_removed(Object &);
34 };
35
36 } // namespace R2C2
37
38 #endif