void View::update(){ if (!m_isStarted) return; if (!m_mouseMode && m_controller) m_controller->updateCoordinates(); if (m_menu->isVisible()){ if (m_mousePressTime.msecsTo(QTime::currentTime())>5000) m_menu->setVisible(false); } int x = m_mouseMode?m_exController->getX():m_controller->getX(); int y = m_mouseMode?m_exController->getY():m_controller->getY(); x = checkX(m_mouseMode?x+m_dx:x); y = checkY(m_mouseMode?y+m_dy:y); setSceneRect(x, y, width(), height()); }
void View::setupWindow(){ int w = m_pix.width(); int h = m_pix.height(); if (m_imageWidth>0 && m_imageHeight > 0){ int x = m_controller? m_controller->getX(): (m_exController?m_exController->getX():0); int y = m_controller? m_controller->getY(): (m_exController?m_exController->getY():0); checkX(x*w/m_imageWidth); checkY(y*h/m_imageHeight); } m_imageWidth = w; m_imageHeight = h; setViewportUpdateMode(QGraphicsView::BoundingRectViewportUpdate); setBackgroundBrush(m_pix); setCacheMode(QGraphicsView::CacheBackground); setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform); setWindowTitle("PanoramaWithSense"); }
/// Check validity of temperature, pressure and composition input. bool IncompressibleSolution::checkTPX(double T, double p, double x) { return (checkT(T,p,x) && checkP(T,p,x) && checkX(x)); }