SceneDock::SceneDock(QWidget *parent, SceneManager & sceneManager) : QDockWidget(parent), m_sceneManager(sceneManager), ui(new Ui::SceneDock) { ui->setupUi(this); this->setFeatures(QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable); this->setAllowedAreas(Qt::LeftDockWidgetArea|Qt::RightDockWidgetArea); connect(&sceneManager, SIGNAL(sceneUpdated()), this, SLOT(onSceneUpdated())); connect(&sceneManager, SIGNAL(sceneLoadingNew()), this, SLOT(onSceneLoadingNew())); connect(&sceneManager, SIGNAL(sceneLoadError(QString)), this, SLOT(onSceneUpdated())); onSceneUpdated(); }
GameBoard::GameBoard(Game *parent) : game(parent) { setupUi(this); /** canvas object */ canvas = new Canvas(this); canvas->setSceneRect(70,65, graphicsView->width(), graphicsView->height()); graphicsView->setScene(canvas); /** init game with rocks */ initGame(); /** connect signal from scene and game */ connect(game, SIGNAL(refresh()), this, SLOT(refresh())); connect(canvas, SIGNAL(showPossibleMoves(uint,uint)), this, SLOT(showMoves(uint, uint))); connect(canvas, SIGNAL(sceneUpdated(uint,uint,uint,uint)), this, SLOT(sceneUpdate(uint, uint, uint, uint))); }
void SceneManager::onLoadNewScene( QString sceneName ) { emit sceneLoadingNew(); SceneManagerStatus::E oldStatus = m_status; m_status = SceneManagerStatus::IMPORTING; try { IScene* oldScene = m_scene; m_scene = m_factory.getSceneByName(sceneName.toLatin1().constData()); emit sceneUpdated(); delete oldScene; m_status = SceneManagerStatus::HAS_SCENE; } catch(const std::exception & E) { emit sceneLoadError(QString(E.what())); m_status = oldStatus; } }
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); }
void GGAbstractModel::notifySceneUpdate(GG::SceneID id) { if (GGScene *s = getScene(id)) { emit sceneUpdated(s); } }