本文整理汇总了Python中surface.Surface.create方法的典型用法代码示例。如果您正苦于以下问题:Python Surface.create方法的具体用法?Python Surface.create怎么用?Python Surface.create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类surface.Surface
的用法示例。
在下文中一共展示了Surface.create方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: addLayers
# 需要导入模块: from surface import Surface [as 别名]
# 或者: from surface.Surface import create [as 别名]
def addLayers(self, final_n):
"""Add layers until the number of layers equals final_n."""
if final_n > settings.max_number_of_layers:
return
if final_n >= len(self.layers):
for i in range(final_n - len(self.layers) + 1):
layer = Surface.create(self)
layer.atom_types = self.substrate_atom_types
layer.hide()
self.layers.append(layer)
示例2: __init__
# 需要导入模块: from surface import Surface [as 别名]
# 或者: from surface.Surface import create [as 别名]
def __init__(self, parent):
super(MolecularScene, self).__init__(parent)
self.surface = Surface.create(self)
self.surface.atom_types = settings.surface_atom_types[:]
self.substrate_atom_types = settings.substrate_atom_types[:]
self.layers = [self.surface]
self.addLayers(settings.number_of_layers)
self.current_layer_i = 0
self.current_layer = self.layers[self.current_layer_i]
self.peek_layer = None
self.selection_box = None
self.drag_border = None
self.draw_mode = DRAW_ALL
self.updateSceneRect()
self.update()