本文整理汇总了Python中chemlab.graphics.qtviewer.QtViewer.schedule方法的典型用法代码示例。如果您正苦于以下问题:Python QtViewer.schedule方法的具体用法?Python QtViewer.schedule怎么用?Python QtViewer.schedule使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类chemlab.graphics.qtviewer.QtViewer
的用法示例。
在下文中一共展示了QtViewer.schedule方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_sphere_imp_renderer
# 需要导入模块: from chemlab.graphics.qtviewer import QtViewer [as 别名]
# 或者: from chemlab.graphics.qtviewer.QtViewer import schedule [as 别名]
def test_sphere_imp_renderer():
'''To see if we can render a sphere'''
centers = [[0.0, 0.0, 0.0], [0.0, 1.0, 0.0], [1.0, 0.0, 0.0]]
radii = [0.5, 0.1, 0.5]
colors = np.array([orange, blue, forest_green])
v = QtViewer()
sr = v.add_renderer(SphereImpostorRenderer, centers, radii, colors)
cr = np.array(centers)
def update(cr=cr):
cr[0][0] += 0.01
sr.update_positions(cr)
v.widget.repaint()
v.schedule(update)
v.run()
示例2: test_sphere_renderer
# 需要导入模块: from chemlab.graphics.qtviewer import QtViewer [as 别名]
# 或者: from chemlab.graphics.qtviewer.QtViewer import schedule [as 别名]
def test_sphere_renderer():
'''To see if we can render a sphere'''
centers = [[0.0, 0.0, 0.0]]
radii = [[1.0]]
colors = [[0, 255, 255, 125]]
v = QtViewer()
sr = v.add_renderer(SphereRenderer, centers, radii, colors)
cr = np.array(centers)
def update(cr=cr):
cr[0][0] += 0.01
sr.update_positions(cr)
v.widget.repaint()
v.schedule(update)
v.run()