本文整理汇总了C++中VMDApp::molecule_id方法的典型用法代码示例。如果您正苦于以下问题:C++ VMDApp::molecule_id方法的具体用法?C++ VMDApp::molecule_id怎么用?C++ VMDApp::molecule_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VMDApp
的用法示例。
在下文中一共展示了VMDApp::molecule_id方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mol_cancel_cb
static void mol_cancel_cb(Fl_Widget *w, void *v) {
VMDApp *app = (VMDApp *)w->user_data();
MolBrowser *browser = (MolBrowser *)v;
for (int i=0; i<browser->size(); i++) {
if (browser->selected(i+1)) {
int molid = app->molecule_id(i);
app->molecule_cancel_io(molid);
}
}
}
示例2: mol_top_cb
// edit menu callbacks
static void mol_top_cb(Fl_Widget *w, void *v) {
VMDApp *app = (VMDApp *)w->user_data();
MolBrowser *browser = (MolBrowser *)v;
for (int i=0; i<browser->size(); i++) {
if (browser->selected(i+1)) {
app->molecule_make_top(app->molecule_id(i));
break;
}
}
}
示例3: mol_delete_cb
static void mol_delete_cb(Fl_Widget *w, void *v) {
VMDApp *app = (VMDApp *)w->user_data();
MolBrowser *browser = (MolBrowser *)v;
ResizeArray<int> idlist;
for (int i=0; i<browser->size(); i++) {
if (browser->selected(i+1)) {
idlist.append(app->molecule_id(i));
}
}
for (int j=0; j<idlist.num(); j++)
app->molecule_delete(idlist[j]);
}
示例4: mol_rename_cb
static void mol_rename_cb(Fl_Widget *w, void *v) {
VMDApp *app = (VMDApp *)w->user_data();
MolBrowser *browser = (MolBrowser *)v;
int molid=-1;
for (int i=0; i<browser->size(); i++)
if (browser->selected(i+1)) {
molid = app->molecule_id(i);
break;
}
if (molid < 0) return;
// this code snippet is replicated in MolBrowser.C:
const char *oldname = app->molecule_name(molid);
const char *newname = fl_input("Enter a new name for molecule %d:",
oldname, molid);
if (newname) app->molecule_rename(molid, newname);
}
示例5: mol_delete_ts_cb
static void mol_delete_ts_cb(Fl_Widget *w, void *v) {
VMDApp *app = (VMDApp *)w->user_data();
MolBrowser *browser = (MolBrowser *)v;
int molid=-1;
for (int i=0; i<browser->size(); i++)
if (browser->selected(i+1)) {
molid = app->molecule_id(i);
break;
}
if (molid < 0) return;
// this code snippet is replicated in MolBrowser.C:
int numframes = app->molecule_numframes(molid);
if (!numframes) {
fl_alert("Molecule %d has no frames to delete!", molid);
} else {
const char *molname = app->molecule_name(molid);
int first=0, last=numframes-1, stride=0;
int ok = frame_delete_selector(molname, last, &first, &last, &stride);
if (ok) app->molecule_deleteframes(molid, first, last, stride);
}
}