]> git.tdb.fi Git - r2c2.git/commitdiff
Make new and erase work on objects rather than just tracks
authorMikko Rasa <tdb@tdb.fi>
Tue, 19 Nov 2013 13:59:06 +0000 (15:59 +0200)
committerMikko Rasa <tdb@tdb.fi>
Tue, 19 Nov 2013 13:59:06 +0000 (15:59 +0200)
source/designer/designer.cpp
source/designer/designer.h
source/designer/trackbar.cpp

index 6706db6f4856755ab4a1e3a72e0140412a488c48..88bdf8b75253f958e4493489f978cb3c5eda67b7 100644 (file)
@@ -189,21 +189,21 @@ void Designer::quit()
        exit(0);
 }
 
-void Designer::new_track()
+void Designer::new_object()
 {
        use_select_tool();
 
        mode = CATALOGUE;
-       lbl_status->set_text("Select new track or press Esc to cancel");
+       lbl_status->set_text("Select new object or press Esc to cancel");
 }
 
-void Designer::erase_tracks()
+void Designer::erase_objects()
 {
        use_select_tool();
 
-       set<Track *> tracks = selection.get_objects<Track>();
+       set<Object *> objects = selection.get_objects();
        selection.clear();
-       for(set<Track *>::iterator i=tracks.begin(); i!=tracks.end(); ++i)
+       for(set<Object *>::iterator i=objects.begin(); i!=objects.end(); ++i)
        {
                overlay->clear(layout_3d->get_3d(**i));
                delete *i;
@@ -360,7 +360,7 @@ void Designer::key_press(unsigned key)
        if(key==Msp::Input::KEY_N && shift)
                use_tool_with_selected_objects<ExtendTool>();
        else if(key==Msp::Input::KEY_N)
-               new_track();
+               new_object();
        else if(key==Msp::Input::KEY_G)
                use_tool_with_selected_objects<MoveTool>();
        else if(key==Msp::Input::KEY_R)
@@ -393,7 +393,7 @@ void Designer::key_press(unsigned key)
                        use_select_tool();
        }
        else if(key==Msp::Input::KEY_X)
-               erase_tracks();
+               erase_objects();
        else if(key==Msp::Input::KEY_F && shift)
        {
                const set<Track *> &tracks = selection.get_objects<Track>();
index dcaa1463d372eb091f67dc1c3634c48173693286..2c25085ddb85201b75c8d57535a2b3bb60de7f24 100644 (file)
@@ -84,8 +84,8 @@ public:
        const R2C2::View3D &get_view() const { return *main_view; }
        const CameraController &get_camera_controller() const { return *camera_ctl; }
 
-       void new_track();
-       void erase_tracks();
+       void new_object();
+       void erase_objects();
        void track_properties();
        void extend_track();
        void connect_tracks();
index 72ac49a6d1f8a4787b3c1b85668af99438a742ed..4a797348c72a58e6133db74eef52d2178607fab5 100644 (file)
@@ -11,12 +11,12 @@ Trackbar::Trackbar(Designer &designer):
        pnl_content->add(*(btn = new GLtk::Button("New")));
        btn->set_style("green");
        btn->set_tooltip("Add a track piece (N)");
-       btn->signal_clicked.connect(sigc::mem_fun(&designer, &Designer::new_track));
+       btn->signal_clicked.connect(sigc::mem_fun(&designer, &Designer::new_object));
 
        pnl_content->add(*(btn = new GLtk::Button("Del")));
        btn->set_style("red");
        btn->set_tooltip("Delete selected tracks (X)");
-       btn->signal_clicked.connect(sigc::mem_fun(&designer, &Designer::erase_tracks));
+       btn->signal_clicked.connect(sigc::mem_fun(&designer, &Designer::erase_objects));
 
        pnl_content->add(*(btn = new GLtk::Button("Prop")));
        btn->set_tooltip("Change properties of selected tracks (P)");