Exemplo n.º 1
0
 def initialize3D(self):
     """Sets up the 3D world, including 3D dictionaries, a base group, and
     access to the panel as a 3D object"""
     if self.objectDictionary.has_key("___rootObject___") is False:
         QBaseGroup(self)
         QPanelGroup(self)
         QRootGroup(self)
         Proxy.send(self, "initialize3D")
Exemplo n.º 2
0
 def drawOffsetScaled(self, xloc, yloc, xscale, yscale, toCanvas=None):
     """drawOffsetScaled draws the display list at the specified offset and scale locations. If the
     canvas is undefined, it defaults to the main canvas"""
     if toCanvas is not None:
         targetName = toCanvas.name
     else:
         targetName = "__mainCanvas__"
     Proxy.send(self.panel, "drawDisplayListOS", self.name, xloc, yloc,
                xscale, yscale, targetName)
Exemplo n.º 3
0
 def draw(self, toCanvas=None):
     """ draw(toCanvas) draws the display list to the specified canvas. If the canvas is undefined, it
     defaults to the main canvas."""
     if toCanvas is not None:
         targetName = toCanvas.name
     else:
         targetName = "__mainCanvas__"
     Proxy.send(self.panel, "drawDisplayListOS", self.name, 0, 0, 1, 1,
                targetName)
Exemplo n.º 4
0
 def __init__(self, panel, tClass, name=None):
     """Initializes the canvas for a given panel.
     wClass is the Teleplace class name.
     name is a reference id, usually None, which means this is a new
     object and a name will be generated.
     """
     self.panel = panel
     self.tClass = tClass
     self.changeAction = None
     if (name is None):
         self.name = self.panel.generateName()
         Proxy.send(self.panel, "makeWidget", tClass, self.name)
     else:
         self.name = name
     panel.objectDictionary[self.name] = self
Exemplo n.º 5
0
 def __init__(self, panel, tClass, name = None):
     """Initializes the canvas for a given panel.
     wClass is the Teleplace class name.
     name is a reference id, usually None, which means this is a new
     object and a name will be generated.
     """
     self.panel = panel
     self.tClass = tClass
     self.changeAction = None
     if(name is None):
         self.name = self.panel.generateName()
         Proxy.send(self.panel, "makeWidget", tClass, self.name)
     else:
         self.name = name
     panel.objectDictionary[self.name]=self
Exemplo n.º 6
0
 def saveFilePath(self, userID, path, data, fileDesc, fileExt, dialogLabel, callback):
     """ Find a file and return the file name
     fileDesc - describe the file type
     fileExt - a string with all suffexes, separated by ;
     dialogLabel - a string with the label for the file dialog"""
     self['__saveFileData__'] = data
     return Proxy.send(self, "saveFilePath", userID, path, fileDesc, fileExt, dialogLabel, callback)
Exemplo n.º 7
0
 def __init__(self, panel, name=None):
     """Initializes a display list"""
     self.panel = panel
     self.qClass = "PDisplayList"
     if (name is None):
         self.name = Proxy.send(self.panel, "makeNew", self.qClass)
     else:
         self.name = name
     panel.objectDictionary[self.name] = self
Exemplo n.º 8
0
 def __getitem__(self, key):
     """Implementer of the return value for myValue = self.panel["myKey"]"""
     rval = Proxy.send(self, "getItem", key)
     if(type(rval)==tuple): #is this a tuple?
         if(len(rval)==3): #of length 3?
             if(rval[0]=="__sharedObject__" or rval[0]=="__3DObject__"): #a shared Object?
                 if(self.objectDictionary.has_key(rval[2])): #already loaded?
                     rval = self.objectDictionary[rval[2]]
                 else:
                     rval =  eval(rval[1])(self, rval[2])
     return rval
Exemplo n.º 9
0
 def __init__(self, panel, tclass, name):
     """ initialization of QBasic and most of its sub-classes
     panel is the main shared panel object used for communication
     tclass is the internal class name of the object
     name is typically a dynamically generated shared name between Teleplace and Python
     """
     self.panel = panel
     self.tClass = tclass
     if(name is None):
          self.name = Proxy.send(self.panel, "makeNew", self.tClass)
     else:
         self.name = name
     panel.objectDictionary[self.name]=self
Exemplo n.º 10
0
 def __init__(self, panel, tclass, name):
     """ initialization of QBasic and most of its sub-classes
     panel is the main shared panel object used for communication
     tclass is the internal class name of the object
     name is typically a dynamically generated shared name between Teleplace and Python
     """
     self.panel = panel
     self.tClass = tclass
     if (name is None):
         self.name = Proxy.send(self.panel, "makeNew", self.tClass)
     else:
         self.name = name
     panel.objectDictionary[self.name] = self
Exemplo n.º 11
0
 def test2(self, arg1, arg2):
     """Simple test callback"""
     return Proxy.send(self, "test2", arg1, arg2)
Exemplo n.º 12
0
	def moveTowards(self, target, amount, distance):
		"Move towards the given target by the specified amount"
		Proxy.send(self, "moveTowards:amount:distance:", target, amount, distance)
Exemplo n.º 13
0
	def stopStepping(self, function):
		"Stop stepping the given function"
		Proxy.send(self, "stopStepping:", function)
Exemplo n.º 14
0
	def playSound(self, soundName):
		"Play the sound with the given name"
		Proxy.send(self, "playSound:", soundName)
Exemplo n.º 15
0
	def translateBy(self, deltaX, deltaY, deltaZ):
		"Translate this frame by delta X, Y, and Z"
		Proxy.send(self, "translateByX:y:z:", deltaX, deltaY, deltaZ)
Exemplo n.º 16
0
	def __getattr__(self, item):
		"Query Croquet about this value"
		value = Proxy.send(self, "pyGet:", item)
		if(value <> None): object.__setattr__(self, item, value)
		return value
Exemplo n.º 17
0
	def schedule(self):
		Proxy.send(target, "future:invoke:", msecs, self)
Exemplo n.º 18
0
 def println(self, obj, replicated = False):
     """Prints obj into the Teleplace transcript"""
     Proxy.send(self, "println", str(obj),replicated)
Exemplo n.º 19
0
 def test3(self, arg1, arg2, arg3):
     """Simple test callback"""
     return Proxy.send(self, "test3", arg1, arg2, arg3)
Exemplo n.º 20
0
 def getUserID(self):
     """Retrieves the ID for the local user"""
     return Proxy.send(self, "getUserID")
Exemplo n.º 21
0
 def getBaseUserName(self):
     """Retrive the _base_ user name - the guy that created and is running the doc"""
     return Proxy.send(self, "getBaseUserName")
Exemplo n.º 22
0
 def apiVersion(self):
     """Retrieves the Panel API version which is the version string of the Teleplace Client. """
     return Proxy.send(self, "apiVersion")
Exemplo n.º 23
0
 def getUserColor(self, uid):
     """Retrieves the color for a user"""
     return QColor.fromRGBA(Proxy.send(self, "getUserColor", uid))
Exemplo n.º 24
0
	def __setattr__(self, item, value):
		"Inform Croquet about changing the value"
		Proxy.send(self, "pySet:to:", item, value)
		return object.__setattr__(self, item, value)
Exemplo n.º 25
0
 def getUserName(self, uid):
     """Retrieves the preferred screen name for a user"""
     return Proxy.send(self, "getUserName", uid)
Exemplo n.º 26
0
	def addRotationAroundZ(self, angle):
		"Add to the rotation around the y-axis"
		Proxy.send(self, "addRotationAroundZ:", angle)
Exemplo n.º 27
0
 def getUserLogin(self, uid):
     """Retrieves the login string for a user"""
     return Proxy.send(self, "getUserLogin", uid)
Exemplo n.º 28
0
	def colorize(self, r, g, b):
		"Translate this frame by delta X, Y, and Z"
		Proxy.send(self, "colorizeR:g:b:", r, g, b)
Exemplo n.º 29
0
 def getServiceURL(self, uid):
     self.initialize3D()
     return Proxy.send(self, "get", "___rootObject___", "serviceURL")
Exemplo n.º 30
0
	def startStepping(self, function):
		"Start stepping the given function"
		Proxy.send(self, "startStepping:", function)
Exemplo n.º 31
0
 def getCurrentOrgName(self):
     return Proxy.send(self, "getCurrentOrgName")
Exemplo n.º 32
0
	def random(self, maxValue):
		"Answer a random number between 0.0 and maxValue"
		return Proxy.send(self, "random:", maxValue)
Exemplo n.º 33
0
 def test0(self):
     """Simple test callback"""
     return Proxy.send(self, "test0")
Exemplo n.º 34
0
	def removeAllScripts(self):
		"Remove all scripts"
		Proxy.send(self, "removeAllScripts")
Exemplo n.º 35
0
 def test1(self, arg1):
     """Simple test callback"""
     return Proxy.send(self, "test1", arg1)