本文整理汇总了C++中Transforms::setBondAngle方法的典型用法代码示例。如果您正苦于以下问题:C++ Transforms::setBondAngle方法的具体用法?C++ Transforms::setBondAngle怎么用?C++ Transforms::setBondAngle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Transforms
的用法示例。
在下文中一共展示了Transforms::setBondAngle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
pAtom2 = &(sys.getLastFoundAtom());
} else {
cout << "ERROR: Atom " << opt.edits[i].atomNames[1] << " not found" << endl;
exit(1);
}
T.setBondDistance(*pAtom1, *pAtom2, opt.edits[i].value);
cout << i+1 << " Set bond [" << opt.edits[i].atomNames[0] << ", " << opt.edits[i].atomNames[1] << "] to " << opt.edits[i].value << " (" << pAtom1->distance(*pAtom2) << ")" << endl;
} else if (opt.edits[i].type == "angle") {
if (opt.edits[i].atomNames.size() != 3) {
cerr << "ERROR: Type angle requires 3 atom name" << endl;
exit(1);
}
Atom * pAtom1 = NULL;
if (sys.atomExists(opt.edits[i].atomNames[0])) {
pAtom1 = &(sys.getLastFoundAtom());
} else {
cout << "ERROR: Atom " << opt.edits[i].atomNames[0] << " not found" << endl;
exit(1);
}
Atom * pAtom2 = NULL;
if (sys.atomExists(opt.edits[i].atomNames[1])) {
pAtom2 = &(sys.getLastFoundAtom());
} else {
cout << "ERROR: Atom " << opt.edits[i].atomNames[1] << " not found" << endl;
exit(1);
}
Atom * pAtom3 = NULL;
if (sys.atomExists(opt.edits[i].atomNames[2])) {
pAtom3 = &(sys.getLastFoundAtom());
} else {
cout << "ERROR: Atom " << opt.edits[i].atomNames[2] << " not found" << endl;
exit(1);
}
T.setBondAngle(*pAtom1, *pAtom2, *pAtom3, opt.edits[i].value);
cout << i+1 << " Set angle [" << opt.edits[i].atomNames[0] << ", " << opt.edits[i].atomNames[1] << ", " << opt.edits[i].atomNames[2] << "] to " << opt.edits[i].value << " (" << pAtom1->angle(*pAtom2, *pAtom3) << ")" << endl;
} else if (opt.edits[i].type == "dihedral" || opt.edits[i].type == "improper") {
if (opt.edits[i].atomNames.size() != 4) {
cerr << "ERROR: Type dihedral/improper requires 4 atom name" << endl;
exit(1);
}
Atom * pAtom1 = NULL;
if (sys.atomExists(opt.edits[i].atomNames[0])) {
pAtom1 = &(sys.getLastFoundAtom());
} else {
cout << "ERROR: Atom " << opt.edits[i].atomNames[0] << " not found" << endl;
exit(1);
}
Atom * pAtom2 = NULL;
if (sys.atomExists(opt.edits[i].atomNames[1])) {
pAtom2 = &(sys.getLastFoundAtom());
} else {
cout << "ERROR: Atom " << opt.edits[i].atomNames[1] << " not found" << endl;
exit(1);
}
Atom * pAtom3 = NULL;
if (sys.atomExists(opt.edits[i].atomNames[2])) {
pAtom3 = &(sys.getLastFoundAtom());
} else {
cout << "ERROR: Atom " << opt.edits[i].atomNames[2] << " not found" << endl;
exit(1);
}
Atom * pAtom4 = NULL;
if (sys.atomExists(opt.edits[i].atomNames[3])) {
pAtom4 = &(sys.getLastFoundAtom());
} else {
cout << "ERROR: Atom " << opt.edits[i].atomNames[3] << " not found" << endl;