X-Git-Url: http://woldlab.caltech.edu/gitweb/?a=blobdiff_plain;f=qui%2Fmotif_editor%2FMotifModel.cpp;h=0785721f1f74ea74b89aca3abe4a3e38061ac43d;hb=a55b0297c987f8885a255527a0599f813e3bb8dc;hp=81bd954c5fc02a42cd2b4407c18761588a615976;hpb=9526360687d8a092ad5583d8c7de789b5bf0ba9b;p=mussa.git diff --git a/qui/motif_editor/MotifModel.cpp b/qui/motif_editor/MotifModel.cpp index 81bd954..0785721 100644 --- a/qui/motif_editor/MotifModel.cpp +++ b/qui/motif_editor/MotifModel.cpp @@ -3,24 +3,26 @@ #include MotifModel::MotifModel(MussaRef m, QObject *parent) - : QAbstractTableModel(parent) + : analysis(m), + QAbstractTableModel(parent) { const std::set& motif_set = m->motifs(); boost::shared_ptr cm = m->colorMapper(); - if (motif_set.size() == 0) { - push_empty(); - } else { - std::set::const_iterator motif_i; - for(motif_i = motif_set.begin(); - motif_i != motif_set.end(); - ++motif_i) - { - // ideally we'd know what the motif color was? - MotifElement new_element(*motif_i, cm->lookup("motif", motif_i->get_sequence())); - push_back(new_element); - } + std::set::const_iterator motif_i; + for(motif_i = motif_set.begin(); + motif_i != motif_set.end(); + ++motif_i) + { + // ideally we'd know what the motif color was? + MotifElement new_element(*motif_i, cm->lookup("motif", motif_i->get_sequence())); + push_back(new_element); } + push_empty(); +} + +const MussaRef MotifModel::getAnalysis() const { + return analysis; } void MotifModel::assign(