本文整理汇总了C++中Transforms::transform方法的典型用法代码示例。如果您正苦于以下问题:C++ Transforms::transform方法的具体用法?C++ Transforms::transform怎么用?C++ Transforms::transform使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Transforms
的用法示例。
在下文中一共展示了Transforms::transform方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char *argv[]){
// Option Parser
Options opt = setupOptions(argc,argv);
// Read PDB
System sys;
sys.readPdb(opt.pdb);
int centerResidueIndex = -1;
for (uint i = 0; i < sys.positionSize();i++){
if ((sys.getPosition(i).getResidueNumber() == opt.resnum) && (sys.getPosition(i).getChainId() == opt.chain)) {
centerResidueIndex = i;
break;
}
}
if (centerResidueIndex == -1){
cerr << "ERROR Couldn't find central residue"<<endl;
cerr << opt.pdb << endl;
cerr << opt.resnum << "\t" << opt.chain << endl;
exit(3);
}
cout << "Compute Frame.h"<<endl;
Frame f;
if (!f.computeFrameFromFunctionalGroup(sys.getPosition(centerResidueIndex).getCurrentIdentity())){
cerr << "Problem creating frame from central residue"<<endl;
cerr << opt.pdb << endl;
cerr << opt.resnum << "\t" << opt.chain << endl;
exit(324);
}
if (opt.printFrames){
cout << "Write out basic frame"<<endl;
ofstream fout;
fout.open("basicFrame.py");
fout << f.toString()<<endl;
fout.close();
}
// Align frame and atoms of sys to origin.
AtomPointerVector &av = sys.getAtomPointers();
f.transformToGlobalBasis(av);
Transforms t;
for (uint i = 0; i < sys.positionSize();i++){
if (i == centerResidueIndex) continue;
Residue &r = sys.getResidue(i);
CartesianPoint cp;
double angleBetweenFrames = MslTools::doubleMax;
if (r.getResidueName() == "ASP" &&
r.atomExists("CG") &&
r.atomExists("OD1") &&
r.atomExists("OD2")){
cp.setCoor( (r("CG").getX()+r("OD1").getX()+r("OD2").getX()) / 3,
(r("CG").getY()+r("OD1").getY()+r("OD2").getY()) / 3,
(r("CG").getZ()+r("OD1").getZ()+r("OD2").getZ()) / 3);
if (i != centerResidueIndex) {
f.transformFromGlobalBasis(r.getAtomPointers());
Frame floatingFrame;
floatingFrame.computeFrameFrom3Atoms(r("OD1"),r("CG"),r("OD2"));
if (opt.printFrames){
char name[80];
sprintf(name,"aspFrame%1s%03d.py",r.getChainId().c_str(),r.getResidueNumber());
ofstream fout;
fout.open(name);
fout << floatingFrame.toString()<<endl;
fout.close();
}
//cout << floatingFrame.toString()<<endl;
Matrix m = f.anglesBetweenFrame(floatingFrame);
angleBetweenFrames = m[2][2];// z vs z
f.transformToGlobalBasis(r.getAtomPointers());
}
}
if (r.getResidueName() == "ASN" &&
r.atomExists("CG") &&
r.atomExists("OD1") &&
r.atomExists("ND2")){
cp.setCoor( (r("CG").getX()+r("OD1").getX()+r("ND2").getX()) / 3,
//.........这里部分代码省略.........