当前位置: 首页>>代码示例>>C++>>正文


C++ requestRedraw函数代码示例

本文整理汇总了C++中requestRedraw函数的典型用法代码示例。如果您正苦于以下问题:C++ requestRedraw函数的具体用法?C++ requestRedraw怎么用?C++ requestRedraw使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了requestRedraw函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: getSurface

/**
* Set the offset in u-coordinate of a 2d (unwrapped) surface
*/
void InstrumentWidgetRenderTab::setUCorrection() {
  auto surface = getSurface();
  auto rotSurface = boost::dynamic_pointer_cast<RotationSurface>(surface);
  if (rotSurface) {
    QPointF oldUCorr = rotSurface->getUCorrection();
    // ask the user to enter a number for the u-correction
    UCorrectionDialog dlg(this, oldUCorr, rotSurface->isManualUCorrection());
    if (dlg.exec() != QDialog::Accepted)
      return;

    QSettings settings;
    settings.beginGroup(m_instrWidget->getInstrumentSettingsGroupName());

    if (dlg.applyCorrection()) {
      QPointF ucorr = dlg.getValue();
      // update the surface only if the correction changes
      if (ucorr != oldUCorr) {
        rotSurface->setUCorrection(ucorr.x(),
                                   ucorr.y()); // manually set the correction
        rotSurface->requestRedraw();           // redraw the view
        settings.setValue(EntryManualUCorrection, true);
        settings.setValue(EntryUCorrectionMin, ucorr.x());
        settings.setValue(EntryUCorrectionMax, ucorr.y());
      }
    } else {
      rotSurface->setAutomaticUCorrection(); // switch to automatic correction
      rotSurface->requestRedraw();           // redraw the view
      settings.remove(EntryManualUCorrection);
      settings.remove(EntryUCorrectionMin);
      settings.remove(EntryUCorrectionMax);
    }
  }
}
开发者ID:liyulun,项目名称:mantid,代码行数:36,代码来源:InstrumentWidgetRenderTab.cpp

示例2: requestRedraw

void FalagardActionButton::setPercentageImage(const String& animateName, int cur, int total)
{
    const Animate* pAnimate = 0;
    d_percentageImg = 0;

    //0.check para.
    if(abs(cur) > abs(total))
    {
        requestRedraw();
        return;
    }

    //1.get animate.
    if(animateName.empty())
    {
        pAnimate = AnimateManager::getSingleton().getAnimate((utf8*)"Percentage");
    }
    else
    {
        pAnimate = AnimateManager::getSingleton().getAnimate(animateName);
    }

    //2.get img used to draw percentage.
    if(pAnimate)
    {
        d_percentageImg = pAnimate->getFrame(abs(cur), abs(total));
    }

    requestRedraw();
}
开发者ID:jjiezheng,项目名称:pap_full,代码行数:30,代码来源:FalActionButton.cpp

示例3: updateRenderableImageColours

/*************************************************************************
	Sets the colours to be applied when rendering the image.
*************************************************************************/
void StaticImage::setImageColours(const ColourRect& colours)
{
	d_imageCols = colours;
	updateRenderableImageColours();

	requestRedraw();
}
开发者ID:DarkKlo,项目名称:maf2mp,代码行数:10,代码来源:CEGUIStaticImage.cpp

示例4: performWindowLayout

	/*************************************************************************
		Handler called when size is changed
	*************************************************************************/
	void FalagardRewardItem::onSized(WindowEventArgs& e)
	{
		FalagardButton::onSized(e);

		performWindowLayout();
		requestRedraw();
	}
开发者ID:brock7,项目名称:TianLong,代码行数:10,代码来源:FalagardRewardItem.cpp

示例5: getCaptureWindow

/*************************************************************************
	Update the internal state of the Widget
*************************************************************************/
void ButtonBase::updateInternalState(const Point& mouse_pos)
{
	bool oldstate = d_hovering;

	// assume not hovering 
	d_hovering = false;

	// if input is captured, but not by 'this', then we never hover highlight
	const Window* capture_wnd = getCaptureWindow();

	if ((capture_wnd == NULL) || (capture_wnd == this))
	{
		Window* sheet = System::getSingleton().getGUISheet();

		if (sheet != NULL)
		{
			// check if hovering highlight is required, which is basically ("mouse over widget" XOR "widget pushed").
			if ((this == sheet->getChildAtPosition(mouse_pos)) != d_pushed)
			{
				d_hovering = true;
			}

		}

	}

	// if state has changed, trigger a re-draw
	if (oldstate != d_hovering)
	{
		requestRedraw();
	}

}
开发者ID:50p,项目名称:multitheftauto,代码行数:36,代码来源:CEGUIButtonBase.cpp

示例6: switch

void FalagardActionButton::setCornerChar(int nPos, const String32& strChar)
{
    String32 strCharSafe="  ";
    if(strChar.size() > 3)
    {
        strCharSafe += strChar.substr(0, 3);
    }
    else strCharSafe += strChar;
    strCharSafe[0] = 0XFBFFFFFF;
    strCharSafe[1] = 0XFC010101;

    switch(nPos)
    {
    case 0:
        d_CornerChar_TopLeft.d_Char		= strCharSafe;
        break;
    case 1:
        d_CornerChar_TopRight.d_Char	= strCharSafe;
        break;
    case 2:
        d_CornerChar_BotLeft.d_Char		= strCharSafe;
        break;
    case 3:
        d_CornerChar_BotRight.d_Char	= strCharSafe;
        break;
    default:
        break;
    }

    requestRedraw();
}
开发者ID:jjiezheng,项目名称:pap_full,代码行数:31,代码来源:FalActionButton.cpp

示例7: getCaptureWindow

void ButtonBase::updateInternalState(const Point& mouse_pos)
{
    // This code is rewritten and has a slightly different behaviour
    // it is no longer fully "correct", as overlapping windows will not be
    // considered if the widget is currently captured.
    // On the other hand it's alot faster, so I believe it's a worthy
    // tradeoff

    bool oldstate = d_hovering;

    // assume not hovering
    d_hovering = false;

    // if input is captured, but not by 'this', then we never hover highlight
    const Window* capture_wnd = getCaptureWindow();
    if (capture_wnd == 0)
    {
        System* sys = System::getSingletonPtr();
        if (sys->getWindowContainingMouse() == this && isHit(mouse_pos))
        {
            d_hovering = true;
        }
    }
    else if (capture_wnd == this && isHit(mouse_pos))
    {
        d_hovering = true;
    }

    // if state has changed, trigger a re-draw
    if (oldstate != d_hovering)
    {
        requestRedraw();
    }
}
开发者ID:erickterri,项目名称:3dlearn,代码行数:34,代码来源:ELGUIButtonBase.cpp

示例8: getCamera

void ossimPlanetViewer::updateTraversal()
{
   ossimPlanetTerrain* terrain = dynamic_cast<ossimPlanetTerrain*>(terrainLayer());
   if(terrain&&!terrain->getDatabasePager()) terrain->setDatabasePager(getDatabasePager());

   if(!mkUtils::almostEqual(theCurrentViewMatrix,
                            getCamera()->getViewMatrix()))
   {
      theCurrentViewMatrix        = getCamera()->getViewMatrix();
      theCurrentViewMatrixInverse = theCurrentViewMatrix.inverse(theCurrentViewMatrix);
      computeCurrentCameraInfo();
      const ossimPlanetGeoRefModel* landModel = model();

      // let's do a crude normalize distance to do an estimate NearFarRatio
      //
      if(getCamera()&&landModel&&theCurrentLookAt.valid()&&theCurrentCamera.valid()&&theCalculateNearFarRatioFlag)
      {
         double dist = ossim::min(theCurrentLookAt->range(),
                                  theCurrentCamera->altitude())/osg::WGS_84_RADIUS_EQUATOR;
         double t = log(1+dist);
         t = ossim::clamp(t, 0.0, 1.0);
         double ratio = .1*(t) + (.0000001)*(1.0-t);
         getCamera()->setNearFarRatio(ossim::min(.001, ratio));
      }
      notifyViewChanged();
   }
   osgViewer::Viewer::updateTraversal();
   if(theEphemerisCamera.valid())
   {
      if(theEphemerisCamera.valid())
      {
         theEphemerisCamera->setGraphicsContext(getCamera()->getGraphicsContext());
         theEphemerisCamera->setRenderTargetImplementation( getCamera()->getRenderTargetImplementation() );
      }
      osg::Viewport* viewport    = getCamera()->getViewport();
      osg::Viewport* ephViewport = theEphemerisCamera->getViewport();
      if(viewport&&ephViewport)
      {
         if(!ossim::almostEqual(viewport->x(), ephViewport->x())||
            !ossim::almostEqual(viewport->y(), ephViewport->y())||
            !ossim::almostEqual(viewport->width(), ephViewport->width())||
            !ossim::almostEqual(viewport->height(), ephViewport->height()))
         {            
            ephViewport->setViewport(viewport->x(), 
                                     viewport->y(), 
                                     viewport->width(), 
                                     viewport->height());
         }
      }
      theEphemerisCamera->setProjectionMatrix(getCamera()->getProjectionMatrix());
      theEphemerisCamera->setViewMatrix(getCamera()->getViewMatrix());
   }
   bool databasePagerHasRequests = getDatabasePager()?getDatabasePager()->requiresUpdateSceneGraph():false;//||
                                                       //getDatabasePager()->requiresCompileGLObjects()):false;
   if(databasePagerHasRequests)
   {
      requestRedraw();
   }
   
}
开发者ID:star-labs,项目名称:star_ossim,代码行数:60,代码来源:ossimPlanetViewer.cpp

示例9: removeButtonForTabContent

/*************************************************************************
Remove a tab by ID
*************************************************************************/
void TabControl::removeTab(uint ID)
{
    // do nothing if given window is not attached as a tab.
    if (!d_tabContentPane->isChild(ID))
        return;

    Window* wnd = d_tabContentPane->getChild(ID);
    // Was this selected?
    bool reselect = wnd->isVisible();
    // Tab buttons are the 2nd onward children
    d_tabContentPane->removeChildWindow(ID);

    // remove button too
    removeButtonForTabContent(wnd);

    if (reselect)
    {
        // Select another tab
        if (getTabCount() > 0)
        {
            setSelectedTab(d_tabContentPane->getChildAtIdx(0)->getName());
        }
    }

    performChildWindowLayout();

    requestRedraw();

}
开发者ID:gitrider,项目名称:wxsj2,代码行数:32,代码来源:CEGUITabControl.cpp

示例10: requestRedraw

/*************************************************************************
	Event generated internally whenever the roll-up / shade state of the
	window changes.
*************************************************************************/
void FrameWindow::onRollupToggled(WindowEventArgs& e)
{
    requestRedraw();
    notifyClippingChanged();

	fireEvent(EventRollupToggled, e, EventNamespace);
}
开发者ID:Silentfood,项目名称:oonline,代码行数:11,代码来源:CEGUIFrameWindow.cpp

示例11: performWindowLayout

	void FalagardChatHistory::onSized(WindowEventArgs& e)
	{
		Window::onSized(e);

		performWindowLayout();
		requestRedraw();
	}
开发者ID:gitrider,项目名称:wxsj2,代码行数:7,代码来源:FalChatHistory.cpp

示例12: requestRedraw

/*************************************************************************
	Set the formatting required for the image.	
*************************************************************************/
void StaticImage::setFormatting(HorzFormatting h_fmt, VertFormatting v_fmt)
{
	d_image.setHorzFormatting((RenderableImage::HorzFormatting)h_fmt);
	d_image.setVertFormatting((RenderableImage::VertFormatting)v_fmt);

	requestRedraw();
}
开发者ID:DarkKlo,项目名称:maf2mp,代码行数:10,代码来源:CEGUIStaticImage.cpp

示例13: requestRedraw

void PushButton::setStandardImageryEnabled(bool setting)
{
    if (d_useStandardImagery != setting)
    {
        d_useStandardImagery = setting;
        requestRedraw();
    }
}
开发者ID:gitrider,项目名称:wxsj2,代码行数:8,代码来源:CEGUIPushButton.cpp

示例14: resortList

/*************************************************************************
	Causes the list box to update it's internal state after changes have
	been made to one or more attached ListboxItem objects.
*************************************************************************/
void Listbox::handleUpdatedItemData(void)
{
    if (d_sorted)
        resortList();

	configureScrollbars();
	requestRedraw();
}
开发者ID:Silentfood,项目名称:oonline,代码行数:12,代码来源:CEGUIListbox.cpp

示例15: pickPoint

void RNDFEditGLView::mouseMoveEvent(QMouseEvent *event) {
  double x2, y2;
  pickPoint(event->x(), event->y(), &x2, &y2);
  double utm_x = x2 + gui->rndf_center.x;
  double utm_y = y2 + gui->rndf_center.y;
  std::string utm_zone = gui->rndf_center.zone;
  gui->last_utm_x = utm_x;
  gui->last_utm_y = utm_y;

  switch (event->modifiers()) {
    case Qt::ControlModifier: // selected object is affected
        // update undo buffer
      if(gui->last_rn_) {delete gui->last_rn_;}
      if(gui->last_rn_search_) {delete gui->last_rn_search_;}
      gui->last_rn_ = new rndf::RoadNetwork(*gui->rn_);
      gui->last_rn_search_ = new rndf::RoadNetworkSearch(*gui->rn_search_, gui->last_rn_);
      if (event->buttons().testFlag(Qt::LeftButton)) {
        gui->moveElement(utm_x, utm_y, utm_zone);
      }
      else if (event->buttons() & Qt::RightButton) {
        gui->rotateElement(utm_x, utm_y, utm_zone);
     }

      gui->updateSmoothedLaneStack();
      requestRedraw();
      break;

    case Qt::NoModifier:
      gui->last_mouse_x = event->x();
      gui->last_mouse_y = event->y();
      if (gui->current_element == RNDF_ELEMENT_EXIT) {
        requestRedraw();
      }
      else {
        GLWidget::mouseMoveEvent(event);
      }

    default: // let base class handle other cases
      GLWidget::mouseMoveEvent(event);
      break;
  }

  gui->last_move_utm_x = utm_x;
  gui->last_move_utm_y = utm_y;
}
开发者ID:Forrest-Z,项目名称:stanford_self_driving_car_code,代码行数:45,代码来源:RNDFEditGLView.cpp


注:本文中的requestRedraw函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。