00001 // Copyright 2007, Massachusetts Institute of Technology. 00002 // The use of this code is permitted for research only. There is 00003 // absolutely no warranty for this software. 00004 // 00005 // Author: John Lee (jjl@mit.edu) 00006 // 00007 #ifndef POINT_SET_MUTABLE_POINT_SET_LIST_H 00008 #define POINT_SET_MUTABLE_POINT_SET_LIST_H 00009 00010 #include <assert.h> 00011 #include <vector> 00012 #include <string> 00013 #include <iostream> 00014 #include "point_set/point-set-list.h" 00015 #include "point_set/point-set.h" 00016 #include "point_set/point-ref.h" 00017 #include "point_set/feature.h" 00018 00019 using namespace std; 00020 00021 namespace libpmk { 00022 00024 00030 class MutablePointSetList : public PointSetList { 00031 public: 00032 virtual ~MutablePointSetList(); 00033 00035 00038 void ReadFromStream(istream& input_stream); 00039 00041 00044 void ReadFromFile(const char* filename); 00045 00047 00058 void ReadSelectionFromStream(istream& input_stream, 00059 int start, int selection_size); 00060 00061 virtual int GetNumPointSets() const; 00062 virtual int GetNumPoints() const; 00063 virtual int GetFeatureDim() const; 00064 virtual vector<int> GetSetCardinalities() const; 00065 00067 PointSet& operator[](int index); 00068 virtual const PointSet& operator[](int index) const; 00069 00071 void AddPointSet(const PointSet& point_set); 00072 00073 00074 private: 00075 vector<PointSet> list_; 00076 00077 }; 00078 } // namespace libpmk 00079 #endif // POINT_SET_POINT_SET_LIST_H