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 00008 #ifndef POINT_SET_MUTABLE_POINT_SET_LIST_H 00009 #define POINT_SET_MUTABLE_POINT_SET_LIST_H 00010 00011 #include <vector> 00012 #include <iostream> 00013 #include "point_set/point-set-list.h" 00014 #include "point_set/point-set.h" 00015 #include "point_set/point.h" 00016 00017 using namespace std; 00018 00019 namespace libpmk { 00020 00022 00028 class MutablePointSetList : public PointSetList { 00029 public: 00030 virtual ~MutablePointSetList(); 00031 00033 00036 void ReadFromStream(istream& input_stream); 00037 00039 00042 void ReadFromFile(const char* filename); 00043 00045 00056 void ReadSelectionFromStream(istream& input_stream, 00057 int start, int selection_size); 00058 00059 virtual int point_set_size() const; 00060 virtual int point_size() const; 00061 virtual int point_dim() const; 00062 00064 const PointSet& point_set(int index) const; 00065 00067 PointSet* mutable_point_set(int index); 00068 00070 00073 PointSet* add_point_set(const PointSet& point_set); 00074 00076 00083 PointSet* add_point_set(int point_dim); 00084 00085 00086 00087 private: 00088 void clear(); 00089 vector<PointSet*> list_; 00090 00091 }; 00092 } // namespace libpmk 00093 #endif // POINT_SET_POINT_SET_LIST_H