def create_change_detection_app(globalsDict=None):
        from director import mainwindowapp
        from PythonQt import QtCore, QtGui

        app = mainwindowapp.construct()
        app.gridObj.setProperty('Visible', True)
        app.viewOptions.setProperty('Orientation widget', False)
        app.viewOptions.setProperty('View angle', 30)
        app.sceneBrowserDock.setVisible(False)
        app.propertiesDock.setVisible(False)
        app.mainWindow.setWindowTitle('Depth Scanner')
        app.mainWindow.show()
        app.mainWindow.resize(920, 600)
        app.mainWindow.move(0, 0)

        view = app.view
        view.setParent(None)
        mdiArea = QtGui.QMdiArea()
        app.mainWindow.setCentralWidget(mdiArea)
        subWindow = mdiArea.addSubWindow(view)
        subWindow.setMinimumSize(300, 300)
        subWindow.setWindowTitle('Camera image')
        subWindow.resize(640, 480)
        mdiArea.tileSubWindows()

        globalsDict['view'] = view
        globalsDict['app'] = app
Example #2
0
def main(globalsDict=None):

    from director import mainwindowapp
    from PythonQt import QtCore, QtGui

    app = mainwindowapp.construct()
    app.gridObj.setProperty('Visible', True)
    app.viewOptions.setProperty('Orientation widget', False)
    app.viewOptions.setProperty('View angle', 30)
    app.sceneBrowserDock.setVisible(False)
    app.propertiesDock.setVisible(False)
    app.mainWindow.setWindowTitle('Depth Scanner')
    app.mainWindow.show()
    app.mainWindow.resize(920, 600)
    app.mainWindow.move(0, 0)

    view = app.view
    view.setParent(None)
    mdiArea = QtGui.QMdiArea()
    app.mainWindow.setCentralWidget(mdiArea)
    subWindow = mdiArea.addSubWindow(view)
    subWindow.setMinimumSize(300, 300)
    subWindow.setWindowTitle('Camera image')
    subWindow.resize(640, 480)
    mdiArea.tileSubWindows()

    #affordanceManager = affordancemanager.AffordanceObjectModelManager(view)

    depthScanner = DepthScanner(view)
    depthScanner.update()

    dock = app.app.addWidgetToDock(depthScanner.imageView.view,
                                   QtCore.Qt.RightDockWidgetArea)
    dock.setMinimumWidth(300)
    dock.setMinimumHeight(300)

    dock = app.app.addWidgetToDock(depthScanner.pointCloudView,
                                   QtCore.Qt.RightDockWidgetArea)
    dock.setMinimumWidth(300)
    dock.setMinimumHeight(300)

    # add some test data
    def addTestData():
        d = DebugData()
        # d.addSphere((0,0,0), radius=0.5)
        d.addArrow((0, 0, 0), (0, 0, 1), color=[1, 0, 0])
        d.addArrow((0, 0, 1), (0, .5, 1), color=[0, 1, 0])
        vis.showPolyData(d.getPolyData(), 'debug data', colorByName='RGB255')
        view.resetCamera()

    addTestData()

    # xvfb command
    # /usr/bin/Xvfb  :99 -ac -screen 0 1280x1024x16

    if globalsDict is not None:
        globalsDict.update(dict(app=app, view=view, depthScanner=depthScanner))

    app.app.start(restoreWindow=False)