本文整理汇总了C++中VMDApp::colorscale_setmethod方法的典型用法代码示例。如果您正苦于以下问题:C++ VMDApp::colorscale_setmethod方法的具体用法?C++ VMDApp::colorscale_setmethod怎么用?C++ VMDApp::colorscale_setmethod使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VMDApp
的用法示例。
在下文中一共展示了VMDApp::colorscale_setmethod方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
static PyObject *set_scale(PyObject *self, PyObject *args, PyObject *keywds) {
static char *kwlist[] = {
(char *)"method", (char *)"midpoint", (char *)"min", (char *)"max", NULL
};
char *method = NULL;
float midpoint = -1, min = -1, max = -1;
VMDApp *app = get_vmdapp();
app->colorscale_info(&midpoint, &min, &max);
if (!PyArg_ParseTupleAndKeywords(args, keywds, (char *)"|sfff", kwlist,
&method, &midpoint, &min, &max))
return NULL;
if (method) {
int ind = app->colorscale_method_index(method);
if (ind < 0) {
PyErr_SetString(PyExc_ValueError, (char *)"Invalid color scale method");
return NULL;
}
app->colorscale_setmethod(ind);
}
app->colorscale_setvalues(midpoint, min, max);
Py_INCREF(Py_None);
return Py_None;
}
示例2: py_set_scale
static PyObject* py_set_scale(PyObject *self, PyObject *args, PyObject *kwargs)
{
const char *kwnames[] = {"method", "midpoint", "min", "max", NULL};
float midpoint = -1, min = -1, max = -1;
char *method = NULL;
VMDApp *app;
// Set midpoint, min and max to the current values
if (!(app = get_vmdapp()))
return NULL;
app->colorscale_info(&midpoint, &min, &max);
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|zfff:color.set_scale",
(char**) kwnames, &method, &midpoint, &min,
&max))
return NULL;
if (method) {
int ind = app->colorscale_method_index(method);
if (ind < 0) {
PyErr_SetString(PyExc_ValueError, "Invalid color scale method");
return NULL;
}
app->colorscale_setmethod(ind);
}
app->colorscale_setvalues(midpoint, min, max);
Py_INCREF(Py_None);
return Py_None;
}