本文整理汇总了Python中shapely.geometry.Point.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Point.__init__方法的具体用法?Python Point.__init__怎么用?Python Point.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类shapely.geometry.Point
的用法示例。
在下文中一共展示了Point.__init__方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from shapely.geometry import Point [as 别名]
# 或者: from shapely.geometry.Point import __init__ [as 别名]
def __init__(self, char, center, cells):
pygame.sprite.Sprite.__init__(self)
Point.__init__(self, center)
self.mobility = 1
# This is the unique name/address of the phone.
self.id = char
# These are all of the PCS cells in which this phone can be within.
self.cells = cells
# This is the geographic cell in which the phone is within. The center of
# this cell has a base station with which this phone can connect with
# to make calls, register its location, etc.
self.num_writes = 0
self.num_reads = 0
self.PCS_cell = None
for h in self.cells:
if h.contains(self):
self.PCS_cell = h
# These member variables are required for this Phone class to be a
# sprite.
self.image = pygame.image.load(
os.path.join(ABS_PATH, "phone.png")
).convert_alpha()
self.rect = self.image.get_rect()
self.rect.center = transform_points_for_pygame([center])[0]
# If the phone is moved, the offset vector will be updated. It is a
# direction vector.
self.offset = (0,0)
# The label is drawn on top of the sprite.
label_font = pygame.font.SysFont("monospace", 15)
self.label = label_font.render(char, True, (255, 255, 255))
self.draw_text()