ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new_design/OOPSE-3.0/src/visitors/AtomData.hpp
Revision: 1816
Committed: Wed Dec 1 19:10:51 2004 UTC (19 years, 7 months ago) by tim
File size: 1103 byte(s)
Log Message:
spell check

File Contents

# User Rev Content
1 tim 1625 #ifndef VISITOR_ATOMDATA_HPP
2     #define VISITOR_ATOMDATA_HPP
3 tim 1816 #include <string>
4     #include <vector>
5 tim 1625 #include "utils/GenericData.hpp"
6    
7     namespace oopse {
8    
9     struct AtomInfo {
10     public:
11 tim 1816 std::string AtomType;
12 tim 1625 double pos[3];
13     double dipole[3];
14     };
15    
16     class AtomData : public GenericData{
17     public:
18     AtomData(const string& id = "ATOMDATA") : GenericData(id) {}
19     ~AtomData() {
20 tim 1816 std::vector<AtomInfo*>::iterator i;
21 tim 1625 AtomInfo* atomInfo;
22    
23     for(atomInfo = beginAtomInfo(i); atomInfo; atomInfo = nextAtomInfo(i))
24     delete atomInfo;
25    
26     data.clear();
27     }
28     void addAtomInfo(AtomInfo* info) {data.push_back(info);}
29     void clearAllAtomInfo();
30     AtomInfo* beginAtomInfo(vector<AtomInfo*>::iterator& i){
31     i = data.begin();
32     return i != data.end()? *i : NULL;
33     }
34     AtomInfo* nextAtomInfo(vector<AtomInfo*>::iterator& i){
35     ++i;
36     return i != data.end()? *i: NULL;
37     }
38 tim 1816 std::vector<AtomInfo*> getData() {return data;}
39 tim 1625 int getSize() {return data.size();}
40     protected:
41 tim 1816 std::vector<AtomInfo*> data;
42 tim 1625 };
43    
44    
45     }
46     #endif //VISITOR_ATOMDATA_HPP

Properties

Name Value
svn:executable *