Esempio n. 1
0
def main():
    '''Main loop which initialises embedder application'''

    app = QtGui.QApplication(sys.argv)

    w = MainWindow()
    w.show()

    sys.exit(app.exec_())
Esempio n. 2
0
def _main():
    # Must assign an instance of QApplication to a variable otherwise a Segmentation Fault will occur.
    app = QApplication(sys.argv)
    # Must assign an instance of MainWindow to a variable otherwise the main window won't display.
    main_window = MainWindow(sys.argv[1])

    main_window.show()
    # Keep the program running.
    sys.exit(app.exec_())
Esempio n. 3
0
class CinemolApp(object):
    def __init__(self):
        pass

    def launch(self):
        self.app = QApplication(sys.argv)
        self.app.setOrganizationName("rotatingpenguin.com")
        self.app.setApplicationName("Cinemol")
        self.mainWin = MainWindow()
        self.renderer = CinemolRenderer()
        # self.renderer.actors.append(Sphere2TestScene())
        self.renderer.actors.append(FiveBallScene())
        # self.renderer.actors.append(TeapotActor())
        self.mainWin.ui.glCanvas.set_gl_renderer(self.renderer)
        console_context.cm._set_app(self)
        self.mainWin.show()
        sys.exit(self.app.exec_())
Esempio n. 4
0
def run(args):

    #if img_symlink_dir:

        #print 'creating image symlinks...'

        #if not os.path.isdir(img_symlink_dir):
            #os.mkdir(img_symlink_dir)

        #for i in xrange(len(pdc.images)):

            #img = pdc.images[i]
            #imgId = img.index
            #imgFiles = img.imageFiles

            #for name,path in imgFiles:
                #symlink_name = '%04d_%s.tif' % (imgId, name)
                #symlink_path = os.path.join(img_symlink_dir, symlink_name)
                #os.symlink(path, symlink_path)

        #print 'finished creating image symlinks'

    TRY_OPENGL = args.opengl
    project_file = args.project_file
    start_pipeline = args.run_filtering

    app = QApplication(sys.argv)

    #mainwindow = MainWindow(simple_ui)
    mainwindow = MainWindow()
    mainwindow.show()

    if project_file:
        mainwindow.load_project_file(project_file)
        if start_pipeline:
            mainwindow.on_start_cancel()

    app.exec_()
    mainwindow.close()

    """importer = mainwindow.importer
Esempio n. 5
0
    parser = argparse.ArgumentParser(description="Koshka - MSP project")

    parser.add_argument("score", nargs="?", type=str, default=DEFAULT_SCORE_FILE)
    parser.add_argument("--no_gui", type=bool, default=False, const=True, nargs="?")
    parser.add_argument("-l", "--loop", type=int, default=0, const=GridSequencer.INFINIT_LOOP, nargs="?")
    namespace = parser.parse_args()

    if namespace.no_gui:
        dac = DAC()
        dac.start()
        try:
            sequencer = GridSequencer(namespace.score, buffer_size=dac.bufferSize, sample_rate=dac.getSamplerate())
            dac.connect(sequencer.callback)
            sequencer.play(namespace.loop)

            while sequencer.running:
                sleep(0.1)

        finally:
            dac.stop()

    else:
        from gui.main_window import MainWindow

        window = MainWindow(namespace)

        window.mainloop()
        window = None

    exit()
Esempio n. 6
0
#! /bin/python

from PyQt5.QtWidgets import *
from gui.frist_dialog import FirstDialog
from gui.main_window import MainWindow


if __name__ == '__main__':
    import sys

    app = QApplication(sys.argv)
    dialog = FirstDialog()
    dialog.setModal(True)
    if dialog.exec() == QDialog.Accepted:
        main_window = MainWindow(file=dialog.get_log_path())
        main_window.show()
    else:
        sys.exit(0)
    sys.exit(app.exec_())
Esempio n. 7
0
from example_interactive_water_particles.water_particle import WaterParticle
from gui.input_listeners.game_like_input_listener import GameLikeInputListener
from gui.main_window import MainWindow
from gui.paintables.paintable_polyhedron import PaintablePolyhedron
from physics.force_generator.gravity_force_generator import GravityForceGenerator
from physics.physics_simulator import PhysicsSimulator


# Controls the number of simulated particles.
N_PARTICLES = 500


if __name__ == '__main__':
    main_window = MainWindow("Water Particles Example", 400, 400)
    main_window.setInputListener(GameLikeInputListener(main_window))

    simulator = PhysicsSimulator()
    for i in xrange(N_PARTICLES):
        # Add particle to simulator
        particle = WaterParticle()
        simulator.addForceGenerator(GravityForceGenerator(particle))
        simulator.addBody(particle)
        # Add particle to scene
        particle_painter = PaintablePolyhedron(particle.geometry)
        main_window.addObject(particle_painter)

    main_window.addBeforeDrawSceneCallback(simulator.update)
    main_window.mainLoop()
Esempio n. 8
0
from PyQt4 import QtGui
from gui.main_window import MainWindow
import sys
from gui.direct_view_window import DirectViewWindow, DirectViewer

'''
Later configure from here in some code lines: GUI On GUI off, want to have view x and view y

maybe a api for gui ?

'''

q_app = QtGui.QApplication(sys.argv)       
gui = MainWindow()
# a = NewSimulationWindow(gui)
gui.show()
        
# sys.exit(q_app.exec_())
Esempio n. 9
0
import os
import sys

try:
    # try to import GTK
    import pygtk
    pygtk.require20()
    import gtk

except:
    # print error and die
    print "Error starting My File Manager, missing GTK 2.0+"
    sys.exit(1)

# add search path
path_application = os.path.abspath(os.path.dirname(sys.argv[0]))
sys.path.insert(1, path_application)

# initialise threads
gtk.gdk.threads_init()

# change working directory
os.chdir(os.path.dirname(path_application))

# construct main application object
from gui.main_window import MainWindow

app = MainWindow()
app.run()

Esempio n. 10
0
    logging.basicConfig(level=logging.DEBUG)
    app = QtGui.QApplication(sys.argv)
    QtGui.QFontDatabase.addApplicationFont('media/fonts')
    app.setStyle(QtGui.QStyleFactory.create('Plastique'))
    app.setWindowIcon(QtGui.QIcon('icons/copper_icon.png'))

    # Create and display the splash screen
    splash_pix = QtGui.QPixmap('media/splash_screen.png')
    splash = QtGui.QSplashScreen(splash_pix, QtCore.Qt.WindowStaysOnTopHint)
    splash.show()
    app.processEvents()

    # Create main window
    from gui.main_window import MainWindow
    
    window = MainWindow()
    window.load_style()

    # Move main window to desktop center
    desktop = QtGui.QApplication.desktop()
    screenWidth = desktop.width()
    screenHeight = desktop.height()
    x = (screenWidth - window.width()) / 2
    y = (screenHeight - window.height()) / 2
    window.move(x, y)

    # Show main window
    window.show()
    splash.finish(window)
    window.raise_()
    window.activateWindow()
Esempio n. 11
0
from gui.main_window import MainWindow
import resources.resources_rcc

if __name__ == '__main__':
    import sys
    from PyQt5.QtWidgets import QApplication

    app = QApplication(sys.argv)
    app.setOrganizationName("Sonance")
    app.setApplicationName("Sonance")
    
    player = MainWindow()
    player.show()

    sys.exit(app.exec_())
Esempio n. 12
0
def main():
    app = QtGui.QApplication(sys.argv)
    window = MainWindow()
    window.show()
    sys.exit(app.exec_())
Esempio n. 13
0
def initialise_gui(obj, data):
    app = QtGui.QApplication(sys.argv)
    window = MainWindow(data, obj)
    window.show()
    app.exec_()
Esempio n. 14
0
from physics.particle import Particle
from physics.physics_simulator import PhysicsSimulator
from readers.ply_reader import readPly
import numpy as np


def createParticle(mass, color):
    particle = Particle(mass)
    particle.setGeometry(readPly('../objects/sphere.ply'))
    particle.geometry.scale(np.repeat(mass / 2.0, 3))
    particle.geometry.setColor(color)
    return particle


if __name__ == '__main__':
    main_window = MainWindow("Spring Example", 400, 400)
    main_window.setInputListener(GameLikeInputListener(main_window))

    simulator = PhysicsSimulator()

    particle1 = createParticle(0.1, np.array([0.6, 0.2, 0.6]))
    particle2 = createParticle(0.5, np.array([0.2, 0.6, 0.6]))
    particle3 = createParticle(0.2, np.array([0.8, 0.2, 0.2]))

    simulator.addBody(particle1)
    simulator.addBody(particle2)
    simulator.addBody(particle3)

    main_window.addObject(PaintablePolyhedron(particle1.geometry))
    main_window.addObject(PaintablePolyhedron(particle2.geometry))
    main_window.addObject(PaintablePolyhedron(particle3.geometry))
Esempio n. 15
0
import shutil

from example_rendered_water_particles.clip_generator import SimulationClipGenerator
from example_rendered_water_particles.simulation_parameters import SIMULATION_TIMESTEP, \
    SIMULATION_N_PARTICLES, OUTPUT_FILE_PATH, TMP_FOLDER
from example_rendered_water_particles.water_particle import WaterParticle
from gui.main_window import MainWindow
from gui.paintables.paintable_polyhedron import PaintablePolyhedron
from physics.delta_t_calculators import FixedDeltaTCalculator
from physics.force_generator.gravity_force_generator import GravityForceGenerator
from physics.physics_simulator import PhysicsSimulator


if __name__ == '__main__':
    main_window = MainWindow('Water Particles Example', 400, 400)
    main_window.calculateDeltaT = FixedDeltaTCalculator(delta_t=SIMULATION_TIMESTEP)
    simulator = PhysicsSimulator()
    for i in xrange(SIMULATION_N_PARTICLES):
        # Add particle to simulator
        particle = WaterParticle()
        simulator.addForceGenerator(GravityForceGenerator(particle))
        simulator.addBody(particle)
        # Add particle to scene
        particle_painter = PaintablePolyhedron(particle.geometry)
        main_window.addObject(particle_painter)

    main_window.addBeforeDrawSceneCallback(simulator.update)
    simulation_clip_generator = SimulationClipGenerator(main_window)
    simulation_clip_generator.generateClip(OUTPUT_FILE_PATH)

    # Comment this line if you want to see the generated frames in the TMP_FOLDER