这篇教程C++ updateScene函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中updateScene函数的典型用法代码示例。如果您正苦于以下问题:C++ updateScene函数的具体用法?C++ updateScene怎么用?C++ updateScene使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了updateScene函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: switchbool MainWindow::eventFilter(QObject *obj, QEvent *event){ if (obj == scene) { QGraphicsSceneMouseEvent* mouseEvent; switch(event->type()) { // ** MOUSE BUTTON RELEASE ** // case QEvent::GraphicsSceneMouseRelease: { mouseEvent = static_cast<QGraphicsSceneMouseEvent*>(event); QPoint pos = mouseEvent->scenePos().toPoint(); if (mouseEvent->button() == Qt::LeftButton) { if (inputPoints == 0 || inputPoints == 1) points[inputPoints++] = pos; if (inputPoints == 2) { // We've finished adding points now. view->setCursor(Qt::ArrowCursor); updateScene(); } } return true; } // ** MOUSE MOVED ** // case QEvent::GraphicsSceneMouseMove: { mouseEvent = static_cast<QGraphicsSceneMouseEvent*>(event); QPoint pos = mouseEvent->scenePos().toPoint(); if (inputPoints == 0) { points[0] = pos; updateScene(); } if (inputPoints == 1) { points[1] = pos; updateScene(); } return true; } default: return QMainWindow::eventFilter(obj, event); } } // pass the event on to the parent class return QMainWindow::eventFilter(obj, event);}
开发者ID:rosshemsley,项目名称:walk_visualisation,代码行数:60,
示例2: updateScenevoid Qgs3DMapScene::onCameraChanged(){ updateScene(); bool changedCameraPlanes = updateCameraNearFarPlanes(); if ( changedCameraPlanes ) { // repeat update of entities - because we have updated camera's near/far planes, // the active nodes may have changed as well updateScene(); updateCameraNearFarPlanes(); }}
开发者ID:havatv,项目名称:QGIS,代码行数:13,
示例3: updateScenevoid ImageCalibrator::on_CropW_valueChanged(int arg1){ if(ImgCalibratorLock) return; imgOffsets[frmX][frmY].W = arg1; updateScene();}
开发者ID:tcvicio,项目名称:PGE-Project,代码行数:7,
示例4: updateControlsvoid ImageCalibrator::on_FrameY_valueChanged(int arg1){ if(ImgCalibratorLock) return; frmY = arg1; updateControls(); updateScene();}
开发者ID:tcvicio,项目名称:PGE-Project,代码行数:7,
示例5: whilevoid GameWrapper::updateScene() { // http://gafferongames.com/game-physics/fix-your-timestep/ double newTime = timingSource->GetCurrentTimeInSeconds(); double frameTime = newTime - currentTime; if ( frameTime > 0.25 ) frameTime = 0.25; // note: max frame time to avoid spiral of death currentTime = newTime; accumulator += frameTime; bool continueUpdating = true; while ( continueUpdating && accumulator >= dt ) { sceneManager->getCurrentScene()->stepSimulation(dt); inputManager->resetForNextFrame(); continueUpdating = sceneManager->checkSceneTransition(); accumulator -= dt; } if(!continueUpdating) { currentTime = timingSource->GetCurrentTimeInSeconds() - dt; accumulator = 0.0; updateScene(); }}
开发者ID:rasslingcats,项目名称:calico,代码行数:26,
示例6: makeCurrentvoid QtOpenCVViewerGl::resizeGL(int width, int height){ makeCurrent(); glViewport(0, 0, (GLint)width, (GLint)height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(0, width, 0, height, 0, 1); // To Draw image in the center of the area glMatrixMode(GL_MODELVIEW); // ---> Scaled Image Sizes mOutH = width/mImgRatio; mOutW = width; if(mOutH>height) { mOutW = height*mImgRatio; mOutH = height; } emit imageSizeChanged( mOutW, mOutH ); // <--- Scaled Image Sizes mPosX = (width-mOutW)/2; mPosY = (height-mOutH)/2; mSceneChanged = true; updateScene();}
开发者ID:flair2005,项目名称:WebCamCap,代码行数:32,
示例7: CV_RGBvoid QtOpenCVViewerGl::showImage( cv::Mat image ){ cv::circle(image, cv::Point(image.cols/2, image.rows/2), 1, CV_RGB(0,255,0), 2); image.copyTo(mOrigImage); mImgRatio = (float)image.cols/(float)image.rows; if( mOrigImage.channels() == 3) mRenderQtImg = QImage((const unsigned char*)(mOrigImage.data), mOrigImage.cols, mOrigImage.rows, mOrigImage.step, QImage::Format_RGB888).rgbSwapped(); else if( mOrigImage.channels() == 1) mRenderQtImg = QImage((const unsigned char*)(mOrigImage.data), mOrigImage.cols, mOrigImage.rows, mOrigImage.step, QImage::Format_Indexed8); else return; mRenderQtImg = QGLWidget::convertToGLFormat(mRenderQtImg); mSceneChanged = true; updateScene(); return;}
开发者ID:flair2005,项目名称:WebCamCap,代码行数:27,
示例8: updateControlsvoid CalibrationMain::on_PasteButton_clicked(){ framesX[frmX][frmY] = buffer; updateControls(); updateScene();}
开发者ID:Wohlhabend-Networks,项目名称:PGE-Project,代码行数:7,
示例9: updateScenevoid CalibrationMain::on_Width_valueChanged(int arg1){ if(lockControls) return; framesX[frmX][frmY].W = arg1; frameWidth = arg1; updateScene();}
开发者ID:Wohlhabend-Networks,项目名称:PGE-Project,代码行数:7,
示例10: executeApplication int executeApplication() { MSG msg = {0}; TimerUtils::reset(Globals::gTimer); while (msg.message != WM_QUIT) { // If there are Window messages then process them. if (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) { TranslateMessage(&msg); DispatchMessage(&msg); } // Otherwise, do animation/game stuff. else { TimerUtils::tick(Globals::gTimer); if (!Globals::gWindowState.mIsPaused) { calculateFrameStats(); updateScene(static_cast<float> (Globals::gTimer.mDeltaTime)); drawScene(); } else { Sleep(100); } } } destroy(); return static_cast<int> (msg.wParam); }
开发者ID:mandragorn66,项目名称:dx11,代码行数:35,
示例11: incOffset void incOffset(float xInc, float yInc) { mOffset[0] += xInc; mOffset[1] += yInc; std::cout << "Offset: " << mOffset << std::endl; updateScene(); }
开发者ID:DaveHarrison,项目名称:OpenSGDevMaster,代码行数:7,
示例12: iter/** * Deploy particles over the volume */void MainWindow::on_actionDeploy_triggered() { g_pointList.clear(); g_numberOfPoints = ui.numberOfParticles->value(); const unsigned nVars = g_numberOfPoints * POINT_DIMENSIONS; for (unsigned j = 0; j < g_boundaryMapList.size(); j++) { std::vector<ImageType::IndexType> insideIndex; itk::ImageRegionConstIteratorWithIndex<ImageType> iter(g_boundaryMapList[j], g_boundaryMapList[j]->GetBufferedRegion()); for (iter.GoToBegin(); !iter.IsAtEnd(); ++iter) { if (iter.Get() > 0) { insideIndex.push_back(iter.GetIndex()); } } std::random_shuffle(insideIndex.begin(), insideIndex.end()); if (insideIndex.size() > g_numberOfPoints) { PointVectorType initialPoints; initialPoints.reserve(nVars); for (unsigned i = 0; i < g_numberOfPoints; i++) { for (unsigned j = 0; j < POINT_DIMENSIONS; j++) { int k = i; initialPoints.push_back((float) insideIndex[k][j]); } } g_pointList.push_back(initialPoints); } } updateScene();}
开发者ID:fayhot,项目名称:gradworks,代码行数:31,
示例13: QWindowWindow::Window(QScreen *screen) : QWindow (screen), scene_ (new BasicUsageScene){ setSurfaceType(OpenGLSurface); QSurfaceFormat format; format.setDepthBufferSize(24); format.setMajorVersion(3); format.setMinorVersion(3); format.setSamples(4); format.setProfile(QSurfaceFormat::CoreProfile); resize(800, 600); setFormat(format); create(); context_ = new QOpenGLContext(); context_->setFormat(format); context_->create(); scene_->setContext(context_); initializeGl(); connect(this, SIGNAL(widthChanged(int)), this, SLOT(resizeGl())); connect(this, SIGNAL(heightChanged(int)), this, SLOT(resizeGl())); resizeGl(); QTimer* timer = new QTimer(this); connect(timer, SIGNAL(timeout()), this, SLOT(updateScene())); timer->start(16);}
开发者ID:jholownia,项目名称:qtgl,代码行数:32,
示例14: makeCurrentvoid OpenCVwidget::resizeGL(int width, int height){ makeCurrent(); glViewport(0, 0, (GLint)width, (GLint)height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(0, width, 0, height, 0, 1); glMatrixMode(GL_MODELVIEW); mOutH = width/mImgRatio; mOutW = width; if(mOutH>height) { mOutW = height*mImgRatio; mOutH = height; } emit imageSizeChanged( mOutW, mOutH ); mPosX = (width-mOutW)/2; mPosY = (height-mOutH)/2; mSceneChanged = true; updateScene();}
开发者ID:TheKrystek,项目名称:ChessCam,代码行数:28,
示例15: makeCurrentvoid OpenCVViewer::resizeGL(int width, int height){ makeCurrent(); glViewport(0, 0, (GLint)width, (GLint)height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); // Draw image in the center of the area. glOrtho(0, width, 0, height, 0, 1); glMatrixMode(GL_MODELVIEW); outH = width/imgRatio; outW = width; if(outH > height) { outW = height*imgRatio; outH = height; } emit imageSizeChanged(outW, outH); posX = (width - outW)/2; posY = (height - outH)/2; isSceneChanged = true; updateScene();}
开发者ID:liuyenting,项目名称:NLC-Receiver,代码行数:30,
示例16: QImagebool OpenCVwidget::showImage( cv::Mat image ){ image.copyTo(mOrigImage); mImgRatio = (float)image.cols/(float)image.rows; if( mOrigImage.channels() == 3) mRenderQtImg = QImage((const unsigned char*)(mOrigImage.data), mOrigImage.cols, mOrigImage.rows, mOrigImage.step, QImage::Format_RGB888).rgbSwapped(); else if( mOrigImage.channels() == 1) mRenderQtImg = QImage((const unsigned char*)(mOrigImage.data), mOrigImage.cols, mOrigImage.rows, mOrigImage.step, QImage::Format_Indexed8); else return false; mRenderQtImg = QGLWidget::convertToGLFormat(mRenderQtImg); mSceneChanged = true; updateScene(); return true;}
开发者ID:TheKrystek,项目名称:ChessCam,代码行数:25,
示例17: whileint D3DApp::run(){ MSG msg = {0}; mTimer.reset(); while(msg.message != WM_QUIT) { // If there are Window messages then process them. if(PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) { TranslateMessage( &msg ); DispatchMessage( &msg ); } // Otherwise, do animation/game stuff. else { mTimer.tick(); if( !mAppPaused ) updateScene(mTimer.getDeltaTime()); else Sleep(50); drawScene(); } } return (int)msg.wParam;}
开发者ID:UmbleJA,项目名称:Games-Project-2,代码行数:29,
示例18: executeScene void executeScene() { if (!initialized) { initialize(); initialized = true; } updateScene(); }
开发者ID:SoniCoder,项目名称:Treasure-Hunt,代码行数:7,
示例19: SFacebool QGLWindow::showImage(const cv::Mat &image, const SFace &face) { // get the detected face position m_face = SFace(face); // keep original image ratio m_ratio = static_cast<float>(image.cols)/static_cast<float>(image.rows); // convert the image in a Qt/OpenGL one if (image.channels() == 3) { m_renderedImage = QImage((const unsigned char*)image.data, image.cols, image.rows, static_cast<int>(image.step), QImage::Format_RGB888); } else if (image.channels() == 1) { m_renderedImage = QImage((const unsigned char*)image.data, image.cols, image.rows, static_cast<int>(image.step), QImage::Format_Indexed8); } else return false; // impossible to convert the image // conversion needs to mirror back the image m_renderedImage = m_renderedImage.mirrored(); updateScene(); return true;}
开发者ID:Babouchot,项目名称:PanicEngine,代码行数:31,
示例20: showImagevoid QtOpenCVViewerGl::initializeGL(){ mSceneChanged = true; showImage(cv::Mat::zeros(480, 640, 16)); updateScene();}
开发者ID:flair2005,项目名称:WebCamCap,代码行数:8,
示例21: emitvoid QVoxelDeformerPanel::onFalloffChanged(double value){ if(!activeDeformer) return; activeDeformer->sigmaControl = value; emit(updateScene());}
开发者ID:GuoYanlin,项目名称:3d-workspace,代码行数:8,
示例22: connectvoid QVoxelDeformerPanel::setActiveScene( Scene * newScene){ activeScene = newScene; if(!activeScene) return; connect(this, SIGNAL(updateScene()), activeScene, SLOT(updateActiveObject()));}
开发者ID:GuoYanlin,项目名称:3d-workspace,代码行数:8,
示例23: QMainWindowMainWindow::MainWindow(QWidget *parent) :QMainWindow(parent) { ui.setupUi(this); m_particleColors = new QActionGroup(this); m_particleColors->addAction(ui.actionParticleBlack); m_particleColors->addAction(ui.actionParticleRed); m_particleColors->addAction(ui.actionParticleGreen); m_particleColors->addAction(ui.actionParticleBlue); m_particleColors->addAction(ui.actionParticleWhite); m_particleColors->addAction(ui.actionParticleHSV); ui.actionParticleHSV->setChecked(true); // QSize gvSize = ui.graphicsView->size(); // ui.graphicsView->setSceneRect(0, 0, gvSize.width(), gvSize.height()); // qDebug() << "Scene Rect: " << ui.graphicsView->sceneRect(); ui.graphicsView->setScene(&gs); ui.graphicsView->setRenderHints( QPainter::Antialiasing | QPainter::SmoothPixmapTransform); ui.graphicsView->scale(2, 2); ui.graphicsView->setBackgroundBrush(QBrush(Qt::black, Qt::SolidPattern)); // addImage(tr("/base/imageParticles/data/12.T2.slice.nrrd")); // addImage(tr("/base/imageParticles/data/13.T2.slice.nrrd"));#ifdef __APPLE__ addImage(tr("/data/2D/circle.jpg")); loadMask(tr("/data/2D/circle-boundary.png")); addImage(tr("/data/2D/circle.jpg")); loadMask(tr("/data/2D/random-boundary.jpg"));#else addImage(tr("/base/imageParticles/data/10.T2.slice.nrrd")); addImage(tr("/base/imageParticles/data/circle.jpg")); loadMask(tr("/base/imageParticles/data/circle-boundary.png")); loadMask(tr("/base/imageParticles/data/random-boundary.jpg"));#endif QObject::connect(&m_Timer, SIGNAL(timeout()), this, SLOT(particleAnimationTimeout())); QObject::connect(ui.actionShowImage, SIGNAL(triggered()), this, SLOT(updateScene())); QObject::connect(ui.actionShowShapeMask, SIGNAL(triggered()), this, SLOT(updateScene())); QObject::connect(ui.actionShowShapeDistanceMap, SIGNAL(triggered()), this, SLOT(updateScene())); QObject::connect(m_particleColors, SIGNAL(triggered(QAction*)), this, SLOT(updateScene())); QObject::connect(ui.actionShowPhantomParticles, SIGNAL(triggered()), this, SLOT(updateScene())); ui.listWidget->setCurrentRow(0);}
开发者ID:fayhot,项目名称:gradworks,代码行数:45,
示例24: updateScene/*! Function testing if the program must stop rendering or not. /param evt : Frame event to process. /return False if the program must be stopped.*/bool vpAROgre::stopTest(const Ogre::FrameEvent& evt){ // Always keep this part if(keepOn){ return updateScene(evt); } else return keepOn;}
开发者ID:tswang,项目名称:visp,代码行数:14,
示例25: updateScenevoid CanvasView::updateOutline(){ QList<QRectF> rect; rect.append(QRectF(_prevoutlinepoint.x() - _outlinesize, _prevoutlinepoint.y() - _outlinesize, _dia, _dia)); updateScene(rect);}
开发者ID:horkana,项目名称:Drawpile,代码行数:9,
示例26: connectvoid MapWidget::setMapView(QGraphicsView* view){ _view = view; _view->setScene(_scene); _view->setMaximumSize(589,514); _view->setMinimumSize(_view->maximumSize()); connect(_scene, SIGNAL(changed(QList<QRectF>)),_view,SLOT(updateScene(QList<QRectF>)));}
开发者ID:dmosora,项目名称:Query-Dependent,代码行数:9,
示例27: connectvoid VTKImageWidgetImplementation::connectSignals(){ connect( m_ViewerCore, SIGNAL( emitUpdateScene( ) ), this, SLOT( updateScene( ) ) ); connect( m_ViewerCore, SIGNAL( emitPhysicalCoordsChanged( util::fvector3 ) ), this, SLOT( lookAtPhysicalCoords( util::fvector3 ) ) ); connect( m_ViewerCore, SIGNAL( emitZoomChanged( float ) ), this, SLOT( setZoom( float ) ) ); connect( m_ViewerCore, SIGNAL( emitSetEnableCrosshair( bool ) ), this, SLOT( setEnableCrosshair( bool ) ) ); m_ViewerCore->emitImageContentChanged.connect( boost::bind( &VTKImageWidgetImplementation::reloadImage, this, _1 ) ); m_ViewerCore->emitCurrentImageChanged.connect( boost::bind( &VTKImageWidgetImplementation::currentImageChanged, this, _1 ) );}
开发者ID:JeffersonK,项目名称:vast,代码行数:9,
注:本文中的updateScene函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ updateScore函数代码示例 C++ updateResourceRequest函数代码示例 |