-/* $Id$
-
-This file is part of the MSP Märklin suite
-Copyright © 2006-2008 Mikkosoft Productions, Mikko Rasa
-Distributed under the GPL
-*/
-
#include <algorithm>
+#include "libr2c2/block.h"
#include "selection.h"
using namespace std;
-using namespace Marklin;
+using namespace R2C2;
using namespace Msp;
Track *Selection::get_track() const
if(changed)
signal_changed.emit();
}
+
+void Selection::select_blocks()
+{
+ bool changed = false;
+ for(set<Track *>::iterator i=tracks.begin(); i!=tracks.end(); ++i)
+ {
+ const set<Track *> &btracks = (*i)->get_block().get_tracks();
+ for(set<Track *>::iterator j=btracks.begin(); j!=btracks.end(); ++j)
+ if(!tracks.count(*j))
+ {
+ tracks.insert(*j);
+ changed = true;
+ }
+ }
+
+ if(changed)
+ signal_changed.emit();
+}