--- trunk/OOPSE/libmdtools/AtomVisitor.cpp 2004/04/19 03:52:27 1118 +++ trunk/OOPSE/libmdtools/AtomVisitor.cpp 2004/04/19 17:44:48 1119 @@ -2,7 +2,18 @@ #include "AtomVisitor.hpp" #include "DirectionalAtom.hpp" #include "MatVec3.h" +#include "RigidBody.hpp" +void BaseAtomVisitor::visit(RigidBody* rb){ + //vector myAtoms; + //vector::iterator atomIter; + + //myAtoms = rb->getAtoms(); + + //for(atomIter = myAtoms.begin(); atomIter != myAtoms.end(); ++atomIter) + // (*atomIter)->accept(this); +} + void BaseAtomVisitor::setVisited(Atom* atom){ GenericData* data; data = atom->getProperty("VISITED"); @@ -138,6 +149,9 @@ void DefaultAtomVisitor::visit(Atom* atom){ return; atomInfo =new AtomInfo; + + atomData = new AtomData; + atomData->setID("ATOMDATA"); atom->getPos(pos); atomInfo->AtomType = atom->getType(); @@ -148,8 +162,9 @@ void DefaultAtomVisitor::visit(Atom* atom){ atomInfo->dipole[1] = 0.0; atomInfo->dipole[2] = 0.0; - atomData = new AtomData; - atomData->setID("ATOMDATA"); + + atomData->addAtomInfo(atomInfo); + atom->addProperty(atomData); setVisited(atom); @@ -166,6 +181,8 @@ void DefaultAtomVisitor::visit(DirectionalAtom* datom) datom->getPos(pos); datom->getU(u); + atomData = new AtomData; + atomData->setID("ATOMDATA"); atomInfo =new AtomInfo; atomInfo->AtomType = datom->getType(); @@ -176,8 +193,8 @@ void DefaultAtomVisitor::visit(DirectionalAtom* datom) atomInfo->dipole[1] = u[1]; atomInfo->dipole[2] = u[2]; - atomData = new AtomData; - atomData->setID("ATOMDATA"); + atomData->addAtomInfo(atomInfo); + datom->addProperty(atomData); setVisited(datom);