Ejemplo n.º 1
0
    def __init__(self, canvas, controller):
        super(ModeMenu, self).__init__(canvas, 'mode', 'Mode Selection')

        # Store controller instance
        self.controller = controller

        #Store modes from config to populate modemenu with
        self.modes = config.MenuConfig.Modes
        self.getPanel().fontSize(50)

        ##########################
        """creating modes panel"""
        ##########################

        #creating labels for modes
        self.modeLabels = {}

        for l in self.modes.iterkeys():
            self.modeLabels[l] = viz.addText(l, parent=canvas)

        #creating radio buttons for modes
        self.modeGroup = viz.addGroup(parent=canvas)
        self.radioButtons = {}

        for rb in self.modes.iterkeys():
            self.radioButtons[rb] = viz.addRadioButton(self.modeGroup,
                                                       parent=canvas)

        self.radioButtons['Free Play'].set(1)

        #creating grid panel to add mode to
        modeGrid = vizdlg.GridPanel(parent=canvas)

        #adding modes and radio buttons to grid panel
        for i in self.modes.iterkeys():
            modeGrid.addRow([self.modeLabels[i], self.radioButtons[i]])

        ##############################
        """next and back buttons"""
        ##############################

        #creating grid panels to add next and back buttons to
        setGrid = vizdlg.GridPanel(parent=canvas)

        #create back and next buttons and add to grid panel
        backButton = viz.addButtonLabel('Back')
        startButton = viz.addButtonLabel('Next')
        setGrid.addRow([backButton, startButton])

        #add back and state button actions
        self.backward = vizact.onbuttondown(backButton,
                                            self.controller.backMenu)
        self.forward = vizact.onbuttondown(startButton,
                                           self.controller.nextMenu)

        ###############################
        """add items to ModeMenu"""
        ###############################
        self.addItem(modeGrid)
        self.addItem(setGrid)
Ejemplo n.º 2
0
Archivo: notes.py Proyecto: kevinsp/DvB
		def delete3DNote1():

			noteNummer = textBox.get()
			infoBox.remove()
			
			def removeNotePanel():
				notePanel.remove()
				okButton.remove()
				globalVariables.windowOpen = False
				
					
			try:
				if (int(noteNummer)>0):
					noteList[int (noteNummer)-1].remove()
					del noteList[int (noteNummer)-1] #Lösche 3D Notiz
					globalVariables.windowOpen = False
				else:
					raise
			except:
				notePanel = vizinfo.InfoPanel("Bitte nur Nummern im Bereich\nder verfügbaren 3D Notizen eingeben.",align=viz.ALIGN_CENTER,fontSize=25,icon=False,key=None)
				notePanel.visible(True)
				#Erschaffe Bestätigungsbutton
				okButton = viz.addButtonLabel("Ok")
				okButton.setPosition(0.5,0.40)
				okButton.setScale(1,1)
				vizact.onbuttondown(okButton,removeNotePanel)
Ejemplo n.º 3
0
		def porten():
			#Position abfragen und infobox entfernen
			checkPointNummer = portBox.get()
			infoBox.remove()
			
			def removeCheckPointsPanel():
				checkPointsPanel.remove()
				okButton.remove()
				globalVariables.windowOpen = False
				
			try:
				if (int(checkPointNummer)>0): #Prüfe eingabe und porte
					position = checkPointsList[int(checkPointNummer)-1]
					viz.MainView.setPosition(position[0], position[1], position[2])
					tracker.setPosition(position[0], position[1], position[2])
				else:
					raise
			except:

				checkPointsPanel = vizinfo.InfoPanel("Bitte nur Nummern im Bereich\nder verfügbaren Checkpoints eingeben.",align=viz.ALIGN_CENTER,fontSize=25,icon=False,key=None)
				checkPointsPanel.visible(True)
				#Erschaffe Bestätigungsbutton
				okButton = viz.addButtonLabel("Ok")
				okButton.setPosition(0.5,0.40)
				okButton.setScale(1,1)
				vizact.onbuttondown(okButton,removeCheckPointsPanel)
Ejemplo n.º 4
0
    def __init__(self, canvas):
        vizinfo.InfoPanel.__init__(self,
                                   '',
                                   title='In Game',
                                   fontSize=100,
                                   align=viz.ALIGN_CENTER_CENTER,
                                   icon=False,
                                   parent=canvas)

        self.name = 'ingame'
        self.canvas = canvas
        self.active = False
        self.getPanel().fontSize(50)
        self.setPanelVisible(viz.OFF, animate=False)
        self.menuVisible = False

        self.restart = self.addItem(viz.addButtonLabel('Restart'))
        self.end = self.addItem(viz.addButtonLabel('End game'))

        #Callbacks
        vizact.onbuttondown(self.restart, self.restartButton)
        vizact.onbuttondown(self.end, self.endButton)

        #change scale depending on display mode
        self.setScale(*[i * config.menuScale[self.name] for i in [1, 1, 1]])
Ejemplo n.º 5
0
def createCheckpoint():
	
	
	if (globalVariables.windowOpen is False):
		globalVariables.windowOpen = True
		userPosition = viz.MainView.getPosition() #Frage User Position
		#Erschaffe VizInfo Box
		infoBox = vizinfo.add("")
		infoBox.scale(0.8,1)
		infoBox.translate(0.65,0.6)
		infoBox.title("Checkpoint anlegen")

		textBox = infoBox.add(viz.TEXTBOX, "Kommentar:")
		bestaetigeButton = infoBox.add(viz.BUTTON_LABEL, "ok")	

		

		def checkpointHinzufuegen():
			#Füge Checkpoint zur Liste auf 3 Nachkommastellen gerundet an	
			checkPointsList.append([round(userPosition[0],3), round(userPosition[1],3), round(userPosition[2],3), textBox.get()])
			infoBox.remove()
			globalVariables.windowOpen = False
		
		vizact.onbuttondown(bestaetigeButton, checkpointHinzufuegen)	
	else:
		pass
Ejemplo n.º 6
0
Archivo: notes.py Proyecto: kevinsp/DvB
def openTextBox():
	if (globalVariables.windowOpen is False):
		globalVariables.windowOpen = True
		#Erschaffe VizInfo Box
		infoBox = vizinfo.add("")
		infoBox.scale(0.8,1)
		infoBox.translate(0.65,0.6)
		infoBox.title("Setze 3D Text")

		textBox = infoBox.add(viz.TEXTBOX, "Text:")
		bestaetigeButton = infoBox.add(viz.BUTTON_LABEL, "Ok")	
		
		
		
		#Text schreiben und Box + Button löschen
		def writeText():
			text = textBox.get()
			userPosition = viz.MainView.getPosition()
			text3D = viz.addText3D(text, pos = [userPosition[0]-0.2, userPosition[1], userPosition[2] + 0.2])
			text3D.setScale(0.2, 0.2, 0.2)
			text3D.color(viz.RED)
			infoBox.remove()
			noteList.append(text3D)
			globalVariables.windowOpen = False
		vizact.onbuttondown(bestaetigeButton, writeText)	
	else:
		pass
Ejemplo n.º 7
0
		def porten2():
			#Position abfragen und infobox
			posiX = posiXBox.get()
			posiY = posiYBox.get()
			posiZ = posiZBox.get()
			infoBox.remove()

			def removePortPanel():
				checkPointsPanel.remove()
				okButton.remove()
				globalVariables.windowOpen = False
				
			try:
				###Kolissionserkennung einbauen###
				viz.MainView.setPosition(float(posiX), float(posiY), float(posiZ))
				tracker.setPosition(float(posiX), float(posiY), float(posiZ))
				globalVariables.windowOpen = False
			except:
				#####Noch überarbeiten###
				checkPointsPanel = vizinfo.InfoPanel("Fehler",align=viz.ALIGN_CENTER,fontSize=25,icon=False,key=None)
				checkPointsPanel.visible(True)
				#Erschaffe Bestätigungsbutton
				okButton = viz.addButtonLabel("Ok")
				okButton.setPosition(0.5,0.40)
				okButton.setScale(1,1)
				vizact.onbuttondown(okButton,removePortPanel)
Ejemplo n.º 8
0
	def __init__(self, canvas, controller):
		super(ModeMenu, self).__init__(canvas, 'mode', 'Mode Selection')
		
		# Store controller instance
		self.controller = controller
		
		#Store modes from config to populate modemenu with
		self.modes = config.MenuConfig.Modes
		self.getPanel().fontSize(50)
		
		##########################
		"""creating modes panel"""
		##########################
		
		#creating labels for modes
		self.modeLabels = {}
		
		for l in self.modes.iterkeys():
			self.modeLabels[l] = viz.addText(l, parent = canvas)
		
		#creating radio buttons for modes
		self.modeGroup = viz.addGroup(parent = canvas)
		self.radioButtons = {}
		
		for rb in self.modes.iterkeys():
			self.radioButtons[rb] = viz.addRadioButton(self.modeGroup, parent = canvas)
		
		self.radioButtons['Free Play'].set(1)
		
		#creating grid panel to add mode to
		modeGrid = vizdlg.GridPanel(parent = canvas)
		
		#adding modes and radio buttons to grid panel
		for i in self.modes.iterkeys():
			modeGrid.addRow([self.modeLabels[i], self.radioButtons[i]])
		
		##############################
		"""next and back buttons"""
		##############################
		
		#creating grid panels to add next and back buttons to
		setGrid = vizdlg.GridPanel(parent = canvas)
		
		#create back and next buttons and add to grid panel
		backButton = viz.addButtonLabel('Back')
		startButton = viz.addButtonLabel('Next')
		setGrid.addRow([backButton, startButton])
		
		#add back and state button actions
		self.backward = vizact.onbuttondown(backButton, self.controller.backMenu)
		self.forward = vizact.onbuttondown(startButton, self.controller.nextMenu)
		
		###############################
		"""add items to ModeMenu"""
		###############################
		self.addItem(modeGrid)
		self.addItem(setGrid)
Ejemplo n.º 9
0
    def __init__(self, canvas, controller):
        super(InGameMenu, self).__init__(canvas, 'ingame', 'In Game Menu')
        # Store controller instance
        self.controller = controller

        #menu buttons
        self.restart = self.addItem(viz.addButtonLabel('Restart'), fontSize=50)
        self.end = self.addItem(viz.addButtonLabel('End game'), fontSize=50)

        #Callbacks
        vizact.onbuttondown(self.restart, self.controller.restart)
        vizact.onbuttondown(self.end, self.controller.endGame)

        #change scale depending on display mode
        self.setScale(*[i * config.menuScale[self.name] for i in [1, 1, 1]])
Ejemplo n.º 10
0
	def __init__(self,canvas,controller):
		super(InGameMenu, self).__init__(canvas, 'ingame', 'In Game Menu')
		# Store controller instance
		self.controller = controller
		
		#menu buttons
		self.restart = self.addItem(viz.addButtonLabel('Restart'), fontSize = 50)
		self.end = self.addItem(viz.addButtonLabel('End game'), fontSize = 50)
		
		#Callbacks
		vizact.onbuttondown(self.restart, self.controller.restart)
		vizact.onbuttondown(self.end, self.controller.endGame)
		
		#change scale depending on display mode
		self.setScale(*[i*config.menuScale[self.name] for i in [1,1,1]])
Ejemplo n.º 11
0
def porten(tracker):
	
	if (globalVariables.windowOpen is False):
		globalVariables.windowOpen = True
		#Erschaffe VizInfo Box
		infoBox = vizinfo.add("")
		infoBox.scale(0.8,1)
		infoBox.translate(0.65,0.6)
		infoBox.title("Zu beliebige Position porten")

		posiXBox = infoBox.add(viz.TEXTBOX, "X-Koordinate:")
		posiYBox = infoBox.add(viz.TEXTBOX, "Y-Koordinate:")
		posiZBox = infoBox.add(viz.TEXTBOX, "Z-Koordinate:")
		portButton1 = infoBox.add(viz.BUTTON_LABEL, "Porten")	
		

		
		def porten2():
			#Position abfragen und infobox
			posiX = posiXBox.get()
			posiY = posiYBox.get()
			posiZ = posiZBox.get()
			infoBox.remove()

			def removePortPanel():
				checkPointsPanel.remove()
				okButton.remove()
				globalVariables.windowOpen = False
				
			try:
				###Kolissionserkennung einbauen###
				viz.MainView.setPosition(float(posiX), float(posiY), float(posiZ))
				tracker.setPosition(float(posiX), float(posiY), float(posiZ))
				globalVariables.windowOpen = False
			except:
				#####Noch überarbeiten###
				checkPointsPanel = vizinfo.InfoPanel("Fehler",align=viz.ALIGN_CENTER,fontSize=25,icon=False,key=None)
				checkPointsPanel.visible(True)
				#Erschaffe Bestätigungsbutton
				okButton = viz.addButtonLabel("Ok")
				okButton.setPosition(0.5,0.40)
				okButton.setScale(1,1)
				vizact.onbuttondown(okButton,removePortPanel)
		vizact.onbuttondown(portButton1, porten2)
	else:
		pass
Ejemplo n.º 12
0
Archivo: notes.py Proyecto: kevinsp/DvB
def delete3DNote():
	if (globalVariables.windowOpen is False):
		globalVariables.windowOpen = True
		#Erschaffe VizInfo Box
		infoBox = vizinfo.add("")
		infoBox.scale(0.8,1)
		infoBox.translate(0.65,0.6)
		infoBox.title("Lösche 3D Text")

		textBox = infoBox.add(viz.TEXTBOX, "3D Text Nr:")
		bestaetigeButton = infoBox.add(viz.BUTTON_LABEL, "Löschen")		
		
		
		#Checkpoint löschen und Box + Button löschen
		def delete3DNote1():

			noteNummer = textBox.get()
			infoBox.remove()
			
			def removeNotePanel():
				notePanel.remove()
				okButton.remove()
				globalVariables.windowOpen = False
				
					
			try:
				if (int(noteNummer)>0):
					noteList[int (noteNummer)-1].remove()
					del noteList[int (noteNummer)-1] #Lösche 3D Notiz
					globalVariables.windowOpen = False
				else:
					raise
			except:
				notePanel = vizinfo.InfoPanel("Bitte nur Nummern im Bereich\nder verfügbaren 3D Notizen eingeben.",align=viz.ALIGN_CENTER,fontSize=25,icon=False,key=None)
				notePanel.visible(True)
				#Erschaffe Bestätigungsbutton
				okButton = viz.addButtonLabel("Ok")
				okButton.setPosition(0.5,0.40)
				okButton.setScale(1,1)
				vizact.onbuttondown(okButton,removeNotePanel)
		vizact.onbuttondown(bestaetigeButton, delete3DNote1)	
	else:
		pass
Ejemplo n.º 13
0
def portCheckPoint(tracker):
	if (globalVariables.windowOpen is False):
		globalVariables.windowOpen = True
		#Erschaffe VizInfo Box
		infoBox = vizinfo.add("")
		infoBox.scale(0.8,1)
		infoBox.translate(0.65,0.6)
		infoBox.title("Zu Checkpoint porten")

		portBox = infoBox.add(viz.TEXTBOX, "Checkpoint Nr:")
		portButton1 = infoBox.add(viz.BUTTON_LABEL, "Porten")	
		

		
		def porten():
			#Position abfragen und infobox entfernen
			checkPointNummer = portBox.get()
			infoBox.remove()
			
			def removeCheckPointsPanel():
				checkPointsPanel.remove()
				okButton.remove()
				globalVariables.windowOpen = False
				
			try:
				if (int(checkPointNummer)>0): #Prüfe eingabe und porte
					position = checkPointsList[int(checkPointNummer)-1]
					viz.MainView.setPosition(position[0], position[1], position[2])
					tracker.setPosition(position[0], position[1], position[2])
				else:
					raise
			except:

				checkPointsPanel = vizinfo.InfoPanel("Bitte nur Nummern im Bereich\nder verfügbaren Checkpoints eingeben.",align=viz.ALIGN_CENTER,fontSize=25,icon=False,key=None)
				checkPointsPanel.visible(True)
				#Erschaffe Bestätigungsbutton
				okButton = viz.addButtonLabel("Ok")
				okButton.setPosition(0.5,0.40)
				okButton.setScale(1,1)
				vizact.onbuttondown(okButton,removeCheckPointsPanel)
				
		vizact.onbuttondown(portButton1, porten)
Ejemplo n.º 14
0
	def __init__(self,canvas):
		vizinfo.InfoPanel.__init__(self, '',title='In Game',fontSize = 100,align=viz.ALIGN_CENTER_CENTER,icon=False,parent=canvas)
		
		self.name = 'ingame'
		self.canvas = canvas
		self.active = False
		self.getPanel().fontSize(50)
		self.setPanelVisible(viz.OFF, animate = False)
		self.menuVisible = False
		
		
		self.restart = self.addItem(viz.addButtonLabel('Restart'))
		self.end = self.addItem(viz.addButtonLabel('End game'))
		
		#Callbacks
		vizact.onbuttondown(self.restart, self.restartButton)
		vizact.onbuttondown(self.end, self.endButton)
		
		#change scale depending on display mode
		self.setScale(*[i*config.menuScale[self.name] for i in [1,1,1]])
Ejemplo n.º 15
0
    def __init__(self, canvas):
        """initialize the Main menu"""
        vizinfo.InfoPanel.__init__(self, '', fontSize = 100, parent = canvas, align = viz.ALIGN_CENTER_CENTER, \
         title = 'Main Menu', icon = False)

        # Since we are using the vizard pointer, hide system mouse
        viz.mouse.setVisible(False)
        viz.mouse.setTrap(True)
        self.menuVisible = True
        self.canvas = canvas
        self.active = True
        self.name = 'main'

        # add play button, play button action, and scroll over animation
        self.play = self.addItem(viz.addButtonLabel('Play'), fontSize=50)
        vizact.onbuttondown(self.play, self.playButton)

        # add options button row
        self.help = self.addItem(viz.addButtonLabel('Help'), fontSize=50)
        vizact.onbuttondown(self.help, self.helpButton)

        # add help button row
        self.exit = self.addItem(viz.addButtonLabel('Exit'), fontSize=50)
        vizact.onbuttondown(self.exit, self.exitButton)

        #		#rendering
        #		bb = self.getBoundingBox()
        #		self.canvas.setRenderWorldOverlay([bb.width*1.8, bb.height*1.8], fov = bb.height*.1, distance = 1)

        #change scale depending on display mode
        self.setScale(*[i * config.menuScale[self.name] for i in [1, 1, 1]])
Ejemplo n.º 16
0
	def __init__(self, canvas):
		"""initialize the Main menu"""
		vizinfo.InfoPanel.__init__(self, '', fontSize = 100, parent = canvas, align = viz.ALIGN_CENTER_CENTER, \
			title = 'Main Menu', icon = False)
		
		# Since we are using the vizard pointer, hide system mouse
		viz.mouse.setVisible(False)
		viz.mouse.setTrap(True)
		self.menuVisible = True
		self.canvas = canvas
		self.active = True
		self.name = 'main'
		
		# add play button, play button action, and scroll over animation
		self.play = self.addItem(viz.addButtonLabel('Play'), fontSize = 50)
		vizact.onbuttondown(self.play, self.playButton)
		
		# add options button row
		self.help = self.addItem(viz.addButtonLabel('Help'), fontSize = 50)
		vizact.onbuttondown(self.help, self.helpButton)
		
		# add help button row
		self.exit = self.addItem(viz.addButtonLabel('Exit'), fontSize = 50)
		vizact.onbuttondown(self.exit, self.exitButton)
		
#		#rendering
#		bb = self.getBoundingBox()
#		self.canvas.setRenderWorldOverlay([bb.width*1.8, bb.height*1.8], fov = bb.height*.1, distance = 1)
		
		#change scale depending on display mode
		self.setScale(*[i*config.menuScale[self.name] for i in [1,1,1]])
Ejemplo n.º 17
0
	def __init__(self, canvas, controller):
		# Add Virtual Mouse
		canvas.setMouseStyle(viz.CANVAS_MOUSE_VIRTUAL)
		# Store controller instance
		self.controller = controller
	
		"""initialize the Main menu"""
		super(MainMenu, self).__init__(canvas, 'main', 'Main Menu', True)
		
		
		# add play button, play button action, and scroll over animation
		self.play = self.addItem(viz.addButtonLabel('Play'), fontSize = 50)
		vizact.onbuttondown(self.play, self.controller.nextMenu)
		
		# add options button row
		self.Help = self.addItem(viz.addButtonLabel('Help'), fontSize = 50)
		vizact.onbuttondown(self.Help, self.helpButton)
		
		# add help button row
		self.Exit = self.addItem(viz.addButtonLabel('Exit'), fontSize = 50)
		vizact.onbuttondown(self.Exit, self.controller.exitGame)
		
#		#rendering
#		bb = self.getBoundingBox()
#		self.canvas.setRenderWorldOverlay([bb.width*1.8, bb.height*1.8], fov = bb.height*.1, distance = 3)
		
		#change scale depending on display mode
		self.setScale(*[i*config.menuScale[self.name] for i in [1,1,1]])
Ejemplo n.º 18
0
    def __init__(self, canvas, controller):
        # Add Virtual Mouse
        canvas.setMouseStyle(viz.CANVAS_MOUSE_VIRTUAL)
        # Store controller instance
        self.controller = controller
        """initialize the Main menu"""
        super(MainMenu, self).__init__(canvas, 'main', 'Main Menu', True)

        # add play button, play button action, and scroll over animation
        self.play = self.addItem(viz.addButtonLabel('Play'), fontSize=50)
        vizact.onbuttondown(self.play, self.controller.nextMenu)

        # add options button row
        self.Help = self.addItem(viz.addButtonLabel('Help'), fontSize=50)
        vizact.onbuttondown(self.Help, self.helpButton)

        # add help button row
        self.Exit = self.addItem(viz.addButtonLabel('Exit'), fontSize=50)
        vizact.onbuttondown(self.Exit, self.controller.exitGame)

        #		#rendering
        #		bb = self.getBoundingBox()
        #		self.canvas.setRenderWorldOverlay([bb.width*1.8, bb.height*1.8], fov = bb.height*.1, distance = 3)

        #change scale depending on display mode
        self.setScale(*[i * config.menuScale[self.name] for i in [1, 1, 1]])
Ejemplo n.º 19
0
Archivo: notes.py Proyecto: kevinsp/DvB
def port3DNote(tracker):
	if (globalVariables.windowOpen is False):
		globalVariables.windowOpen = True
		#Erschaffe VizInfo Box
		infoBox = vizinfo.add("")
		infoBox.scale(0.8,1)
		infoBox.translate(0.65,0.6)
		infoBox.title("Zu 3D Text porten")

		noteBox = infoBox.add(viz.TEXTBOX, "Text Nr:")
		portButton1 = infoBox.add(viz.BUTTON_LABEL, "Porten")	
		
		def porten():
			#Position abfragen und textbox + button entfernen
			noteNummer = noteBox.get()
			infoBox.remove()
			
			def removeNotePanel():
				notePanel.remove()
				okButton.remove()
			
			try:
				if (int(noteNummer)>0): #Prüfe eingabe und porte
					position = noteList[int(noteNummer)-1].getPosition()
					viz.MainView.setPosition(position[0], position[1], position[2]-0.5)
					tracker.setPosition(position[0], position[1], position[2]-0.5)
				else:
					raise
			except:
				notePanel = vizinfo.InfoPanel("Bitte nur Nummern im Bereich\nder verfügbaren 3D Notizen eingeben.",align=viz.ALIGN_CENTER,fontSize=25,icon=False,key=None)
				notePanel.visible(True)
				#Erschaffe Bestätigungsbutton
				okButton = viz.addButtonLabel("Ok")
				okButton.setPosition(0.5,0.40)
				okButton.setScale(1,1)
				vizact.onbuttondown(okButton,removeNotePanel)
				
		vizact.onbuttondown(portButton1, porten)
	else:
		pass
Ejemplo n.º 20
0
		def deleteCheckpoint1():

			checkpointnummer = textBox.get()
			infoBox.remove()
			globalVariables.windowOpen = False
			
			def removeCheckPointsPanel():
				checkPointsPanel.remove()
				okButton.remove()
		
			try:
				if (int(checkpointnummer)>0):
					del checkPointsList[int (checkpointnummer)-1] #Lösche Checkpoint
				else:
					raise
			except:
				checkPointsPanel = vizinfo.InfoPanel("Bitte nur Nummern im Bereich\nder verfügbaren Checkpoints eingeben.",align=viz.ALIGN_CENTER,fontSize=25,icon=False,key=None)
				checkPointsPanel.visible(True)
				#Erschaffe Bestätigungsbutton
				okButton = viz.addButtonLabel("Ok")
				okButton.setPosition(0.5,0.40)
				okButton.setScale(1,1)
				vizact.onbuttondown(okButton,removeCheckPointsPanel)
Ejemplo n.º 21
0
Archivo: notes.py Proyecto: kevinsp/DvB
		def porten():
			#Position abfragen und textbox + button entfernen
			noteNummer = noteBox.get()
			infoBox.remove()
			
			def removeNotePanel():
				notePanel.remove()
				okButton.remove()
			
			try:
				if (int(noteNummer)>0): #Prüfe eingabe und porte
					position = noteList[int(noteNummer)-1].getPosition()
					viz.MainView.setPosition(position[0], position[1], position[2]-0.5)
					tracker.setPosition(position[0], position[1], position[2]-0.5)
				else:
					raise
			except:
				notePanel = vizinfo.InfoPanel("Bitte nur Nummern im Bereich\nder verfügbaren 3D Notizen eingeben.",align=viz.ALIGN_CENTER,fontSize=25,icon=False,key=None)
				notePanel.visible(True)
				#Erschaffe Bestätigungsbutton
				okButton = viz.addButtonLabel("Ok")
				okButton.setPosition(0.5,0.40)
				okButton.setScale(1,1)
				vizact.onbuttondown(okButton,removeNotePanel)
Ejemplo n.º 22
0
    def __init__(self, canvas):
        vizinfo.InfoPanel.__init__(self,
                                   '',
                                   title='Game Menu',
                                   fontSize=100,
                                   align=viz.ALIGN_CENTER_CENTER,
                                   icon=False,
                                   parent=canvas)
        self.layers = config.layers
        self.modes = config.modes

        self.name = 'game'
        self.canvas = canvas
        self.active = False
        self.getPanel().fontSize(50)
        self.setPanelVisible(viz.OFF, animate=False)

        self.menuVisible = False

        #####################
        '''LAYER TAB PANEL SETUP'''
        #####################

        #creating tab panel tp
        tp = vizdlg.TabPanel(align=viz.ALIGN_LEFT_TOP, parent=canvas)

        #creating sub panels for tab panels(all layer data is stored in config.layers) storing sub panels in laypan
        layPan = {}

        for i, l in enumerate(self.layers):
            layPan[l] = vizdlg.GridPanel(parent=canvas)

        #creating dict of checkboxes for layers
        self.checkBox = {}

        for cb in [cb for l in self.layers.values() for cb in l]:
            self.checkBox[cb] = viz.addCheckbox(parent=canvas)

        #add layers and textboxes to panels
        for i in self.layers:
            for j in self.layers[i]:
                layPan[i].addRow([viz.addText(j), self.checkBox[j]])
            tp.addPanel(i, layPan[i], align=viz.ALIGN_LEFT_TOP)

        ###############################################
        '''CREATING MODES PANEL'''
        ###############################################

        #creating labels for modes
        self.modeLabels = {}

        for l in self.modes.keys():
            self.modeLabels[l] = viz.addText(l, parent=canvas)

        #creating radio buttons for modes
        self.modeGroup = viz.addGroup(parent=canvas)
        self.radioButtons = {}

        for rb in self.modes.keys():
            self.radioButtons[rb] = viz.addRadioButton(self.modeGroup,
                                                       parent=canvas)

        #creating grid panel to add mode to
        modeGrid = vizdlg.GridPanel(parent=canvas)

        #adding modes and radio buttons to grid panel
        for i in self.modes.keys():
            modeGrid.addRow([self.modeLabels[i], self.radioButtons[i]])

        ###################################
        '''CREATE START AND STOP BUTTONS'''
        ###################################

        #creating grid panels to add start and back buttons to
        setGrid = vizdlg.GridPanel(parent=canvas)

        #create back and start buttons and add to grid panel
        backButton = viz.addButtonLabel('Back')
        startButton = viz.addButtonLabel('Start')
        setGrid.addRow([backButton, startButton])

        #add back and state button actions
        vizact.onbuttondown(backButton, self.back)
        vizact.onbuttondown(startButton, self.start)

        ############################
        '''ADD ITEMS TO GAME MENU'''
        ############################

        #directions
        self.addItem(viz.addText(
            'Select Parts of the Skeletal System You Wish to Puzzle and Select a Mode:',
            parent=canvas),
                     fontSize=30,
                     align=viz.ALIGN_LEFT_TOP)

        #add tab panel to info panel
        tp.setCellPadding(5)
        self.addItem(tp, align=viz.ALIGN_LEFT_TOP)

        #modes
        self.addItem(modeGrid, align=viz.ALIGN_LEFT_TOP)

        #start and back buttons
        self.addItem(setGrid, align=viz.ALIGN_RIGHT_TOP)

        #change scale depending on display mode
        self.setScale(*[i * config.menuScale[self.name] for i in [1, 1, 1]])

        #rendering
        bb = self.getBoundingBox()
        self.canvas.setRenderWorldOverlay([bb.width * 1.8, bb.height * 1.8],
                                          fov=bb.height * .1,
                                          distance=1)
Ejemplo n.º 23
0
Archivo: GUI.py Proyecto: kevinsp/DvB
	def __init__(self):
		#viz.window.setFullscreen(True)

		viz.MainWindow.fov(60)
		#viz.window.setFullscreen(True)


		#Popups
		fullscreenItem = vizpopup.Item('Fullscreen')

		mymenu = vizpopup.Menu('Main',[fullscreenItem])



		#Bei Rechtklick Menüaufruf
		vizact.onmouseup(viz.MOUSEBUTTON_RIGHT, self.showMenu)

		#Fullscreen on/off
		vizpopup.onMenuItem(fullscreenItem,viz.window.setFullscreen,viz.TOGGLE)


		#Menübar
		self.menubar = vizmenu.add()
		self.menubar.setVisible(False)

		#Bearbeiten
		self.BearbeitenMenu = self.menubar.add("Bearbeiten")
		self.buttonDateiOeffnen = self.BearbeitenMenu.add(viz.BUTTON_LABEL, "Datei öffnen")
		self.buttonModelEntfernen = self.BearbeitenMenu.add(viz.BUTTON_LABEL, "Model entfernen")

		#Ansicht DropDown
		self.AnsichtsMenu = self.menubar.add("Ansicht")
		self.checkRohre = self.AnsichtsMenu.add(viz.CHECKBOX, "Rohre")
		self.checkWaende = self.AnsichtsMenu.add(viz.CHECKBOX, "Wände")
		self.checkBirdEyeView = self.AnsichtsMenu.add(viz.CHECKBOX, "Vogelperspektive")
		self.checkPointsView = self.AnsichtsMenu.add(viz.CHECKBOX, "Checkpoints")
		self.checkPointSetzen = self.AnsichtsMenu.add(viz.BUTTON_LABEL, "Checkpoint setzen")
		self.checkPointLoeschen = self.AnsichtsMenu.add(viz.BUTTON_LABEL, "Checkpoint löschen")
		self.checkPortButton = self.AnsichtsMenu.add(viz.BUTTON_LABEL, "Zu Checkpoints porten")
		self.noteViewButton = self.AnsichtsMenu.add(viz.CHECKBOX, "Notizen")
		self.deleteNoteButton = self.AnsichtsMenu.add(viz.BUTTON_LABEL, "Lösche 3D Notiz")
		self.notePortButton = self.AnsichtsMenu.add(viz.BUTTON_LABEL, "Zu 3D Notizen porten")
		self.beliebigPortButton = self.AnsichtsMenu.add(viz.BUTTON_LABEL, "Porten")

		#Einfügen DropDown
		self.EinfuegenMenu = self.menubar.add("Einfügen")
		self.buttonNotizEinfuegen = self.EinfuegenMenu.add(viz.BUTTON_LABEL, "Notiz")

		#Optionen DropDown
		self.OptionenMenu = self.menubar.add("Optionen")

		#Alphawert
		self.alphaSlider = self.AnsichtsMenu.add(viz.SLIDER, "Alphawert")
		self.alphaSlider.set(1.0)

		#Steuerung
		viz.mouse(viz.ON)
		viz.mouse.setTrap()
		self.tracker = vizcam.addWalkNavigate(moveScale=2.0)
		self.tracker.setPosition([0,1.8,0])
		self.link = viz.link(self.tracker,viz.MainView)
		viz.mouse.setVisible(False)


		#Erstes Model laden
		self.model = viz.addChild(r'C:\Users\pasca_000\Downloads\CADModellHofner.obj')
		modelIsLoaded = True
		self.model.disable(viz.CULL_FACE)
		self.model.setPosition(0,0,60, viz.ABS_GLOBAL)
		self.model.setEuler([0,0,0])
		viz.collision(viz.ON)

		#Boden laden
		self.ground1 = viz.addChild('ground.osgb')
		self.ground2 = viz.addChild('ground.osgb')
		self.ground2.setPosition(0,0,50)
		
		#Begrüßungsnachricht
		message = """Danke, dass Sie sich für unsere Software entschieden haben.
		\nHier die wichtigsten Shortcuts zum bedienen des Programmes:
		C:   Anzeigen der bereits gesetzten Checkpoints
		N:   Anzeigen der bereits gesetzten 3D Notizen
		V:   Anzeigen der Vogelperspektive
		H:   Anzeigen dieser Hilfe"""
		checkPointsPanel = vizinfo.InfoPanel(message,align=viz.ALIGN_CENTER,fontSize=15,icon=False,key="h")
		checkPointsPanel.visible(True)
		
		
		#Button Definition
		vizact.onbuttondown(self.buttonDateiOeffnen, self.setModel, r'C:\Users\pasca_000\Downloads\CADModellHofner.obj' )
		vizact.onbuttondown(self.buttonModelEntfernen, self.deleteModel)

		#Note Buttons
		vizact.onbuttondown(self.buttonNotizEinfuegen, notes.openTextBox)
		vizact.onbuttondown(self.noteViewButton, notes.noteView, False)
		vizact.onbuttonup(self.noteViewButton, notes.noteView, False)
		vizact.onbuttondown(self.deleteNoteButton, notes.delete3DNote)
		vizact.onbuttondown(self.notePortButton, notes.port3DNote, self.tracker)

		#BirdEyeView Buttons
		vizact.onbuttondown(self.checkBirdEyeView, birdView.enableBirdEyeView)
		vizact.onbuttonup(self.checkBirdEyeView, birdView.enableBirdEyeView)

		#Checkpoints Buttons
		vizact.onbuttondown(self.checkPointsView, checkpoints.checkPoints, False)
		vizact.onbuttonup(self.checkPointsView, checkpoints.checkPoints, False)
		vizact.onbuttondown(self.checkPointSetzen, checkpoints.createCheckpoint)
		vizact.onbuttondown(self.checkPointLoeschen, checkpoints.deleteCheckpoint)
		vizact.onbuttondown(self.checkPortButton, checkpoints.portCheckPoint, self.tracker)

		#Port Button
		vizact.onbuttondown(self.beliebigPortButton, porten.porten, self.tracker)
	
		#Shortcuts
		vizact.onkeydown(viz.KEY_CONTROL_L, mouse.enableDisableMouse, self.tracker, self.link, self.menubar)
		vizact.onkeydown("c", checkpoints.checkPoints, False)
		vizact.onkeydown("v", birdView.enableBirdEyeView)
		vizact.onkeydown("n", notes.noteView, False)
Ejemplo n.º 24
0
	def __init__(self,canvas):
		vizinfo.InfoPanel.__init__(self, '',title = 'Game Menu',fontSize = 100,align=viz.ALIGN_CENTER_CENTER,icon=False,parent= canvas)
		self.layers = config.layers
		self.modes = config.modes
		
		self.name = 'game'
		self.canvas = canvas
		self.active = False
		self.getPanel().fontSize(50)
		self.setPanelVisible(viz.OFF, animate = False)

		self.menuVisible = False	
		
		#####################
		'''LAYER TAB PANEL SETUP'''
		#####################
		
		#creating tab panel tp 
		tp = vizdlg.TabPanel(align = viz.ALIGN_LEFT_TOP, parent = canvas)
		
		#creating sub panels for tab panels(all layer data is stored in config.layers) storing sub panels in laypan
		layPan = {}
		
		for i, l in enumerate(self.layers):
			layPan[l] = vizdlg.GridPanel(parent = canvas)
		
		#creating dict of checkboxes for layers
		self.checkBox = {}
		
		for cb in [cb for l in self.layers.values() for cb in l]:
			self.checkBox[cb] = viz.addCheckbox(parent = canvas)
		
		#add layers and textboxes to panels
		for i in self.layers:
			for j in self.layers[i]:
				layPan[i].addRow([viz.addText(j), self.checkBox[j]])
			tp.addPanel(i, layPan[i], align = viz.ALIGN_LEFT_TOP)
		
		###############################################
		'''CREATING MODES PANEL'''
		###############################################
		
		#creating labels for modes
		self.modeLabels = {}
		
		for l in self.modes.keys():
			self.modeLabels[l] = viz.addText(l, parent = canvas)
		
		#creating radio buttons for modes
		self.modeGroup = viz.addGroup(parent = canvas)
		self.radioButtons = {}
		
		for rb in self.modes.keys():
			self.radioButtons[rb] = viz.addRadioButton(self.modeGroup, parent = canvas)
		
		#creating grid panel to add mode to
		modeGrid = vizdlg.GridPanel(parent = canvas)
		
		#adding modes and radio buttons to grid panel
		for i in self.modes.keys():
			modeGrid.addRow([self.modeLabels[i], self.radioButtons[i]])
		
		###################################
		'''CREATE START AND STOP BUTTONS'''
		###################################
		
		#creating grid panels to add start and back buttons to
		setGrid = vizdlg.GridPanel(parent = canvas)
		
		#create back and start buttons and add to grid panel
		backButton = viz.addButtonLabel('Back')
		startButton = viz.addButtonLabel('Start')
		setGrid.addRow([backButton, startButton])
		
		#add back and state button actions
		vizact.onbuttondown(backButton, self.back)
		vizact.onbuttondown(startButton, self.start)
		
		############################
		'''ADD ITEMS TO GAME MENU'''
		############################
		
		#directions
		self.addItem(viz.addText('Select Parts of the Skeletal System You Wish to Puzzle and Select a Mode:', parent = canvas), fontSize = 30, align = viz.ALIGN_LEFT_TOP)
		
		#add tab panel to info panel
		tp.setCellPadding(5)
		self.addItem(tp, align = viz.ALIGN_LEFT_TOP)
		
		#modes
		self.addItem(modeGrid, align = viz.ALIGN_LEFT_TOP)
	
		#start and back buttons
		self.addItem(setGrid, align = viz.ALIGN_RIGHT_TOP)
		
		#change scale depending on display mode
		self.setScale(*[i*config.menuScale[self.name] for i in [1,1,1]])
		
		#rendering
		bb = self.getBoundingBox()
		self.canvas.setRenderWorldOverlay([bb.width*1.8, bb.height*1.8], fov = bb.height*.1, distance = 1)
Ejemplo n.º 25
0
	def __init__(self,canvas,controller):
		super(LayerMenu, self).__init__(canvas, 'layer', 'Layer Selection')
		
		# Store controller instance
		self.controller = controller
		
		#Store region, layer, and mode data from config to populate menu
		self.regions = config.OntologicalGroups.regions #collections.OrderedDict type
		self.layers = config.OntologicalGroups.layers #collections.OrderedDict type
		self.modes = config.MenuConfig.Modes
		self.getPanel().fontSize(50)
		
		#####################
		'''LAYER TAB PANEL SETUP'''
		#####################
		
		#creating tab panel tp 
		byRegionPanel = vizdlg.TabPanel(align = viz.ALIGN_LEFT_TOP, parent = canvas)
		
		#creating sub panels for tab panels(all layer data is stored in config.layers) storing sub panels in laypan
		layPan = {}
		
		for i, l in enumerate(self.regions.iteritems()):
			layPan[l[0]] = vizdlg.GridPanel(parent = canvas, fontSize = 50)
		
		#creating dict of checkboxes for layers
		self.checkBox = {}
		
		for key in self.regions.iterkeys():
			self.checkBox[key] = {}
			for cb in self.layers.iterkeys():
				self.checkBox[key][cb] = viz.addCheckbox(parent = canvas)
				
		#remove checkboxes from non-functioning region-layer selections
		for key in config.MenuConfig.RemoveCheckFromTab.iterkeys():
			for cb in config.MenuConfig.RemoveCheckFromTab[key]:
				self.checkBox[key][cb].disable()
		
		#populate panels with layers and checkboxes
		for i in self.regions.iterkeys():
			for j in self.layers.iterkeys():
				layPan[i].addRow([viz.addText(j), self.checkBox[i][j]])
			byRegionPanel.addPanel(i, layPan[i], align = viz.ALIGN_LEFT_TOP)
		
		#############################################
		"""CREATE TOTAL LAYER SELECTION CHECKBOXES"""
		#############################################
		
		#creating grib panel to put checkboxes on
		selectAllPanel = vizdlg.GridPanel(parent = canvas, fontSize = 50)
		
		#creating checkboxes
		self.selectAllOf = {}
		
		for i in self.layers.iterkeys():
			self.selectAllOf[i] = viz.addCheckbox(parent = canvas)
		
		#adding checkboxes to panel
		for i in self.layers:
			selectAllPanel.addRow([viz.addText('Load All ' + i, fontSize = 50), self.selectAllOf[i]])
		
		###################################
		'''CREATE START AND STOP BUTTONS'''
		###################################
		
		#creating grid panels to add start and back buttons to
		setGrid = vizdlg.GridPanel(parent = canvas)
		
		#create back and start buttons and add to grid panel
		backButton = viz.addButtonLabel('Back')
		startButton = viz.addButtonLabel('Start')
		setGrid.addRow([backButton, startButton])
		
		#add back and state button actions
		vizact.onbuttondown(backButton, self.controller.backMenu)
		vizact.onbuttondown(startButton, lambda: viztask.schedule(self.controller.start))
		
		############################
		'''ADD ITEMS TO GAME MENU'''
		############################
		
		#add tab panel to info panel
		byRegionPanel.setCellPadding(5)
		self.addItem(byRegionPanel, align = viz.ALIGN_LEFT_TOP)
		
		#add grid panel to info panel
		self.addItem(selectAllPanel, align = viz.ALIGN_LEFT_TOP)
	
		#start and back buttons
		self.addItem(setGrid, align = viz.ALIGN_RIGHT_TOP)
		
		#change scale depending on display mode
		self.setScale(*[i*config.menuScale[self.name] for i in [1,1,1]])
		
		#rendering
		bb = self.getBoundingBox()
		self.canvas.setRenderWorldOverlay([bb.width*1.8, bb.height*1.8], fov = bb.height*.1, distance = 1)

		#############################
		"""BUTTON CALLBACK"""
		#############################
		
		viz.callback(viz.BUTTON_EVENT, controller.onAllSelection)
Ejemplo n.º 26
0
    def __init__(self, canvas, controller):
        super(LayerMenu, self).__init__(canvas, 'layer', 'Layer Selection')

        # Store controller instance
        self.controller = controller

        #Store region, layer, and mode data from config to populate menu
        self.regions = config.OntologicalGroups.regions  #collections.OrderedDict type
        self.layers = config.OntologicalGroups.layers  #collections.OrderedDict type
        self.modes = config.MenuConfig.Modes
        self.getPanel().fontSize(50)

        #####################
        '''LAYER TAB PANEL SETUP'''
        #####################

        #creating tab panel tp
        byRegionPanel = vizdlg.TabPanel(align=viz.ALIGN_LEFT_TOP,
                                        parent=canvas)

        #creating sub panels for tab panels(all layer data is stored in config.layers) storing sub panels in laypan
        layPan = {}

        for i, l in enumerate(self.regions.iteritems()):
            layPan[l[0]] = vizdlg.GridPanel(parent=canvas, fontSize=50)

        #creating dict of checkboxes for layers
        self.checkBox = {}

        for key in self.regions.iterkeys():
            self.checkBox[key] = {}
            for cb in self.layers.iterkeys():
                self.checkBox[key][cb] = viz.addCheckbox(parent=canvas)

        #remove checkboxes from non-functioning region-layer selections
        for key in config.MenuConfig.RemoveCheckFromTab.iterkeys():
            for cb in config.MenuConfig.RemoveCheckFromTab[key]:
                self.checkBox[key][cb].disable()

        #populate panels with layers and checkboxes
        for i in self.regions.iterkeys():
            for j in self.layers.iterkeys():
                layPan[i].addRow([viz.addText(j), self.checkBox[i][j]])
            byRegionPanel.addPanel(i, layPan[i], align=viz.ALIGN_LEFT_TOP)

        #############################################
        """CREATE TOTAL LAYER SELECTION CHECKBOXES"""
        #############################################

        #creating grib panel to put checkboxes on
        selectAllPanel = vizdlg.GridPanel(parent=canvas, fontSize=50)

        #creating checkboxes
        self.selectAllOf = {}

        for i in self.layers.iterkeys():
            self.selectAllOf[i] = viz.addCheckbox(parent=canvas)

        #adding checkboxes to panel
        for i in self.layers:
            selectAllPanel.addRow([
                viz.addText('Load All ' + i, fontSize=50), self.selectAllOf[i]
            ])

        ###################################
        '''CREATE START AND STOP BUTTONS'''
        ###################################

        #creating grid panels to add start and back buttons to
        setGrid = vizdlg.GridPanel(parent=canvas)

        #create back and start buttons and add to grid panel
        backButton = viz.addButtonLabel('Back')
        startButton = viz.addButtonLabel('Start')
        setGrid.addRow([backButton, startButton])

        #add back and state button actions
        vizact.onbuttondown(backButton, self.controller.backMenu)
        vizact.onbuttondown(startButton,
                            lambda: viztask.schedule(self.controller.start))

        ############################
        '''ADD ITEMS TO GAME MENU'''
        ############################

        #add tab panel to info panel
        byRegionPanel.setCellPadding(5)
        self.addItem(byRegionPanel, align=viz.ALIGN_LEFT_TOP)

        #add grid panel to info panel
        self.addItem(selectAllPanel, align=viz.ALIGN_LEFT_TOP)

        #start and back buttons
        self.addItem(setGrid, align=viz.ALIGN_RIGHT_TOP)

        #change scale depending on display mode
        self.setScale(*[i * config.menuScale[self.name] for i in [1, 1, 1]])

        #rendering
        bb = self.getBoundingBox()
        self.canvas.setRenderWorldOverlay([bb.width * 1.8, bb.height * 1.8],
                                          fov=bb.height * .1,
                                          distance=1)

        #############################
        """BUTTON CALLBACK"""
        #############################

        viz.callback(viz.BUTTON_EVENT, controller.onAllSelection)
Ejemplo n.º 27
0
    #this would be a for-ever loop
    while END == False:
        global PC
        PC = 0
        global PID
        PID = 0
        for r in range(0, 10):
            PID = GRAPHIC_RAM[r][0]
            PC = GRAPHIC_RAM[r][1]
            if GRAPHIC_RAM[r][0].get() != "TERMINATED":
                RunProgram(PROGRAMSQUEUE[r], int(GRAPHIC_RAM[r][5].get()),
                           int(GRAPHIC_RAM[r][1].get()))
                yield time.sleep(1)


vizact.onbuttondown(START, viztask.schedule, getPCB)

for build in range(0, 5):
    procspace.addItem(viz.addText("                  "))
    procspace.alpha(0)

proc = procspace.addItem(viz.add('Processor.osgb'))
proc.visible(False)
#==============================================================

procspace.addItem(
    viz.addText(
        '                                                                                '
    ))
#output=vizdlg.Panel(layout=vizdlg.ALIGN_LEFT_TOP,border=False,align=viz.ALIGN_LEFT_TOP,fontSize=20)
output = vizinfo.InfoPanel(align=viz.ALIGN_RIGHT_CENTER, fontSize=20)
Ejemplo n.º 28
0
slider_speed.set(0.1)

controlPanel.addSection('Loop Mode')
radio_loop_off = controlPanel.addLabelItem('Off', viz.addRadioButton('LoopMode'))
radio_loop_on = controlPanel.addLabelItem('Loop', viz.addRadioButton('LoopMode'))
radio_loop_swing = controlPanel.addLabelItem('Swing', viz.addRadioButton('LoopMode'))
radio_loop_circular = controlPanel.addLabelItem('Circular', viz.addRadioButton('LoopMode'))
radio_loop_circular.set(1)

controlPanel.addSection('Interpolation Mode')
radio_interp_linear = controlPanel.addLabelItem('Linear', viz.addRadioButton('InterpolationMode'))
radio_interp_cubic = controlPanel.addLabelItem('Bezier', viz.addRadioButton('InterpolationMode'))
radio_interp_linear.set(1)

def changeSpeed(pos):
    #Adjust the speed of the animation path
    path.setSpeed(pos*10)

#Setup callbacks for slider events
vizact.onslider(slider_speed, changeSpeed)

#Setup button click events
vizact.onbuttondown(radio_loop_off,path.setLoopMode,viz.OFF)
vizact.onbuttondown(radio_loop_on,path.setLoopMode,viz.LOOP)
vizact.onbuttondown(radio_loop_swing,path.setLoopMode,viz.SWING)
vizact.onbuttondown(radio_loop_circular,path.setLoopMode,viz.CIRCULAR)
vizact.onbuttondown(radio_interp_linear,path.setTranslateMode,viz.LINEAR_INTERP)
vizact.onbuttondown(radio_interp_cubic,path.setTranslateMode,viz.CUBIC_BEZIER)

# Reset path
vizact.onkeydown(' ', path.reset)