--- trunk/OOPSE-4/src/visitors/OtherVisitor.cpp 2005/04/15 22:04:00 2204 +++ trunk/OOPSE-4/src/visitors/OtherVisitor.cpp 2007/01/16 22:18:04 3116 @@ -77,10 +77,18 @@ namespace oopse { Snapshot* currSnapshot = info->getSnapshotManager()->getCurrentSnapshot(); for( atomInfo = atomData->beginAtomInfo(i); atomInfo; atomInfo = atomData->nextAtomInfo(i) ) { - currSnapshot->wrapVector(atomInfo->pos); + Vector3d newPos = atomInfo->pos - origin_; + currSnapshot->wrapVector(newPos); + atomInfo->pos = newPos; } } + void WrappingVisitor::update() { + if (useCom_){ + origin_ = info->getCom(); + } + } + const std::string WrappingVisitor::toString() { char buffer[65535]; std::string result; @@ -227,7 +235,7 @@ namespace oopse { if (!evaluator.isDynamic()) { seleMan.setSelectionSet(evaluator.evaluate()); } - + posOnly_ = false; } XYZVisitor::XYZVisitor(SimInfo *info, const std::string& script) : @@ -240,7 +248,7 @@ namespace oopse { if (!evaluator.isDynamic()) { seleMan.setSelectionSet(evaluator.evaluate()); } - + posOnly_ = false; } void XYZVisitor::visit(Atom *atom) { @@ -283,18 +291,31 @@ namespace oopse { } else return; - for( atomInfo = atomData->beginAtomInfo(i); atomInfo; - atomInfo = atomData->nextAtomInfo(i) ) { - sprintf(buffer, - "%s%15.8f%15.8f%15.8f%15.8f%15.8f%15.8f", - atomInfo->atomTypeName.c_str(), - atomInfo->pos[0], - atomInfo->pos[1], - atomInfo->pos[2], - atomInfo->dipole[0], - atomInfo->dipole[1], - atomInfo->dipole[2]); - frame.push_back(buffer); + if (posOnly_){ + for( atomInfo = atomData->beginAtomInfo(i); atomInfo; + atomInfo = atomData->nextAtomInfo(i) ) { + sprintf(buffer, + "%s%15.8f%15.8f%15.8f", + atomInfo->atomTypeName.c_str(), + atomInfo->pos[0], + atomInfo->pos[1], + atomInfo->pos[2]); + frame.push_back(buffer); + } + }else{ + for( atomInfo = atomData->beginAtomInfo(i); atomInfo; + atomInfo = atomData->nextAtomInfo(i) ) { + sprintf(buffer, + "%s%15.8f%15.8f%15.8f%15.8f%15.8f%15.8f", + atomInfo->atomTypeName.c_str(), + atomInfo->pos[0], + atomInfo->pos[1], + atomInfo->pos[2], + atomInfo->dipole[0], + atomInfo->dipole[1], + atomInfo->dipole[2]); + frame.push_back(buffer); + } } }