本文整理汇总了Python中viewer.Viewer.drawWorld方法的典型用法代码示例。如果您正苦于以下问题:Python Viewer.drawWorld方法的具体用法?Python Viewer.drawWorld怎么用?Python Viewer.drawWorld使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类viewer.Viewer
的用法示例。
在下文中一共展示了Viewer.drawWorld方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: WorkGroup
# 需要导入模块: from viewer import Viewer [as 别名]
# 或者: from viewer.Viewer import drawWorld [as 别名]
#.........这里部分代码省略.........
print("%%")
self.inspector.reset_currentAll()
print("%%%")
# refresh the viewer
self.Refresh()
def remove_field(self, fieldItem, field):
# remove geo from the dictionary
self.list_field.remove(field)
# delete the corresponding item from the inspector
self.fields.remove_field(fieldItem)
self.fields.reset_currentAll()
# refresh the viewer
self.Refresh()
def get_geometry_from_patch(self, patch):
# remove patch from the dictionary
print(("looking for patch ", id(patch)))
for geo in self.list_geo:
for nrb in geo:
print((id(nrb)))
if id(nrb) == id(patch):
print("found.")
return geo
print("Not found.")
def Refresh(self, inspector=False):
if inspector:
self.inspector.Refresh()
# save in temp file
if self.auto_save:
self.save(filename=self.tmp_filename)
self.viewer.drawWorld()
self.viewer.Refresh()
def message(self, txt):
self.viewer.statusbar.SetStatusText(txt)
def save(self, filename=None):
if filename is None:
filename = self.filename
# this means that self.filename is also None
if filename is None:
# Create a save file dialog
from global_vars import CAIDWorkGroupwildcard
dialog = wx.FileDialog ( None\
, style = wx.SAVE | wx.OVERWRITE_PROMPT\
, wildcard=CAIDWorkGroupwildcard)
# Show the dialog and get user input
if dialog.ShowModal() == wx.ID_OK:
filename = dialog.GetPath()
self.filename = filename
# The user did not select anything
else:
print('Nothing was selected.')
# Destroy the dialog
dialog.Destroy()
# ... create xml doc
from xml.dom.minidom import Document
# Create the minidom document
doc = Document()
# Create the <theme> base element
rootElt = self.viewer.theme.save(doc=doc)