layout = new Layout(catalogue);
layout_3d = new Layout3D(*layout);
+ layout->signal_track_added.connect(sigc::mem_fun(this, &Designer::track_added));
+
if(argc>1)
{
filename = argv[1];
pipeline->set_camera(&camera);
pipeline->add_renderable_for_pass(layout_3d->get_scene(), 0);
if(base_object)
- pipeline->add_renderable_for_pass(*base_object, 0);
+ pipeline->add_renderable(*base_object);
pipeline->add_renderable_for_pass(track_wrap, "unlit");
pipeline->add_renderable_for_pass(layout_3d->get_path_scene(), "unlit");
pipeline->add_renderable_for_pass(layout_3d->get_endpoint_scene(), "unlit");
pass->depth_test = &GL::DepthTest::lequal();
pass->blend = &GL::Blend::alpha();
+ pass = &pipeline->add_pass("blended");
+ pass->lighting = &lighting;
+ pass->depth_test = &GL::DepthTest::lequal();
+ pass->blend = &GL::Blend::alpha();
+
camera.set_up_direction(GL::Vector3(0, 0, 1));
view_all();
const list<Track3D *> &tracks = layout_3d->get_tracks();
for(list<Track3D *>::const_iterator i=tracks.begin(); i!=tracks.end(); ++i)
update_track_icon(**i);
-
- edit_route(0);
}
Designer::~Designer()
}
catch(const Exception &e)
{
- IO::print("%s\n", e.what());
+ lbl_status->set_text(e.what());
}
show_route(cur_route);
float dt = (t-last_tick)/Msp::Time::sec;
last_tick = t;
+ for(list<Track *>::iterator i=new_tracks.begin(); i!=new_tracks.end(); ++i)
+ layout_3d->get_track(**i).get_path().set_mask(0);
+ new_tracks.clear();
+
window.get_display().tick();
root->tick();
camera_ctl.tick(dt);
GL::Texture::unbind();
}
+void Designer::track_added(Track &trk)
+{
+ new_tracks.push_back(&trk);
+}
+
Track3D *Designer::pick_track(int x, int y)
{
Layout3D *l = layout_3d;
Marklin::Overlay3D *overlay;
Msp::GL::Object *base_object;
Marklin::Route *cur_route;
+ std::list<Marklin::Track *> new_tracks;
Msp::GL::Pipeline *pipeline;
Msp::GL::Camera camera;
Msp::GL::Lighting lighting;
void pointer_motion(int, int);
void apply_camera();
void render();
+ void track_added(Marklin::Track &);
Marklin::Track3D *pick_track(int, int);
void update_track_icon(Marklin::Track3D &);
void selection_changed();