ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/AtomVisitor.cpp
(Generate patch)

Comparing trunk/OOPSE/libmdtools/AtomVisitor.cpp (file contents):
Revision 1118 by tim, Mon Apr 19 03:52:27 2004 UTC vs.
Revision 1119 by tim, Mon Apr 19 17:44:48 2004 UTC

# Line 2 | Line 2
2   #include "AtomVisitor.hpp"
3   #include "DirectionalAtom.hpp"
4   #include "MatVec3.h"
5 + #include "RigidBody.hpp"
6  
7 + void BaseAtomVisitor::visit(RigidBody* rb){
8 +  //vector<Atom*> myAtoms;
9 +  //vector<Atom*>::iterator atomIter;
10 +
11 +  //myAtoms = rb->getAtoms();
12 +  
13 +  //for(atomIter = myAtoms.begin(); atomIter != myAtoms.end(); ++atomIter)
14 +  //  (*atomIter)->accept(this);
15 + }
16 +
17   void BaseAtomVisitor::setVisited(Atom* atom){
18    GenericData* data;
19    data = atom->getProperty("VISITED");
# Line 138 | Line 149 | void DefaultAtomVisitor::visit(Atom* atom){
149      return;
150  
151   atomInfo =new AtomInfo;
152 +
153 +  atomData = new AtomData;
154 +  atomData->setID("ATOMDATA");
155  
156    atom->getPos(pos);
157    atomInfo->AtomType = atom->getType();
# Line 148 | Line 162 | void DefaultAtomVisitor::visit(Atom* atom){
162    atomInfo->dipole[1] = 0.0;
163    atomInfo->dipole[2] = 0.0;
164  
165 <  atomData = new AtomData;
166 <  atomData->setID("ATOMDATA");
165 >
166 >  atomData->addAtomInfo(atomInfo);
167 >  
168    atom->addProperty(atomData);
169  
170    setVisited(atom);
# Line 166 | Line 181 | void DefaultAtomVisitor::visit(DirectionalAtom* datom)
181    datom->getPos(pos);
182    datom->getU(u);
183  
184 +  atomData = new AtomData;
185 +  atomData->setID("ATOMDATA");
186    atomInfo =new AtomInfo;
187    
188    atomInfo->AtomType = datom->getType();
# Line 176 | Line 193 | void DefaultAtomVisitor::visit(DirectionalAtom* datom)
193    atomInfo->dipole[1] = u[1];
194    atomInfo->dipole[2] = u[2];  
195  
196 <  atomData = new AtomData;
197 <  atomData->setID("ATOMDATA");
196 >  atomData->addAtomInfo(atomInfo);
197 >
198    datom->addProperty(atomData);
199  
200    setVisited(datom);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines