X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=collectorscurvedata.h;h=d32a9e06480c72e5a00e5eaac5a123f407d759c0;hp=e6f62785e221e1321aa21305f0c1b142e4e460e0;hb=b206f634aae1b4ce13978d203247fb64757d5482;hpb=20a2d0350a737a434c89f303662d64a8eeea7b05 diff --git a/collectorscurvedata.h b/collectorscurvedata.h index e6f6278..d32a9e0 100644 --- a/collectorscurvedata.h +++ b/collectorscurvedata.h @@ -1,13 +1,11 @@ #ifndef COLLECTORSCURVEDATA_H #define COLLECTORSCURVEDATA_H -#include #include "sabundvector.hpp" -#include "sharedRAbundvector.h" +#include "sharedrabundvector.h" #include "display.h" #include "observable.h" -using namespace std; /***********************************************************************/ @@ -40,24 +38,38 @@ private: class SharedCollectorsCurveData : public Observable { public: - SharedCollectorsCurveData() : shared1(0), shared2(0) {}; + SharedCollectorsCurveData() { }; //: shared1(0), shared2(0) - void registerDisplay(Display* o) { displays.insert(o); }; + void registerDisplay(Display* o) { displays.insert(o); }; void removeDisplay(Display* o) { displays.erase(o); delete o; }; - void SharedDataChanged() { notifyDisplays(); }; - void updateSharedData(SharedRAbundVector* rv, SharedRAbundVector* rv2, int numSeqs, int numGroupComb) { shared1 = rv; shared2 = rv2; NumSeqs = numSeqs; NumGroupComb = numGroupComb; SharedDataChanged(); }; - + void SharedDataChanged() { notifyDisplays(); }; + void updateSharedData(vector s, int numSeqs, int numGroupComb, bool p) { pairs = p; shared = s; NumSeqs = numSeqs; NumGroupComb = numGroupComb; SharedDataChanged(); }; + void notifyDisplays(){ for(set::iterator pos=displays.begin();pos!=displays.end();pos++){ - (*pos)->update(shared1, shared2, NumSeqs, NumGroupComb); + + if ((*pos)->calcNeedsAll() == true) { + (*pos)->update(shared, NumSeqs, NumGroupComb); + }else{ + + if ( ((*pos)->isCalcMultiple() == true) && ((*pos)->getAll() == true) && (!pairs) ) { + (*pos)->update(shared, NumSeqs, NumGroupComb); + }else { + vector temp; temp.push_back(shared[0]); temp.push_back(shared[1]); + shared = temp; + + (*pos)->update(shared, NumSeqs, NumGroupComb); + } + } } }; private: set displays; - SharedRAbundVector* shared1; - SharedRAbundVector* shared2; + vector multiDisplays; + vector shared; int NumSeqs, NumGroupComb; + bool pairs; }; /***********************************************************************/