| 5 |
|
* non-exclusive, royalty free, license to use, modify and |
| 6 |
|
* redistribute this software in source and binary code form, provided |
| 7 |
|
* that the following conditions are met: |
| 8 |
– |
* |
| 8 |
|
* 1. Acknowledgement of the program authors must be made in any |
| 9 |
|
* publication of scientific results based in part on use of the |
| 10 |
|
* program. An acceptable form of acknowledgement is citation of |
| 289 |
|
return; |
| 290 |
|
} else |
| 291 |
|
return; |
| 292 |
+ |
|
| 293 |
+ |
AtomType* at = dynamic_cast<Atom *>(sd)->getAtomType(); |
| 294 |
+ |
std::string bn = baseTypeName(at); |
| 295 |
|
|
| 296 |
|
if (posOnly_){ |
| 297 |
|
for( atomInfo = atomData->beginAtomInfo(i); atomInfo; |
| 298 |
|
atomInfo = atomData->nextAtomInfo(i) ) { |
| 299 |
|
if (atomInfo->hasCharge) { |
| 300 |
|
sprintf(buffer, |
| 301 |
< |
"%s%15.8f%15.8f%15.8f%15.8f", |
| 302 |
< |
atomInfo->atomTypeName.c_str(), |
| 303 |
< |
atomInfo->pos[0], |
| 304 |
< |
atomInfo->pos[1], |
| 305 |
< |
atomInfo->pos[2], |
| 306 |
< |
atomInfo->charge); |
| 301 |
> |
"%s%15.8f%15.8f%15.8f%15.8f", |
| 302 |
> |
bn.c_str(), |
| 303 |
> |
atomInfo->pos[0], |
| 304 |
> |
atomInfo->pos[1], |
| 305 |
> |
atomInfo->pos[2], |
| 306 |
> |
atomInfo->charge); |
| 307 |
|
} else { |
| 308 |
|
sprintf(buffer, |
| 309 |
|
"%s%15.8f%15.8f%15.8f", |
| 310 |
< |
atomInfo->atomTypeName.c_str(), |
| 311 |
< |
atomInfo->pos[0], |
| 312 |
< |
atomInfo->pos[1], |
| 313 |
< |
atomInfo->pos[2]); |
| 310 |
> |
bn.c_str(), |
| 311 |
> |
atomInfo->pos[0], |
| 312 |
> |
atomInfo->pos[1], |
| 313 |
> |
atomInfo->pos[2]); |
| 314 |
|
} |
| 315 |
|
frame.push_back(buffer); |
| 316 |
|
} |
| 320 |
|
if (atomInfo->hasCharge) { |
| 321 |
|
sprintf(buffer, |
| 322 |
|
"%s%15.8f%15.8f%15.8f%15.8f%15.8f%15.8f%15.8f", |
| 323 |
< |
atomInfo->atomTypeName.c_str(), |
| 323 |
> |
bn.c_str(), |
| 324 |
|
atomInfo->pos[0], |
| 325 |
|
atomInfo->pos[1], |
| 326 |
|
atomInfo->pos[2], |
| 331 |
|
} else { |
| 332 |
|
sprintf(buffer, |
| 333 |
|
"%s%15.8f%15.8f%15.8f%15.8f%15.8f%15.8f", |
| 334 |
< |
atomInfo->atomTypeName.c_str(), |
| 334 |
> |
bn.c_str(), |
| 335 |
|
atomInfo->pos[0], |
| 336 |
|
atomInfo->pos[1], |
| 337 |
|
atomInfo->pos[2], |
| 375 |
|
outStream << *i << std::endl; |
| 376 |
|
} |
| 377 |
|
|
| 378 |
+ |
std::string XYZVisitor::trimmedName(const std::string&atomTypeName) { |
| 379 |
+ |
return atomTypeName.substr(0, atomTypeName.find('-')); |
| 380 |
+ |
} |
| 381 |
+ |
|
| 382 |
+ |
std::string XYZVisitor::baseTypeName(AtomType* at) { |
| 383 |
+ |
std::vector<AtomType*> ayb = at->allYourBase(); |
| 384 |
+ |
return ayb[ayb.size()-1]->getName(); |
| 385 |
+ |
} |
| 386 |
+ |
|
| 387 |
|
const std::string XYZVisitor::toString() { |
| 388 |
|
char buffer[65535]; |
| 389 |
|
std::string result; |