void GpsimProcessor::setRunning( bool run ) { if ( m_bIsRunning == run ) return; m_bIsRunning = run; emit runningStatusChanged(run); }
StandaloneRenderManager::StandaloneRenderManager(QApplication & qApplication, Application & application, const ComputeDevice& device) : m_device(device), m_renderer(OptixRenderer()), m_nextIterationNumber(0), m_outputBuffer(NULL), m_currentScene(NULL), m_compileScene(false), m_application(application), m_noEmittedSignals(true) { connect(&application, SIGNAL(sequenceNumberIncremented()), this, SLOT(onSequenceNumberIncremented())); connect(&application, SIGNAL(runningStatusChanged()), this, SLOT(onRunningStatusChanged())); connect(&application.getSceneManager(), SIGNAL(sceneLoadingNew()), this, SLOT(onSceneLoadingNew())); connect(&application.getSceneManager(), SIGNAL(sceneUpdated()), this, SLOT(onSceneUpdated())); onSceneUpdated(); connect(this, SIGNAL(continueRayTracing()), this, SLOT(onContinueRayTracing()), Qt::QueuedConnection); }
MainWindowBase::MainWindowBase(Application& application) : m_application(application), m_camera(application.getCamera()) { setupUi(this); actionReload_scene->setVisible(false); //connect(&application.getOutputSettingsModel(), SIGNAL(resolutionUpdated()), this, SLOT(onOutputSettingsResolutionUpdated())); //connect(&application.getPPMSettingsModel(), SIGNAL(updated()), this, SLOT(onPPMSettingsModelUpdated())); connect(&application, SIGNAL(applicationError(QString)), this, SLOT(onApplicationError(QString))); // Render Information Dock RenderInformationDock* renderInformationDock = new RenderInformationDock(this, application.getRenderStatisticsModel(), application); this->addDockWidget(Qt::RightDockWidgetArea, renderInformationDock); connect(renderInformationDock, SIGNAL(renderStatusToggle()), this, SLOT(onRenderStatusToggle())); connect(renderInformationDock, SIGNAL(renderRestart()), this, SLOT(onRenderRestart())); // Output Dock OutputDock* outputDock = new OutputDock(this, application.getOutputSettingsModel()); this->addDockWidget(Qt::RightDockWidgetArea, outputDock); // PPM Information dock PPMDock* ppmDock = new PPMDock(this, m_application, m_application.getPPMSettingsModel()); this->addDockWidget(Qt::RightDockWidgetArea, ppmDock); // Camera Dock CameraDock* cameraDock = new CameraDock(this, application.getCamera(), application.getPPMSettingsModel(), application.getOutputSettingsModel()); this->addDockWidget(Qt::RightDockWidgetArea, cameraDock); connect(&application, SIGNAL(cameraUpdated()), cameraDock, SLOT(onCameraUpdated())); connect(cameraDock, SIGNAL(cameraUpdated()), &application, SLOT(onCameraUpdated())); // Scene Dock SceneDock* sceneDock = new SceneDock(this, application.getSceneManager()); this->addDockWidget(Qt::RightDockWidgetArea, sceneDock); // Status Bar Running Status and Time m_statusbar_runningStatusLabel = new QLabel(this); this->statusBar()->addPermanentWidget(m_statusbar_runningStatusLabel, 1); m_statusbar_runningStatusLabel->setGeometry(100, 0, 100, 12); QTimer* runningStatusLabelTimer = new QTimer(this); runningStatusLabelTimer->setInterval(100); connect(runningStatusLabelTimer, SIGNAL(timeout()), this, SLOT(onUpdateRunningStatusLabelTimer())); runningStatusLabelTimer->start(); // Status Bar Render Method m_statusbar_renderMethodLabel = new QLabel(this); this->statusBar()->addPermanentWidget(m_statusbar_renderMethodLabel, 1); m_statusbar_renderMethodLabel->setGeometry(100, 0, 100, 12); // Render Widget m_renderWidget = new RenderWidget(centralwidget, application.getCamera(), application.getOutputSettingsModel()); gridLayout->addWidget(m_renderWidget, 0, 0, 1, 1); connect(m_renderWidget, SIGNAL(cameraUpdated()), &application, SLOT(onCameraUpdated())); connect(&application, SIGNAL(newFrameReadyForDisplay(const float*, unsigned long long)), m_renderWidget, SLOT(onNewFrameReadyForDisplay(const float*, unsigned long long)), Qt::QueuedConnection); connect(&application, SIGNAL(runningStatusChanged()), this, SLOT(onRunningStatusChanged())); connect(&application, SIGNAL(renderMethodChanged()), this, SLOT(onRenderMethodChanged())); connect(this, SIGNAL(renderRestart()), &m_application, SLOT(onRenderRestart())); connect(this, SIGNAL(renderStatusToggle()), &m_application, SLOT(onRenderStatusToggle())); onRunningStatusChanged(); onRenderMethodChanged(); }