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(SharedRAbundVector* rv, SharedRAbundVector* rv2, int numSeqs, int numGroupComb) { shared1 = rv; shared2 = rv2; NumSeqs = numSeqs; NumGroupComb = numGroupComb; SharedDataChanged(); };
50 void notifyDisplays(){
51 for(set<Display*>::iterator pos=displays.begin();pos!=displays.end();pos++){
52 (*pos)->update(shared1, shared2, NumSeqs, NumGroupComb);
57 set<Display*> displays;
58 SharedRAbundVector* shared1;
59 SharedRAbundVector* shared2;
60 int NumSeqs, NumGroupComb;
63 /***********************************************************************/