1 #ifndef COLLECTORSCURVEDATA_H
2 #define COLLECTORSCURVEDATA_H
4 #include "sabundvector.hpp"
5 #include "sharedrabundvector.h"
7 #include "observable.h"
10 /***********************************************************************/
12 class CollectorsCurveData : public Observable {
15 CollectorsCurveData() : rank(0) {};
17 void registerDisplay(Display* o) { displays.insert(o); };
18 void removeDisplay(Display* o) { displays.erase(o); delete o; };
19 SAbundVector* getRankData() { return rank; };
20 void rankDataChanged() { notifyDisplays(); };
21 void updateRankData(SAbundVector* rv) { rank = rv; rankDataChanged(); };
23 void notifyDisplays(){
24 for(set<Display*>::iterator pos=displays.begin();pos!=displays.end();pos++){
30 set<Display*> displays;
35 /***********************************************************************/
38 class SharedCollectorsCurveData : public Observable {
41 SharedCollectorsCurveData() { }; //: shared1(0), shared2(0)
43 void registerDisplay(Display* o) { displays.insert(o); };
44 void removeDisplay(Display* o) { displays.erase(o); delete o; };
45 void SharedDataChanged() { notifyDisplays(); };
46 void updateSharedData(vector<SharedRAbundVector*> s, int numSeqs, int numGroupComb) { shared = s; NumSeqs = numSeqs; NumGroupComb = numGroupComb; SharedDataChanged(); };
48 void notifyDisplays(){
49 for(set<Display*>::iterator pos=displays.begin();pos!=displays.end();pos++){
50 if ( ((*pos)->isCalcMultiple() == true) || ( ((*pos)->isCalcMultiple() == false) && (shared.size() == 2) ) ) {
51 (*pos)->update(shared, NumSeqs, NumGroupComb);
57 set<Display*> displays;
58 vector<Display*> multiDisplays;
59 vector<SharedRAbundVector*> shared;
60 int NumSeqs, NumGroupComb;
63 /***********************************************************************/