00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef IMP_CONFIGURATION_SET_H
00010 #define IMP_CONFIGURATION_SET_H
00011
00012 #include "kernel_config.h"
00013 #include "Object.h"
00014 #include "Pointer.h"
00015 #include "Model.h"
00016 #include "internal/particle_save.h"
00017 #include <map>
00018 #include <set>
00019
00020 IMP_BEGIN_NAMESPACE
00021
00022
00023
00024
00025
00026
00027 class IMPEXPORT ConfigurationSet: public Object
00028 {
00029 Pointer<Model> model_;
00030 typedef Pointer<Particle> PP;
00031 typedef std::map<PP, internal::ParticleData> DataMap;
00032 typedef std::map<PP, internal::ParticleDiff> DiffMap;
00033 typedef std::set<Particle*> ParticleSet;
00034 DataMap base_;
00035 struct Diff {
00036 DiffMap diffs_;
00037 DataMap added_;
00038 ParticleSet removed_;
00039 };
00040 std::vector<Diff> configurations_;
00041
00042 void set_base();
00043 public:
00044 ConfigurationSet(Model *m, std::string name="ConfigurationSet %1%");
00045
00046 void save_configuration();
00047 unsigned int get_number_of_configurations() const;
00048
00049
00050 void set_configuration(int i);
00051 IMP_OBJECT(ConfigurationSet);
00052 };
00053
00054 IMP_OBJECTS(ConfigurationSet);
00055
00056 IMP_END_NAMESPACE
00057
00058 #endif