ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-4/src/visitors/OtherVisitor.cpp
(Generate patch)

Comparing trunk/OOPSE-4/src/visitors/OtherVisitor.cpp (file contents):
Revision 2204 by gezelter, Fri Apr 15 22:04:00 2005 UTC vs.
Revision 3116 by chuckv, Tue Jan 16 22:18:04 2007 UTC

# Line 77 | Line 77 | namespace oopse {
77      Snapshot* currSnapshot = info->getSnapshotManager()->getCurrentSnapshot();
78      
79      for( atomInfo = atomData->beginAtomInfo(i); atomInfo; atomInfo = atomData->nextAtomInfo(i) ) {
80 <      currSnapshot->wrapVector(atomInfo->pos);
80 >      Vector3d newPos = atomInfo->pos - origin_;
81 >      currSnapshot->wrapVector(newPos);
82 >      atomInfo->pos = newPos;
83      }
84    }
85  
86 +  void WrappingVisitor::update() {
87 +    if (useCom_){
88 +      origin_ = info->getCom();
89 +    }
90 +  }
91 +  
92    const std::string WrappingVisitor::toString() {
93      char        buffer[65535];
94      std::string result;
# Line 227 | Line 235 | namespace oopse {
235        if (!evaluator.isDynamic()) {
236          seleMan.setSelectionSet(evaluator.evaluate());
237        }
238 <
238 >      posOnly_ = false;
239      }
240  
241    XYZVisitor::XYZVisitor(SimInfo *info, const std::string& script) :
# Line 240 | Line 248 | namespace oopse {
248        if (!evaluator.isDynamic()) {
249          seleMan.setSelectionSet(evaluator.evaluate());
250        }
251 <          
251 >      posOnly_ = false;
252      }
253      
254    void XYZVisitor::visit(Atom *atom) {
# Line 283 | Line 291 | namespace oopse {
291      } else
292        return;
293  
294 <    for( atomInfo = atomData->beginAtomInfo(i); atomInfo;
295 <         atomInfo = atomData->nextAtomInfo(i) ) {
296 <      sprintf(buffer,
297 <              "%s%15.8f%15.8f%15.8f%15.8f%15.8f%15.8f",
298 <              atomInfo->atomTypeName.c_str(),
299 <              atomInfo->pos[0],
300 <              atomInfo->pos[1],
301 <              atomInfo->pos[2],
302 <              atomInfo->dipole[0],
303 <              atomInfo->dipole[1],
304 <              atomInfo->dipole[2]);
305 <      frame.push_back(buffer);
294 >    if (posOnly_){
295 >      for( atomInfo = atomData->beginAtomInfo(i); atomInfo;
296 >           atomInfo = atomData->nextAtomInfo(i) ) {
297 >        sprintf(buffer,
298 >                "%s%15.8f%15.8f%15.8f",
299 >                atomInfo->atomTypeName.c_str(),
300 >                atomInfo->pos[0],
301 >                atomInfo->pos[1],
302 >                atomInfo->pos[2]);
303 >        frame.push_back(buffer);
304 >      }
305 >    }else{
306 >      for( atomInfo = atomData->beginAtomInfo(i); atomInfo;
307 >           atomInfo = atomData->nextAtomInfo(i) ) {
308 >        sprintf(buffer,
309 >                "%s%15.8f%15.8f%15.8f%15.8f%15.8f%15.8f",
310 >                atomInfo->atomTypeName.c_str(),
311 >                atomInfo->pos[0],
312 >                atomInfo->pos[1],
313 >                atomInfo->pos[2],
314 >                atomInfo->dipole[0],
315 >                atomInfo->dipole[1],
316 >                atomInfo->dipole[2]);
317 >        frame.push_back(buffer);
318 >      }
319      }
320    }
321  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines