1 #ifndef COLLECTORSCURVEDATA_H
2 #define COLLECTORSCURVEDATA_H
5 #include "sabundvector.hpp"
6 #include "sharedrabundvector.h"
8 #include "observable.h"
12 /***********************************************************************/
14 class CollectorsCurveData : public Observable {
17 CollectorsCurveData() : rank(0) {};
19 void registerDisplay(Display* o) { displays.insert(o); };
20 void removeDisplay(Display* o) { displays.erase(o); delete o; };
21 SAbundVector* getRankData() { return rank; };
22 void rankDataChanged() { notifyDisplays(); };
23 void updateRankData(SAbundVector* rv) { rank = rv; rankDataChanged(); };
25 void notifyDisplays(){
26 for(set<Display*>::iterator pos=displays.begin();pos!=displays.end();pos++){
32 set<Display*> displays;
37 /***********************************************************************/
40 class SharedCollectorsCurveData : public Observable {
43 SharedCollectorsCurveData() { }; //: shared1(0), shared2(0)
45 void registerDisplay(Display* o) { displays.insert(o); };
46 void removeDisplay(Display* o) { displays.erase(o); delete o; };
47 void SharedDataChanged() { notifyDisplays(); };
48 void updateSharedData(vector<SharedRAbundVector*> s, int numSeqs, int numGroupComb) { shared = s; NumSeqs = numSeqs; NumGroupComb = numGroupComb; SharedDataChanged(); };
50 void notifyDisplays(){
51 for(set<Display*>::iterator pos=displays.begin();pos!=displays.end();pos++){
52 if ( ((*pos)->isCalcMultiple() == true) || ( ((*pos)->isCalcMultiple() == false) && (shared.size() == 2) ) ) {
53 (*pos)->update(shared, NumSeqs, NumGroupComb);
59 set<Display*> displays;
60 vector<Display*> multiDisplays;
61 vector<SharedRAbundVector*> shared;
62 int NumSeqs, NumGroupComb;
65 /***********************************************************************/