本文整理匯總了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()