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

Comparing trunk/OOPSE-3.0/src/visitors/OtherVisitor.cpp (file contents):
Revision 2008 by tim, Sun Feb 13 19:10:25 2005 UTC vs.
Revision 2091 by gezelter, Tue Mar 8 21:07:49 2005 UTC

# Line 1 | Line 1
1 < /*
1 > /*
2   * Copyright (c) 2005 The University of Notre Dame. All Rights Reserved.
3   *
4   * The University of Notre Dame grants you ("Licensee") a
# Line 338 | Line 338 | void XYZVisitor::internalVisit(StuntDouble *sd) {
338  
339      for( atomInfo = atomData->beginAtomInfo(i); atomInfo;
340          atomInfo = atomData->nextAtomInfo(i) ) {
341 <        if (printDipole)
342 <            sprintf(buffer,
343 <                    "%s%15.8f%15.8f%15.8f%15.8f%15.8f%15.8f",
344 <                    atomInfo->AtomType.c_str(),
345 <                    atomInfo->pos[0],
346 <                    atomInfo->pos[1],
347 <                    atomInfo->pos[2],
348 <                    atomInfo->dipole[0],
349 <                    atomInfo->dipole[1],
350 <                    atomInfo->dipole[2]); else
351 <            sprintf(buffer,                     "%s%15.8f%15.8f%15.8f",
352 <                    atomInfo->AtomType.c_str(), atomInfo->pos[0],
353 <                    atomInfo->pos[1],           atomInfo->pos[2]);
354 <
341 >      printf("SD type is %s\n", sd->getType().c_str());
342 >      printf("XYZVisitor thinks %s\n", atomInfo->atomTypeName.c_str());
343 >      if (printDipole) {
344 >        sprintf(buffer,
345 >                "%s%15.8f%15.8f%15.8f%15.8f%15.8f%15.8f",
346 >                atomInfo->atomTypeName.c_str(),
347 >                atomInfo->pos[0],
348 >                atomInfo->pos[1],
349 >                atomInfo->pos[2],
350 >                atomInfo->dipole[0],
351 >                atomInfo->dipole[1],
352 >                atomInfo->dipole[2]);
353 >      } else {
354 >        sprintf(buffer,                     "%s%15.8f%15.8f%15.8f",
355 >                atomInfo->atomTypeName.c_str(), atomInfo->pos[0],
356 >                atomInfo->pos[1],           atomInfo->pos[2]);
357 >      }
358 >        
359          frame.push_back(buffer);
360      }
361   }
# Line 521 | Line 525 | void WaterTypeVisitor::visit(RigidBody *rb) {
525                  continue;
526  
527              for( atomInfo = atomData->beginAtomInfo(i); atomInfo;
528 <                atomInfo = atomData->nextAtomInfo(i) ) {
529 <            replaceType(atomInfo->AtomType);
528 >                 atomInfo = atomData->nextAtomInfo(i) ) {
529 >              atomInfo->atomTypeName = trimmedName(atomInfo->atomTypeName);
530              } //end for(atomInfo)
531          }     //end for(atomIter)
532      }         //end if (waterTypeList.find(rbName) != waterTypeList.end())
533   }
534  
535 < void WaterTypeVisitor::replaceType(std::string&atomType) {
536 < atomType = atomType.substr(0, atomType.find('_'));
537 < }
535 >  std::string WaterTypeVisitor::trimmedName(const std::string&atomTypeName) {
536 >    return atomTypeName.substr(0, atomTypeName.find('_'));
537 >  }
538  
539   const std::string WaterTypeVisitor::toString() {
540      char buffer[65535];

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines