本文整理汇总了C++中Mol::IsReady方法的典型用法代码示例。如果您正苦于以下问题:C++ Mol::IsReady方法的具体用法?C++ Mol::IsReady怎么用?C++ Mol::IsReady使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mol
的用法示例。
在下文中一共展示了Mol::IsReady方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Apply
void GeoSettings::Apply(){
if (mol.IsReady()) {
if (mode==BALL_N_STICKS) {
mol.SetBallAndSticks(stickRadius);
}
if (mode==LICORICE) {
mol.SetLicorice(licoRadius);
}
if (mode==SPACE_FILL) mol.SetSpaceFill();
}
cgSettings.setGeoSettings(*this);
cgSettings.UpdateShaders();
UpdateShadowmap();
mol.ResetAO();
}
示例2: OnPaint
void TestGLCanvas::OnPaint( wxPaintEvent& event )
{
/* must always be here */
wxPaintDC dc(this);
#ifndef __WXMOTIF__
if (!GetContext()) return;
#endif
SetCurrent();
if (!initdone) {
static bool once=false;
if (!once) {
once=true;
int errcode=initGl();
if (errcode!=ERRGL_OK){
wxMessageBox(errorMSG(errcode), _T("Unrecoverable error: Problems initializing graphics"), wxOK | wxICON_EXCLAMATION, this);
exit(0);
}
else initdone=true;
}
}
if (!initdone) wxGLCanvas::OnPaint(event); else
if (mol.IsReady()) {
if (mustDoHQ) {
drawFrame( hardSettings.STILL_QUALITY );
shownHQ=true;
mustDoHQ=false;
} else {
drawFrame( hardSettings.MOVING_QUALITY );
shownHQ=false;
}
SwapBuffers();
}
else {
clearFrame();
SwapBuffers();
}
}
示例3: OnKeyDown
void TestGLCanvas::OnKeyDown( wxKeyEvent& event ){
wxConsumeTrackBallEvent(event,true,track);
#ifdef __DARWIN__
wxString path = wxStandardPaths::Get().GetResourcesDir() + "/presets/new.preset";
#else
wxString path = "presets\\new.preset";
#endif
if (event.GetKeyCode() == WXK_F7 ) {
cgSettings.Save(path.c_str());
}
if (event.GetKeyCode() == WXK_F6 ) {
if (cgSettings.Load(path.c_str())) {
MyTab::UpdateAll();
cgSettings.ResetHalo();
cgSettings.UpdateShaders();
SceneChanged();
}
}
if (event.GetKeyCode() == WXK_F5 ) {
mol.PrepareAOSingleView();
SceneChanged();
}
if (event.GetKeyCode() == WXK_F2 ) {
static int status=0;
status=(status+1) % 5;
draw_balls = (status==0) || (status==1) || (status==2) ;
draw_sticks = (status==0) || (status==1) || (status==3) || (status==4) ;
draw_wireframe_balls= (status==1) ;
draw_wireframe_sticks= (status==1) || (status==3) ;
SceneChanged();
}
if (event.GetKeyCode() == WXK_F1 ) {
wxString text;
if (!mol.IsReady() ) text=wxT("(no molecule)");
else {
text=wxString( mol.GetMolName(), wxConvUTF8 ).BeforeLast('.') +
wxT("\n (file: \"")+wxString( mol.filename, wxConvUTF8 ) +wxT("\")\n\n");
text=text+wxString::Format(wxT("%d atoms\n"),mol.atom.size());
if (mol.sticks) {
text=text+wxString::Format(wxT("%d bonds\n"),mol.bond.size());
}
text=text+wxString::Format(
_T("\nUsing:\n Texture size = %dx%d\n Patch size=%dx%d"),
moltextureCanvas.GetHardRes(),
moltextureCanvas.GetHardRes(),
CSIZE,CSIZE
);
}
wxMessageBox(text, _T("QuteMol - file info"), wxOK | wxICON_INFORMATION, this);
}
if (event.GetKeyCode() == WXK_F6 ) {
use_accurate_halo=!use_accurate_halo;
SceneChanged();
}
// temp, should e set auto depending on dist
if (event.GetKeyCode() == WXK_F2 ) {
cgSettings.P_capping=!cgSettings.P_capping;
cgSettings.UpdateShaders();
SceneChanged();
}
}