void quit();
const Marklin::Catalogue &get_catalogue() const { return catalogue; }
- Marklin::Layout *get_layout() { return layout; }
- Marklin::Layout3D *get_layout_3d() { return layout_3d; }
+ Marklin::Layout &get_layout() { return *layout; }
+ Marklin::Layout3D &get_layout_3d() { return *layout_3d; }
const Msp::GL::Camera &get_camera() const { return camera; }
const Msp::GLtk::Resources &get_ui_resources() const { return ui_res; }
Msp::GLtk::Root &get_root() const { return *root; }
list<Track *> new_tracks;
for(vector<MTrack>::iterator i=tracks.begin(); i!=tracks.end(); ++i)
{
- Track *track = new Track(*designer.get_layout(), i->track->get_type());
+ Track *track = new Track(designer.get_layout(), i->track->get_type());
track->set_position(i->track->get_position());
track->set_rotation(i->track->get_rotation());
new_tracks.push_back(track);
if(j==types_by_length.end())
throw LogicError("Internal error");
- Track *track = new Track(*designer.get_layout(), *j->second);
+ Track *track = new Track(designer.get_layout(), *j->second);
track->set_position(pos1);
track->set_rotation(dir1);
for(vector<MTrack>::iterator j=tracks.begin(); j!=tracks.end(); ++j)
j->track->break_link(**i);
- const set<Track *> <racks = designer.get_layout()->get_tracks();
+ const set<Track *> <racks = designer.get_layout().get_tracks();
for(set<Track *>::const_iterator i=ltracks.begin(); i!=ltracks.end(); ++i)
{
bool ok = true;
i->track->set_rotation(i->rot);
}
- const set<Track *> <racks = designer.get_layout()->get_tracks();
+ const set<Track *> <racks = designer.get_layout().get_tracks();
MTrack *snapped = 0;
for(set<Track *>::const_iterator i=ltracks.begin(); (i!=ltracks.end() && !snapped); ++i)
{
void Measure::snap_to_tracks(Point &pt, float &dir)
{
- const set<Track *> <racks = designer.get_layout()->get_tracks();
+ const set<Track *> <racks = designer.get_layout().get_tracks();
for(set<Track *>::const_iterator i=ltracks.begin(); i!=ltracks.end(); ++i)
if((*i)->snap(pt, dir))
return;
btn->set_tooltip("Add selected tracks to current route");
btn->signal_clicked.connect(sigc::mem_fun(&designer, &Designer::add_selection_to_route));
- designer.get_layout()->signal_route_added.connect(sigc::mem_fun(this, &Toolbar::route_added));
- designer.get_layout()->signal_route_removed.connect(sigc::hide(sigc::mem_fun(this, &Toolbar::update_routes)));
+ designer.get_layout().signal_route_added.connect(sigc::mem_fun(this, &Toolbar::route_added));
+ designer.get_layout().signal_route_removed.connect(sigc::hide(sigc::mem_fun(this, &Toolbar::update_routes)));
- const set<Route *> &routes = designer.get_layout()->get_routes();
+ const set<Route *> &routes = designer.get_layout().get_routes();
for(set<Route *>::const_iterator i=routes.begin(); i!=routes.end(); ++i)
(*i)->signal_name_changed.connect(sigc::hide(sigc::mem_fun(this, &Toolbar::update_routes)));
{
if(index==drp_routes->get_n_items()-1)
{
- Layout &layout = *designer.get_layout();
- const set<Route *> &routes = designer.get_layout()->get_routes();
+ Layout &layout = designer.get_layout();
+ const set<Route *> &routes = layout.get_routes();
Route *route = new Route(layout);
route->set_name(format("Route %d", routes.size()));
designer.edit_route(route);
}
else
{
- const set<Route *> &routes = designer.get_layout()->get_routes();
+ const set<Route *> &routes = designer.get_layout().get_routes();
set<Route *>::const_iterator i = routes.begin();
advance(i, index);
designer.edit_route(*i);
void Toolbar::update_routes()
{
drp_routes->clear();
- const set<Route *> &routes = designer.get_layout()->get_routes();
+ const set<Route *> &routes = designer.get_layout().get_routes();
int selected = -1;
unsigned n = 0;
for(set<Route *>::const_iterator i=routes.begin(); i!=routes.end(); ++i, ++n)
if(j!=meshes.end())
return *j->second;
- const TrackType3D &type3d = designer.get_layout_3d()->get_catalogue().get_track(type);
+ const TrackType3D &type3d = designer.get_layout_3d().get_catalogue().get_track(type);
float min_area = -1;
float angle;