]> git.donarmstrong.com Git - mothur.git/blobdiff - collectorscurvedata.h
added fasta, qfile, trim, accnos and sfftxt parameter to sffinfo command. added...
[mothur.git] / collectorscurvedata.h
index af81c39269b46aa69cf4083f22807e0815fdb449..bde016a62c1c6adbbcc88bfec758530a0840e52d 100644 (file)
@@ -1,13 +1,11 @@
 #ifndef COLLECTORSCURVEDATA_H
 #define COLLECTORSCURVEDATA_H
 
-#include "mothur.h"
 #include "sabundvector.hpp"
 #include "sharedrabundvector.h"
 #include "display.h"
 #include "observable.h"
 
-using namespace std;
 
 /***********************************************************************/
 
@@ -40,23 +38,26 @@ 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<SharedRAbundVector*> s, int numSeqs, int numGroupComb)     {       shared = s; NumSeqs = numSeqs; NumGroupComb = numGroupComb; SharedDataChanged();        };
+       
        void notifyDisplays(){  
                for(set<Display*>::iterator pos=displays.begin();pos!=displays.end();pos++){
-                       (*pos)->update(shared1, shared2, NumSeqs, NumGroupComb);
+//cout << (*pos)->getName() << endl;
+                       if ( ( ((*pos)->isCalcMultiple() == true) && ((*pos)->getAll() == true) ) || (shared.size() == 2)  ) {
+                               (*pos)->update(shared, NumSeqs, NumGroupComb);
+                       }
                }       
        };
        
 private:
        set<Display*> displays;
-       SharedRAbundVector* shared1;
-       SharedRAbundVector* shared2;
+       vector<Display*> multiDisplays;
+       vector<SharedRAbundVector*> shared;
        int NumSeqs, NumGroupComb;
 };