}
}
+Track *Layout::pick_track(const Vector &start, const Vector &ray)
+{
+ for(set<Track *>::iterator i=tracks.begin(); i!=tracks.end(); ++i)
+ if((*i)->collide_ray(start, ray))
+ return *i;
+
+ return 0;
+}
+
void Layout::remove_track(Track &t)
{
if(tracks.erase(&t))
}
}
-void Layout::add_signal(Signal &s)
-{
- if(signals.insert(&s).second)
- signal_signal_added.emit(s);
-}
-
-void Layout::remove_signal(Signal &s)
-{
- if(signals.erase(&s))
- signal_signal_removed.emit(s);
-}
-
-Track *Layout::pick_track(const Vector &start, const Vector &ray)
-{
- for(set<Track *>::iterator i=tracks.begin(); i!=tracks.end(); ++i)
- if((*i)->collide_ray(start, ray))
- return *i;
-
- return 0;
-}
-
unsigned Layout::allocate_turnout_id()
{
set<unsigned> used_ids;
return result;
}
+void Layout::add_signal(Signal &s)
+{
+ if(signals.insert(&s).second)
+ signal_signal_added.emit(s);
+}
+
+void Layout::remove_signal(Signal &s)
+{
+ if(signals.erase(&s))
+ signal_signal_removed.emit(s);
+}
+
void Layout::add_block(Block &b)
{
blocks.insert(&b);