当前位置: 首页>>代码示例>>C++>>正文


C++ Transforms::setDihedral方法代码示例

本文整理汇总了C++中Transforms::setDihedral方法的典型用法代码示例。如果您正苦于以下问题:C++ Transforms::setDihedral方法的具体用法?C++ Transforms::setDihedral怎么用?C++ Transforms::setDihedral使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Transforms的用法示例。


在下文中一共展示了Transforms::setDihedral方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main


//.........这里部分代码省略.........
            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;
                exit(1);
            }
            if (opt.edits[i].type == "dihedral") {
                T.setDihedral(*pAtom1, *pAtom2, *pAtom3, *pAtom4, opt.edits[i].value);
                cout << i+1 << " Set dihedral [" << opt.edits[i].atomNames[0] << ", " << opt.edits[i].atomNames[1] << ", " << opt.edits[i].atomNames[2] << ", " << opt.edits[i].atomNames[3] << "] to " << opt.edits[i].value << " (" << pAtom1->dihedral(*pAtom2, *pAtom3, *pAtom4) << ")" << endl;
            } else {
                T.setImproper(*pAtom1, *pAtom2, *pAtom3, *pAtom4, opt.edits[i].value);
                cout << i+1 << " Set improper [" << opt.edits[i].atomNames[0] << ", " << opt.edits[i].atomNames[1] << ", " << opt.edits[i].atomNames[2] << ", " << opt.edits[i].atomNames[3] << "] to " << opt.edits[i].value << opt.edits[i].value << " (" << pAtom1->dihedral(*pAtom2, *pAtom3, *pAtom4) << ")" << endl;
            }
        } else {
            cout << "ERROR: Degree of freedom type \"" << opt.edits[i].type << "\" not recognized" << endl;
            exit(1);
        }
    }
    cout << endl;

    if (!sys.writePdb(opt.outputPdb)) {
        cout << "ERROR: cannot write pdb file " << opt.outputPdb << endl;
        exit(1);
    }
    cout << "Output file written to " << opt.outputPdb << endl;

    /*
    AtomPointerVector av = sys.getAtomPointers();


    cout << endl;
    cout << "===========================================" << endl;
    cout << endl;
    Atom * pAtomN4 = NULL;
    if (sys.atomExists("A, 4, N")) {
    	pAtomN4 = &(sys.getLastFoundAtom());
    //	cout << *pAtomN4 << endl;
    } else {
    	cout << "Atom A 4 N not found" << endl;
    	exit(1);
开发者ID:Suncuss,项目名称:mslib,代码行数:67,代码来源:setConformation.cpp


注:本文中的Transforms::setDihedral方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。