1 #ifndef RAREFACTIONCURVEDATA_H
2 #define RAREFACTIONCURVEDATA_H
5 #include "sabundvector.hpp"
7 #include "observable.h"
11 /***********************************************************************/
13 class RarefactionCurveData : public Observable {
16 RarefactionCurveData() : rank(0) {};
18 void registerDisplay(Display* o) { displays.insert(o); };
19 void removeDisplay(Display* o) { displays.erase(o); delete o; };
20 SAbundVector* getRankData() { return rank; };
21 void rankDataChanged() { notifyDisplays(); };
22 void updateRankData(SAbundVector* rv) { rank = rv; rankDataChanged(); };
24 void notifyDisplays(){
25 for(set<Display*>::iterator pos=displays.begin();pos!=displays.end();pos++){
31 set<Display*> displays;
36 /***********************************************************************/
38 class SharedRarefactionCurveData : public Observable {
41 SharedRarefactionCurveData() : 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(SharedRAbundVector* rv, SharedRAbundVector* rv2, int numSeqs, int numGroupComb) { shared1 = rv; shared2 = rv2; NumSeqs = numSeqs; NumGroupComb = numGroupComb; SharedDataChanged(); };
48 void notifyDisplays(){
49 for(set<Display*>::iterator pos=displays.begin();pos!=displays.end();pos++){
50 (*pos)->update(shared1, shared2, NumSeqs, NumGroupComb);
55 set<Display*> displays;
56 SharedRAbundVector* shared1;
57 SharedRAbundVector* shared2;
58 int NumSeqs, NumGroupComb;
62 /***********************************************************************/