本文整理匯總了Python中radialnet.core.Coordinate.PolarCoordinate.get_coordinate方法的典型用法代碼示例。如果您正苦於以下問題:Python PolarCoordinate.get_coordinate方法的具體用法?Python PolarCoordinate.get_coordinate怎麽用?Python PolarCoordinate.get_coordinate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類radialnet.core.Coordinate.PolarCoordinate
的用法示例。
在下文中一共展示了PolarCoordinate.get_coordinate方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: ControlNavigation
# 需要導入模塊: from radialnet.core.Coordinate import PolarCoordinate [as 別名]
# 或者: from radialnet.core.Coordinate.PolarCoordinate import get_coordinate [as 別名]
#.........這裏部分代碼省略.........
@param event: Gtk event of widget
@rtype: boolean
@return: Indicator of the event propagation
"""
self.__moving = None # stop moving
self.__centering = False
self.__rotating = False # stop rotate
self.__move_factor = 1
event.window.set_cursor(gtk.gdk.Cursor(gtk.gdk.LEFT_PTR))
self.queue_draw()
return False
def motion_notify(self, widget, event):
"""
Drawing callback
@type widget: GtkWidget
@param widget: Gtk widget superclass
@type event: GtkEvent
@param event: Gtk event of widget
@rtype: boolean
@return: Indicator of the event propagation
"""
xc, yc = self.__center_of_widget
x, y = self.get_pointer()
status = not self.radialnet.is_in_animation()
status = status and not self.radialnet.is_empty()
if self.__rotating and status:
r, t = self.__rotate_node.get_coordinate()
t = math.degrees(math.atan2(yc - y, x - xc))
if t < 0:
t = 360 + t
self.radialnet.set_rotation(t)
self.__rotate_node.set_coordinate(r, t)
self.queue_draw()
return False
def expose(self, widget, event):
"""
Drawing callback
@type widget: GtkWidget
@param widget: Gtk widget superclass
@type event: GtkEvent
@param event: Gtk event of widget
@rtype: boolean
@return: Indicator of the event propagation
"""
self.set_size_request(120, 130)
self.context = widget.window.cairo_create()
self.__draw()
return False
def __draw_rotate_control(self):
"""
"""