本文整理汇总了Python中Plasma.ptPoint3方法的典型用法代码示例。如果您正苦于以下问题:Python Plasma.ptPoint3方法的具体用法?Python Plasma.ptPoint3怎么用?Python Plasma.ptPoint3使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Plasma
的用法示例。
在下文中一共展示了Plasma.ptPoint3方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ImportMarkers
# 需要导入模块: import Plasma [as 别名]
# 或者: from Plasma import ptPoint3 [as 别名]
def ImportMarkers(args):
"args = 'filename folder'"
import Plasma
import PlasmaVaultConstants
arglist = args.split()
if len(arglist) < 2:
print 'ERROR - not enough arguments - ImportMarkers "filename foldername")'
return
filename = arglist[0]
try:
dfile = open(filename+'.py','r')
except IOError:
print "ERROR - file %d could not be found" % (filename+'.py')
return
dfile.close()
argresidual = args[len(filename)+1:]
#== find the folder where the markerfolders might be
# search thru the age journal folders
vault = Plasma.ptVault()
jfolder = None
master_agefolder = vault.getAgeJournalsFolder()
if type(master_agefolder) != type(None):
agefolderRefs = master_agefolder.getChildNodeRefList()
for agefolderRef in agefolderRefs:
agefolder = agefolderRef.getChild()
agefolder = agefolder.upcastToFolderNode()
if type(agefolder) != type(None):
# might be a foldername with spaces! so see if it starts with the name
if argresidual.startswith(agefolder.folderGetName()):
jfolder = agefolder
argresidual = argresidual[len(agefolder.folderGetName())+1:]
if jfolder:
exec("import %s" % (filename))
exec("mgs = %s.mgs" % (filename))
for mg in mgs:
# need to try to find the game to stick these in
jfolderRefs = jfolder.getChildNodeRefList()
for jref in jfolderRefs:
jnode = jref.getChild()
jnode = jnode.upcastToMarkerListNode()
# is it a marker folder list?
if type(jnode) != type(None):
# is it named the right one?
if jnode.folderGetName() == mg[1]:
# yes, add the markers to this game
for marker in mg[0][4]:
nMarker = Plasma.ptVaultMarkerNode(PlasmaVaultConstants.PtVaultNodePermissionFlags.kDefaultPermissions)
nMarker.markerSetText(marker[0])
pos = Plasma.ptPoint3(marker[1],marker[2],marker[3])
nMarker.markerSetPosition(pos)
nMarker.markerSetAge(marker[4])
nMarker.markerSetGPS(marker[5],marker[6],marker[7])
jnode.addNode(nMarker)