本文整理汇总了C++中Mol::PredictAO方法的典型用法代码示例。如果您正苦于以下问题:C++ Mol::PredictAO方法的具体用法?C++ Mol::PredictAO怎么用?C++ Mol::PredictAO使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mol
的用法示例。
在下文中一共展示了Mol::PredictAO方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Draw
void Mol::Draw(){
glPushMatrix();
glScalef(1/r,1/r,1/r);
glTranslatef(-px,-py,-pz);
float x[4][4], scalef;
glGetFloatv(GL_MODELVIEW_MATRIX, &(x[0][0]));
glProgramEnvParameter4fARB(GL_VERTEX_PROGRAM_ARB, 0,
scalef=extractCurrentScaleFactor(x),0,0,0
);
/*
glProgramEnvParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, 6,
1.0 / ( scalef*scalef) , 0,0,0
);*/
/* printf("ScaleFactor= %f, ShadowScaleFactor= %f\n",
scalef, shadowScaleFactor );*/
glEnable(GL_VERTEX_PROGRAM_ARB);
glEnable(GL_TEXTURE_2D);
glActiveTextureARB(GL_TEXTURE0_ARB);
moltextureCanvas.SetAsTexture();
if (cgSettings.P_shadowstrenght>0) {
ShadowMap::GetCurrentPVMatrix();
ShadowMap::FeedParameters();
}
for (int i=0; i<3; i++)
glProgramEnvParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, i,
x[i][0],x[i][1],x[i][2],0
);
glProgramEnvParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, 6,
mol.PredictAO(),0,0,0
);
if (draw_balls) {
if (draw_wireframe_balls) {
glDisable(GL_FRAGMENT_PROGRAM_ARB);
for (int i=0; i<atom.size(); i++) {
glColor3f(0,0,1);
glBegin(GL_LINE_LOOP);
atom[i].Draw();
glEnd();
}
} else {
glEnable(GL_VERTEX_PROGRAM_ARB);
glEnable(GL_FRAGMENT_PROGRAM_ARB);
//if (DL_atoms==666) glGenD
glBegin(GL_QUADS);
for (int i=0; i<atom.size(); i++) atom[i].Draw();
glEnd();
glDisable(GL_VERTEX_PROGRAM_ARB);
glDisable(GL_FRAGMENT_PROGRAM_ARB);
}
}
if (draw_sticks)
if (sticks) {
glEnable(GL_VERTEX_PROGRAM_ARB);
glEnable(GL_FRAGMENT_PROGRAM_ARB);
cgSettings.BindStickShaders();
ShadowMap::FeedParameters();
for (int i=0; i<3; i++)
glProgramEnvParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, i,
x[i][0],x[i][1],x[i][2],0
);
/*
glProgramEnvParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, 6,
1.0 / ( scalef*scalef) , stick_radius,1.0 / ( scalef) ,0
);*/
glEnable(GL_TEXTURE_2D);
glProgramEnvParameter4fARB(GL_VERTEX_PROGRAM_ARB, 0,
scalef, stick_radius,stick_radius*2,0 );
glColor3f(1,1,1);
if (draw_wireframe_sticks) {
glDisable(GL_FRAGMENT_PROGRAM_ARB);
for (int i=0; i<bond.size(); i++) {
glColor3f(0,0.6,0.3);
glBegin(GL_LINE_LOOP);
bond[i].Draw();
glEnd();
}
}
else {
glBegin(GL_QUADS);
for (int i=0; i<bond.size(); i++) bond[i].Draw();
//.........这里部分代码省略.........