void EditorView::setBoard(drawingboard::Board *board) { board_ = board; setScene(board); // notify of scene change sceneChanged(); }
void MainWindow::toggle2D(bool on) { scene.two_dimensional = on; if (on) newPointSet(); else emit(sceneChanged()); }
void QAbstract3DInputHandler::setScene(Q3DScene *scene) { if (scene != d_ptr->m_scene) { d_ptr->m_scene = scene; emit sceneChanged(scene); } }
// if successful, will set displayedScene and displayedSceneName bool Viewer::loadScene( const QString & fileName ) { if ( ! fileName.isEmpty() && ( fileName != m_displayedSceneName ) ) { if ( !m_viewerPlugInCallback ) { m_viewerPlugInCallback = new viewerPlugInCallback(); } m_viewState.reset(); // clear the current scene before loading the next one! try { m_viewState = dp::sg::io::loadScene( fileName.toStdString(), GetPreferences()->getSearchPathsAsStdVector(), m_viewerPlugInCallback.get() ); if ( m_viewState ) { LogMessage( "Loading Scene: '%s' - SUCCESS\n", fileName.toStdString().c_str() ); m_displayedSceneName = fileName; } else { LogError( "Loading Scene: '%s' - FAILED\n", fileName.toStdString().c_str() ); m_displayedSceneName.clear(); } } catch ( std::exception const & e ) { LogError( e.what() ); m_displayedSceneName.clear(); } emit sceneChanged(); m_sceneStateUndoStack.clear(); m_parameterUndoStack.clear(); outputStatistics(); } return( !!m_viewState ); }
void MainWindow::newScene() { _selection.clear(); _scene.reset(new Scene()); _scene->setCamera(new PinholeCamera()); emit sceneChanged(); }
void CanvasView::setCanvas(drawingboard::CanvasScene *scene) { _scene = scene; _toolbox.setScene(scene); setScene(scene); // notify of scene change sceneChanged(); }
void hrAdventureScreen::switchGround(bool isUnderground) { if (hasUnderground) { this->isUnderground = isUnderground; emit sceneChanged(); } }
void Layer::setScene(Scene *scene) { if (m_scene == scene) return; m_scene = scene; emit sceneChanged(); }
void hrRender::setScene(hrScene *s) { Q_ASSERT(s); scene = s; connect(scene, SIGNAL(sceneChanged()), this, SLOT(onSceneChanged())); connect(scene, SIGNAL(cursorChaged(int)), this, SLOT(onCursorChanged(int))); scene->setViewport(width()*devicePixelRatio(), height()*devicePixelRatio()); }
SceneDockWidget::SceneDockWidget(Controller* controller, QWidget *parent) : QDockWidget(parent), ui(new Ui::SceneDockWidget), controller(controller) { ui->setupUi(this); materialPreviewScene = new QGraphicsScene(this); ui->materialPreview->setScene(materialPreviewScene); connect(controller, SIGNAL(sceneChanged()), this, SLOT(onSceneChanged())); }
void MainWindow::initView(QWidget* parent) { gvMain = new RefImageView(parent); gsMain = new RefImageScene(parent); gvCarousel = new ThumbnailView(parent); gsCarousel = new RefImageScene(parent); gvMain->setScene(gsMain); gvCarousel->setScene(gsCarousel); connect(gsMain,SIGNAL(changed(QList<QRectF>)),this,SIGNAL(sceneChanged(QList<QRectF>))); connect(this,SIGNAL(sceneChanged(QList<QRectF>)),gvMain,SLOT(updateScene(QList<QRectF>))); connect(gsMain,SIGNAL(selectionChanged()),this,SLOT(selectionChanged())); /* QRectF sceneRect = QRect(QPoint(-gvMain->size().width()/2, -gvMain->size().height()/2), gvMain->size()); qDebug() << sceneRect; gsMain->setSceneRect(sceneRect);*/ }
void Viewer::unloadScene() { if ( m_viewState ) { m_viewState.reset(); m_displayedSceneName.clear(); emit sceneChanged(); m_sceneStateUndoStack.clear(); m_parameterUndoStack.clear(); outputStatistics(); } }
void MainWindow::connectActions() { QObject::connect(this->actionNew_Point_Set, SIGNAL(triggered()), this, SLOT(newPointSet())); QObject::connect(this->actionLoad_points, SIGNAL(triggered()), this, SLOT(loadPoints())); QObject::connect(this->actionSave_points, SIGNAL(triggered()), this, SLOT(savePoints())); QObject::connect(this->speedSlider, SIGNAL(valueChanged(int)), this, SLOT(speedChanged(int))); QObject::connect(this->viewer, SIGNAL(valueChanged(int)), this, SLOT(speedChanged(int))); QObject::connect(this, SIGNAL(sceneChanged()), this->viewer, SLOT(sceneChanged())); QObject::connect(this->actionStep, SIGNAL(triggered()), this, SLOT(lloydStep())); QObject::connect(this->actionPlay, SIGNAL(toggled(bool)), this, SLOT(togglePause(bool))); QObject::connect(this->actionShow_8_Copies, SIGNAL(toggled(bool)), this, SLOT(toggle8Copies(bool))); QObject::connect(this->action2D_version, SIGNAL(toggled(bool)), this, SLOT(toggle2D(bool))); QObject::connect(this->actionQuit, SIGNAL(triggered()), qApp, SLOT(quit())); QObject::connect(this->actionDemo_Help, SIGNAL(triggered()), this, SLOT(help())); }
void CompiledGraph::insert (scene::Instance* instance) { m_instances.insert(InstanceMap::value_type(PathConstReference(instance->path()), instance)); // Notify the graph tree model about the change sceneChanged(); for (ObserverList::iterator i = _sceneObservers.begin(); i != _sceneObservers.end(); ++i) { (*i)->onSceneNodeInsert(*instance); } graph_tree_model_insert(_treeModel, *instance); }
void CompiledGraph::erase (scene::Instance* instance) { notifyErase(instance); // Notify the graph tree model about the change sceneChanged(); for (ObserverList::iterator i = _sceneObservers.begin(); i != _sceneObservers.end(); ++i) { (*i)->onSceneNodeErase(*instance); } graph_tree_model_erase(_treeModel, *instance); m_instances.erase(PathConstReference(instance->path())); }
void hrAdventureScreen::scroll(int dx, int dy) { const int xMax = size.width(); const int yMax = size.height(); int lx = viewport.left() + dx; int rx = viewport.right() + dx; int ty = viewport.top() + dy; int by = viewport.bottom() + dy; dx = (lx>=0 && rx<xMax) ? dx : 0; dy = (ty>=0 && by<yMax) ? dy : 0; if (dx || dy) { viewport.translate(dx, dy); emit sceneChanged(); } }
void SchematicHandleSpinBox::mouseMoveEvent(QGraphicsSceneMouseEvent *me) { if (m_buttonState == Qt::LeftButton) { bool increase = false; int delta = me->screenPos().y() - me->lastScreenPos().y(); if (delta < 0) increase = true; m_delta += abs(delta); if (m_delta > 5) { if (increase) emit(modifyHandle(1)); else emit(modifyHandle(-1)); m_delta = 0; emit sceneChanged(); } } }
void MainWindow::openScene(const QString &path) { Scene *newScene = nullptr; try { newScene = Scene::load(Path(path.toStdString())); newScene->loadResources(); } catch (const std::runtime_error &e) { QMessageBox::warning( this, "Loading scene failed", QString::fromStdString(tfm::format("Encountered an error while loading scene file:\n\n%s", e.what())) ); } if (newScene) { _selection.clear(); _scene.reset(newScene); _scene->loadResources(); emit sceneChanged(); } }
void SceneGraph::erase(const INodePtr& node) { if (_traversalOngoing) { _actionBuffer.push_back(NodeAction(Erase, node)); return; } _spacePartition->unlink(node); // Fire the onRemove event on the Node assert(_root); node->onRemoveFromScene(*_root); // Notify the graph tree model about the change sceneChanged(); for (auto i : _sceneObservers) { i->onSceneNodeErase(node); } }
/** * @param x x coordinate * @param y y coordinate */ void CanvasView::moveDrag(int x, int y) { const int dx = _dragx - x; const int dy = _dragy - y; if(_isdragging==ROTATE) { qreal preva = qAtan2( width()/2 - _dragx, height()/2 - _dragy ); qreal a = qAtan2( width()/2 - x, height()/2 - y ); setRotation(rotation() + qRadiansToDegrees(preva-a)); } else { QScrollBar *ver = verticalScrollBar(); ver->setSliderPosition(ver->sliderPosition()+dy); QScrollBar *hor = horizontalScrollBar(); hor->setSliderPosition(hor->sliderPosition()+dx); } _dragx = x; _dragy = y; // notify of scene change sceneChanged(); }
/** * @param x x coordinate * @param y y coordinate */ void EditorView::moveDrag(int x, int y) { const int dx = dragx_ - x; const int dy = dragy_ - y; if(isdragging_==ROTATE) { qreal preva = atan2( width()/2 - dragx_, height()/2 - dragy_ ); qreal a = atan2( width()/2 - x, height()/2 - y ); setRotation(rotation() + (preva-a) * (180.0 / M_PI)); } else { QScrollBar *ver = verticalScrollBar(); ver->setSliderPosition(ver->sliderPosition()+dy); QScrollBar *hor = horizontalScrollBar(); hor->setSliderPosition(hor->sliderPosition()+dx); } dragx_ = x; dragy_ = y; // notify of scene change sceneChanged(); }
void MainWindow::newPoints(int n) { scene.periodic_triangulation.clear(); scene.points.clear(); CGAL::Random rnd(std::time(NULL)); CGAL::Random_points_in_cube_3<Point_3, Creator> in_cube(1,rnd); for (int i=0 ; i<n ; i++) if (scene.two_dimensional) { Point_3 rdpt = *in_cube++; scene.points.push_back(Point_3(rdpt.x(),rdpt.y(),0.)); } else scene.points.push_back(*in_cube++); Iso_cuboid_3 dom(-1,-1,-1,1,1,1); scene.periodic_triangulation.set_domain(dom); scene.periodic_triangulation.insert(scene.points.begin(), scene.points.end()); FT cx(0),cy(0),cz(0); for (int i=0 ; i<8 ; i++) { cx += dom[i].x(); cy += dom[i].y(); cy += dom[i].y(); } qglviewer::Vec center(cx/8.,cy/8.,cz/8.); viewer->setSceneCenter(center); viewer->setSceneRadius(std::sqrt( ((dom.xmax()-dom.xmin())*(dom.xmax()-dom.xmin())) + ((dom.xmax()-dom.xmin())*(dom.xmax()-dom.xmin())) + ((dom.xmax()-dom.xmin())*(dom.xmax()-dom.xmin())))); speedSlider->setRange(0,100); speedSlider->setSliderPosition(100); emit (sceneChanged()); }
void SceneGraph::insert(const INodePtr& node) { if (_traversalOngoing) { _actionBuffer.push_back(NodeAction(Insert, node)); return; } // Notify the graph tree model about the change sceneChanged(); // Insert this node into our SP tree _spacePartition->link(node); // Call the onInsert event on the node assert(_root); node->onInsertIntoScene(*_root); for (auto i : _sceneObservers) { i->onSceneNodeInsert(node); } }
void MainWindow::loadPoints() { QString fileName = QFileDialog ::getOpenFileName(this, tr("Open point set"), ".", tr("All files (*)")); if(fileName.isEmpty()) return; std::ifstream ifs(fileName.toLatin1().data() ); scene.points.clear(); Iso_cuboid_3 dom; ifs >> dom; std::copy(std::istream_iterator<Point_3>(ifs), std::istream_iterator<Point_3>(), std::back_inserter(scene.points)); scene.periodic_triangulation.set_domain(dom); scene.periodic_triangulation.insert(scene.points.begin(), scene.points.end()); FT cx(0),cy(0),cz(0); for (int i=0 ; i<8 ; i++) { cx += dom[i].x(); cy += dom[i].y(); cy += dom[i].y(); } qglviewer::Vec center(cx/8.,cy/8.,cz/8.); viewer->setSceneCenter(center); viewer->setSceneRadius(std::sqrt( ((dom.xmax()-dom.xmin())*(dom.xmax()-dom.xmin())) + ((dom.xmax()-dom.xmin())*(dom.xmax()-dom.xmin())) + ((dom.xmax()-dom.xmin())*(dom.xmax()-dom.xmin())))); speedSlider->setRange(0,100); speedSlider->setSliderPosition(100); emit (sceneChanged()); }
void MainWindow::closeScene() { _selection.clear(); _scene.reset(); emit sceneChanged(); }
void CanvasView::scrollTo(const QPoint& point) { centerOn(point); // notify of scene change sceneChanged(); }
void MainWindow::toggle8Copies(bool on) { scene.eight_copies = on; emit(sceneChanged()); }
void Viewer::keyPressEvent(QKeyEvent *e) { const Qt::KeyboardModifiers modifiers = e->modifiers(); if ((e->key()==Qt::Key_W) && (modifiers==Qt::NoButton)) { wireframe = !wireframe; if (wireframe) { displayMessage("Wireframe."); } else { displayMessage("Filled faces."); } update(); } else if ((e->key()==Qt::Key_F) && (modifiers==Qt::NoButton)) { flatShading = !flatShading; if (flatShading) displayMessage("Flat shading."); else displayMessage("Gouraud shading."); update(); } else if ((e->key()==Qt::Key_E) && (modifiers==Qt::NoButton)) { edges = !edges; displayMessage(QString("Draw edges=%1.").arg(edges?"true":"false")); update(); } else if ((e->key()==Qt::Key_V) && (modifiers==Qt::NoButton)) { vertices = !vertices; displayMessage(QString("Draw vertices=%1.").arg(vertices?"true":"false")); update(); } else if ((e->key()==Qt::Key_N) && (modifiers==Qt::NoButton)) { inverse_normal = !inverse_normal; displayMessage(QString("Inverse normal=%1.").arg(inverse_normal?"true":"false")); sceneChanged(); } else if ((e->key()==Qt::Key_Plus) && (modifiers==Qt::KeypadModifier)) { size_edges+=.5; displayMessage(QString("Size of edges=%1.").arg(size_edges)); update(); } else if ((e->key()==Qt::Key_Minus) && (modifiers==Qt::KeypadModifier)) { if (size_edges>.5) size_edges-=.5; displayMessage(QString("Size of edges=%1.").arg(size_edges)); update(); } else if ((e->key()==Qt::Key_Plus) && (modifiers==(Qt::ShiftModifier|Qt::KeypadModifier))) { size_points+=.5; displayMessage(QString("Size of points=%1.").arg(size_points)); update(); } else if ((e->key()==Qt::Key_Minus) && (modifiers==(Qt::ShiftModifier|Qt::KeypadModifier))) { if (size_points>.5) size_points-=.5; displayMessage(QString("Size of points=%1.").arg(size_points)); update(); } else if ((e->key()==Qt::Key_PageUp) && (modifiers==Qt::NoButton)) { ambient.setX(ambient.x()+.1); if (ambient.x()>1.) ambient.setX(1.); ambient.setY(ambient.x()+.1); if (ambient.y()>1.) ambient.setY(1.); ambient.setZ(ambient.x()+.1); if (ambient.z()>1.) ambient.setZ(1.); displayMessage(QString("Light color=(%1 %2 %3)."). arg(ambient.x()).arg(ambient.y()).arg(ambient.z())); update(); } else if ((e->key()==Qt::Key_PageDown) && (modifiers==Qt::NoButton)) { ambient.setX(ambient.x()-.1); if (ambient.x()<0.) ambient.setX(0.); ambient.setY(ambient.y()-.1); if (ambient.y()<0.) ambient.setY(0.); ambient.setZ(ambient.z()-.1); if (ambient.z()<0.) ambient.setZ(0.); displayMessage(QString("Light color=(%1 %2 %3)."). arg(ambient.x()).arg(ambient.y()).arg(ambient.z())); update(); } else if ((e->key()==Qt::Key_PageUp) && (modifiers==Qt::ShiftModifier)) { ambient.setX(ambient.x()+.1); if (ambient.x()>1.) ambient.setX(1.); displayMessage(QString("Light color=(%1 %2 %3)."). arg(ambient.x()).arg(ambient.y()).arg(ambient.z())); update(); } else if ((e->key()==Qt::Key_PageUp) && (modifiers==Qt::AltModifier)) { ambient.setY(ambient.y()+.1); if (ambient.y()>1.) ambient.setY(1.); displayMessage(QString("Light color=(%1 %2 %3)."). arg(ambient.x()).arg(ambient.y()).arg(ambient.z())); update(); } else if ((e->key()==Qt::Key_PageUp) && (modifiers==Qt::ControlModifier)) { ambient.setZ(ambient.z()+.1); if (ambient.z()>1.) ambient.setZ(1.); displayMessage(QString("Light color=(%1 %2 %3)."). arg(ambient.x()).arg(ambient.y()).arg(ambient.z())); update(); } else if ((e->key()==Qt::Key_PageDown) && (modifiers==Qt::ShiftModifier)) { ambient.setX(ambient.x()-.1); if (ambient.x()<0.) ambient.setX(0.); displayMessage(QString("Light color=(%1 %2 %3)."). arg(ambient.x()).arg(ambient.y()).arg(ambient.z())); update(); } else if ((e->key()==Qt::Key_PageDown) && (modifiers==Qt::AltModifier)) { ambient.setY(ambient.y()-.1); if (ambient.y()<0.) ambient.setY(0.); displayMessage(QString("Light color=(%1 %2 %3)."). arg(ambient.x()).arg(ambient.y()).arg(ambient.z())); update(); } else if ((e->key()==Qt::Key_PageDown) && (modifiers==Qt::ControlModifier)) { ambient.setZ(ambient.z()-.1); if (ambient.z()<0.) ambient.setZ(0.); displayMessage(QString("Light color=(%1 %2 %3)."). arg(ambient.x()).arg(ambient.y()).arg(ambient.z())); update(); } else CGAL::QGLViewer::keyPressEvent(e); }
void Camera::resetCapabilities() { QtCamDevice *dev = device(); delete m_zoom; m_zoom = new Zoom(dev, this); QObject::connect(this, SIGNAL(prepareForDeviceChange()), m_zoom, SLOT(prepareForDeviceChange())); emit zoomChanged(); delete m_flash; m_flash = new Flash(dev, this); QObject::connect(this, SIGNAL(prepareForDeviceChange()), m_flash, SLOT(prepareForDeviceChange())); emit flashChanged(); delete m_scene; m_scene = new Scene(dev, this); QObject::connect(this, SIGNAL(prepareForDeviceChange()), m_scene, SLOT(prepareForDeviceChange())); emit sceneChanged(); delete m_evComp; m_evComp = new EvComp(dev, this); QObject::connect(this, SIGNAL(prepareForDeviceChange()), m_evComp, SLOT(prepareForDeviceChange())); emit evCompChanged(); delete m_whiteBalance; m_whiteBalance = new WhiteBalance(dev, this); QObject::connect(this, SIGNAL(prepareForDeviceChange()), m_whiteBalance, SLOT(prepareForDeviceChange())); emit whiteBalanceChanged(); delete m_colorTone; m_colorTone = new ColorTone(dev, this); QObject::connect(this, SIGNAL(prepareForDeviceChange()), m_colorTone, SLOT(prepareForDeviceChange())); emit colorToneChanged(); delete m_iso; m_iso = new Iso(dev, this); QObject::connect(this, SIGNAL(prepareForDeviceChange()), m_iso, SLOT(prepareForDeviceChange())); emit isoChanged(); delete m_exposure; m_exposure = new Exposure(dev, this); QObject::connect(this, SIGNAL(prepareForDeviceChange()), m_exposure, SLOT(prepareForDeviceChange())); emit exposureChanged(); delete m_aperture; m_aperture = new Aperture(dev, this); QObject::connect(this, SIGNAL(prepareForDeviceChange()), m_aperture, SLOT(prepareForDeviceChange())); emit apertureChanged(); delete m_noiseReduction; m_noiseReduction = new NoiseReduction(dev, this); QObject::connect(this, SIGNAL(prepareForDeviceChange()), m_noiseReduction, SLOT(prepareForDeviceChange())); emit noiseReductionChanged(); delete m_flickerReduction; m_flickerReduction = new FlickerReduction(dev, this); QObject::connect(this, SIGNAL(prepareForDeviceChange()), m_flickerReduction, SLOT(prepareForDeviceChange())); emit flickerReductionChanged(); delete m_focus; m_focus = new Focus(dev, this); QObject::connect(this, SIGNAL(prepareForDeviceChange()), m_focus, SLOT(prepareForDeviceChange())); emit focusChanged(); delete m_autoFocus; m_autoFocus = new AutoFocus(dev, this); QObject::connect(this, SIGNAL(prepareForDeviceChange()), m_autoFocus, SLOT(prepareForDeviceChange())); emit autoFocusChanged(); delete m_roi; m_roi = new Roi(dev, this); QObject::connect(this, SIGNAL(prepareForDeviceChange()), m_roi, SLOT(prepareForDeviceChange())); emit roiChanged(); delete m_videoMute; m_videoMute = new VideoMute(dev, this); QObject::connect(this, SIGNAL(prepareForDeviceChange()), m_videoMute, SLOT(prepareForDeviceChange())); emit videoMuteChanged(); delete m_videoTorch; m_videoTorch = new VideoTorch(dev, this); QObject::connect(this, SIGNAL(prepareForDeviceChange()), m_videoTorch, SLOT(prepareForDeviceChange())); emit videoTorchChanged(); }
TApp::TApp() : m_currentScene(0) , m_currentXsheet(0) , m_currentFrame(0) , m_currentColumn(0) , m_currentLevel(0) , m_currentTool(0) , m_currentObject(0) , m_currentSelection(0) , m_currentOnionSkinMask(0) , m_currentFx(0) , m_mainWindow(0) , m_autosaveTimer(0) , m_autosaveSuspended(false) , m_isStarting(false) , m_isPenCloseToTablet(false) { m_currentScene = new TSceneHandle(); m_currentXsheet = new TXsheetHandle(); m_currentFrame = new TFrameHandle(); m_currentColumn = new TColumnHandle(); m_currentLevel = new TXshLevelHandle(); m_currentTool = new ToolHandle(); m_currentObject = new TObjectHandle(); m_currentOnionSkinMask = new TOnionSkinMaskHandle(); m_currentFx = new TFxHandle(); m_currentSelection = TSelectionHandle::getCurrent(); m_paletteController = new PaletteController(); bool ret = true; ret = ret && QObject::connect(m_currentXsheet, SIGNAL(xsheetChanged()), this, SLOT(onXsheetChanged())); ret = ret && QObject::connect(m_currentXsheet, SIGNAL(xsheetSoundChanged()), this, SLOT(onXsheetSoundChanged())); ret = ret && QObject::connect(m_currentScene, SIGNAL(sceneSwitched()), this, SLOT(onSceneSwitched())); ret = ret && QObject::connect(m_currentScene, SIGNAL(sceneChanged()), this, SLOT(onSceneChanged())); ret = ret && QObject::connect(m_currentXsheet, SIGNAL(xsheetSwitched()), this, SLOT(onXsheetSwitched())); ret = ret && QObject::connect(m_currentFrame, SIGNAL(frameSwitched()), this, SLOT(onFrameSwitched())); ret = ret && QObject::connect(m_currentFrame, SIGNAL(frameSwitched()), this, SLOT(onImageChanged())); ret = ret && QObject::connect(m_currentFx, SIGNAL(fxSwitched()), this, SLOT(onFxSwitched())); ret = ret && QObject::connect(m_currentColumn, SIGNAL(columnIndexSwitched()), this, SLOT(onColumnIndexSwitched())); ret = ret && QObject::connect(m_currentColumn, SIGNAL(columnIndexSwitched()), this, SLOT(onImageChanged())); ret = ret && QObject::connect(m_currentLevel, SIGNAL(xshLevelSwitched(TXshLevel *)), this, SLOT(onImageChanged())); ret = ret && QObject::connect(m_currentLevel, SIGNAL(xshLevelSwitched(TXshLevel *)), this, SLOT(onXshLevelSwitched(TXshLevel *))); ret = ret && QObject::connect(m_currentLevel, SIGNAL(xshLevelChanged()), this, SLOT(onXshLevelChanged())); ret = ret && QObject::connect(m_currentObject, SIGNAL(objectSwitched()), this, SLOT(onObjectSwitched())); ret = ret && QObject::connect(m_currentObject, SIGNAL(splineChanged()), this, SLOT(onSplineChanged())); ret = ret && QObject::connect(m_paletteController->getCurrentLevelPalette(), SIGNAL(paletteChanged()), this, SLOT(onPaletteChanged())); ret = ret && QObject::connect(m_paletteController->getCurrentLevelPalette(), SIGNAL(colorStyleSwitched()), this, SLOT(onLevelColorStyleSwitched())); ret = ret && QObject::connect(m_paletteController->getCurrentLevelPalette(), SIGNAL(colorStyleChangedOnMouseRelease()), this, SLOT(onLevelColorStyleChanged())); ret = ret && QObject::connect(m_paletteController->getCurrentCleanupPalette(), SIGNAL(paletteChanged()), m_currentScene, SIGNAL(sceneChanged())); TMeasureManager::instance()->addCameraMeasures(getCurrentCameraSize); m_autosaveTimer = new QTimer(this); ret = ret && connect(m_autosaveTimer, SIGNAL(timeout()), this, SLOT(autosave())); Preferences *preferences = Preferences::instance(); if (preferences->isRasterOptimizedMemory()) { if (!TBigMemoryManager::instance()->init( (int)(/*15*1024*/ TSystem::getFreeMemorySize(true) * .8))) DVGui::warning(tr("Error allocating memory: not enough memory.")); } ret = ret && connect(preferences, SIGNAL(stopAutoSave()), SLOT(onStopAutoSave())); ret = ret && connect(preferences, SIGNAL(startAutoSave()), SLOT(onStartAutoSave())); ret = ret && connect(m_currentTool, SIGNAL(toolEditingFinished()), SLOT(onToolEditingFinished())); if (preferences->isAutosaveEnabled()) m_autosaveTimer->start(preferences->getAutosavePeriod() * 1000 * 60); UnitParameters::setCurrentDpiGetter(getCurrentDpi); assert(ret); }