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 2240 by tim, Thu May 26 22:45:00 2005 UTC vs.
Revision 3328 by xsun, Wed Jan 23 21:23:32 2008 UTC

# Line 235 | 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 248 | 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 291 | 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 >        if (atomInfo->hasCharge) {
298 >          sprintf(buffer,
299 >                "%s%15.8f%15.8f%15.8f%15.8f",
300 >                atomInfo->atomTypeName.c_str(),
301 >                atomInfo->pos[0],
302 >                atomInfo->pos[1],
303 >                atomInfo->pos[2],
304 >                atomInfo->charge);
305 >        } else {
306 >          sprintf(buffer,
307 >                "%s%15.8f%15.8f%15.8f",
308 >                atomInfo->atomTypeName.c_str(),
309 >                atomInfo->pos[0],
310 >                atomInfo->pos[1],
311 >                atomInfo->pos[2]);
312 >        }
313 >        frame.push_back(buffer);
314 >      }
315 >    }else{
316 >      for( atomInfo = atomData->beginAtomInfo(i); atomInfo;
317 >           atomInfo = atomData->nextAtomInfo(i) ) {
318 >        if (atomInfo->hasCharge) {
319 >        sprintf(buffer,
320 >                "%s%15.8f%15.8f%15.8f%15.8f%15.8f%15.8f%15.8f",
321 >                atomInfo->atomTypeName.c_str(),
322 >                atomInfo->pos[0],
323 >                atomInfo->pos[1],
324 >                atomInfo->pos[2],
325 >                atomInfo->charge,
326 >                atomInfo->dipole[0],
327 >                atomInfo->dipole[1],
328 >                atomInfo->dipole[2]);
329 >        } else {
330 >        sprintf(buffer,
331 >                "%s%15.8f%15.8f%15.8f%15.8f%15.8f%15.8f",
332 >                atomInfo->atomTypeName.c_str(),
333 >                atomInfo->pos[0],
334 >                atomInfo->pos[1],
335 >                atomInfo->pos[2],
336 >                atomInfo->dipole[0],
337 >                atomInfo->dipole[1],
338 >                atomInfo->dipole[2]);
339 >        }
340 >        frame.push_back(buffer);
341 >      }
342      }
343    }
344  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines