ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new_design/OOPSE-4/src/visitors/AtomData.hpp
Revision: 1683
Committed: Thu Oct 28 22:34:02 2004 UTC (19 years, 8 months ago)
File size: 1069 byte(s)
Log Message:
This commit was manufactured by cvs2svn to create branch 'new_design'.

File Contents

# Content
1 #ifndef VISITOR_ATOMDATA_HPP
2 #define VISITOR_ATOMDATA_HPP
3 #include "utils/GenericData.hpp"
4
5 using namespace std;
6
7 namespace oopse {
8
9 struct AtomInfo {
10 public:
11 string AtomType;
12 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 vector<AtomInfo*>::iterator i;
21 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 vector<AtomInfo*> getData() {return data;}
39 int getSize() {return data.size();}
40 protected:
41 vector<AtomInfo*> data;
42 };
43
44
45 }
46 #endif //VISITOR_ATOMDATA_HPP

Properties

Name Value
svn:executable *