• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ GetRenderer函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: dc

void C3DView::OnPaint() 
{
	CPaintDC dc(this); // device context for painting
	
	if (GetRenderer())
		GetRenderer()->Redraw();	
}
开发者ID:srdp11,项目名称:particles-in-box,代码行数:7,代码来源:3DView.cpp


示例2: TTF_OpenFont

DisconnectedScreen::DisconnectedScreen() {
	ConfigUtility& config = ConfigUtility::GetSingleton();

	//setup the utility objects
	//TODO: (1) resource tool, to prevent reloading like this
	image.Load(GetRenderer(), config["dir.interface"] + "button_blue.png");
	font = TTF_OpenFont(config["client.font"].c_str(), 12);

	//check that the font loaded
	if (!font) {
		std::ostringstream msg;
		msg << "Failed to load a font file; " << SDL_GetError();
		throw(std::runtime_error(msg.str()));
	}

	//setup the button
	backButton.SetBackgroundTexture(GetRenderer(), image.GetTexture());
	backButton.SetText(GetRenderer(), font, WHITE, "Back");

	//set the button positions
	backButton.SetX(50);
	backButton.SetY(50);

	//set the disconnection message text
	textLine.SetX(50);
	textLine.SetY(30);
	textLine.SetText(GetRenderer(), font, WHITE, config["client.disconnectMessage"]);

	//full reset
	UDPNetworkUtility::GetSingleton().Unbind(Channels::SERVER);

	//auto return
	startTick = std::chrono::steady_clock::now();
}
开发者ID:Ratstail91,项目名称:Tortuga,代码行数:34,代码来源:disconnected_screen.cpp


示例3: GetRenderer

vtkProp* RenderView3D::PickProp( int posX, int posY, double* pos_out )
{
  vtkCellPicker* picker = vtkCellPicker::SafeDownCast( this->GetRenderWindow()->GetInteractor()->GetPicker() );
  if ( !picker )
  {
    return NULL;
  }

  picker->InitializePickList();
  vtkPropCollection* props = GetRenderer()->GetViewProps();
  if ( props )
  {
    props->InitTraversal();
    vtkProp* prop = props->GetNextProp();
    while ( prop )
    {
      if ( vtkActor::SafeDownCast( prop ) )
      {
        picker->AddPickList( prop );
      }
      prop = props->GetNextProp();
    }
  }
  picker->Pick( posX, rect().height() - posY, 0, GetRenderer() );
  if ( pos_out )
  {
    picker->GetPickPosition( pos_out );
  }
  return picker->GetViewProp();
}
开发者ID:neurodebian,项目名称:freesurfer,代码行数:30,代码来源:RenderView3D.cpp


示例4: GetRenderer

// Touch event handler.
bool COGActorPlayer::OnTouch (const OGVec2& _vPos, IOGTouchParam _param)
{
    if (_param != OG_TOUCH_DOWN)
        return false;

    if (m_bFinishLineFlight)
        return false;

    OGVec3 vP = GetRenderer()->UnprojectCoords((int)_vPos.x, (int)_vPos.y);
    OGVec3 vCam = GetRenderer()->GetCamera()->GetPosition();

    OGVec3 vDir = (vP - vCam).normalized();
    OGVec3 vPoint = FindIntersectionWithPlane(
        m_pPhysicalObject->GetPosition().y, 
        vCam, 
        vDir);
    m_vTarget = vPoint;

    m_OrientWorker.Reset();
    m_OrientWorker.SetTarget(vPoint);
    m_OrientWorker.Activate(true);

    m_CoolDown = 0;
    m_StraightenWorker.Activate(false);
    return true;
}
开发者ID:AndiSVCorporate,项目名称:orange-grass,代码行数:27,代码来源:ogactorplayer.cpp


示例5: DrawTitle

void DrawTitle()
{
	GList *elem,*elem2;
	Button *ref;
	SDL_Rect src;
	Editor_Panel* panel;
	Label* label;
	int n,i,j;
	if(game->gameState == &StateTitle){
		if(g_list_length(MainEditorPanels) != 0){
		for(n = 0; n < g_list_length(MainEditorPanels);++n)
		{
			elem = g_list_nth(MainEditorPanels,n);
			panel = (Editor_Panel*)elem->data;
			for(i = 0; i < g_list_length(panel->buttons);++i)
			{
				elem2 = g_list_nth(panel->buttons,i);
				ref = (Button*)elem2->data;
				DrawSprite(ref->sprite,ref->rect.x,ref->rect.y,ref->frame,GetRenderer(),SDL_FLIP_NONE);
			}
			for(i = 0; i < g_list_length(panel->labels);++i)
			{
				elem2 = g_list_nth(panel->labels,i);
				label = (Label*)elem2->data;
				DrawSprite(label->sprite,label->rect.x,label->rect.y,0,GetRenderer(),SDL_FLIP_NONE);
			}

		}
		}
	}
}
开发者ID:jam92,项目名称:IT276-Aard,代码行数:31,代码来源:game_title.c


示例6: GetTextureBuffer

bool SurfaceTextureBuffer::MakeCurrent(uint8 nFace)
{
	// Check whether the data is valid and whether there's a texture buffer
	if (m_cTextureBufferHandler.GetResource() && GetTextureBuffer()) {
		// Set target face
		if (GetTextureBuffer()->GetType() == PLRenderer::Resource::TypeTextureBufferCube)
			m_nFace = nFace;
		else
			m_nFace = 0;

		// Cleanup texture buffer handlers
		for (uint32 i=0; i<m_lstTextureBufferHandler.GetNumOfElements(); i++)
			delete m_lstTextureBufferHandler[i];
		m_lstTextureBufferHandler.Clear();

		// Add primary texture buffer handler
		PLRenderer::ResourceHandler *pTextureBufferHandler = new PLRenderer::ResourceHandler();
		pTextureBufferHandler->SetResource(m_cTextureBufferHandler.GetResource());
		m_lstTextureBufferHandler.Add(pTextureBufferHandler);

		// Frame buffer object used?
		if (m_pFrameBufferObject && m_cTextureBufferHandler.GetResource()) {
			m_pFrameBufferObject->SwitchTarget(static_cast<PLRenderer::TextureBuffer&>(*m_cTextureBufferHandler.GetResource()), 0, nFace);
			m_pFrameBufferObject->Bind();

			// Need rendering to depth only
			PLRenderer::TextureBuffer::EPixelFormat nFormat = GetTextureBuffer()->GetFormat();
			if (nFormat == PLRenderer::TextureBuffer::D16 || nFormat == PLRenderer::TextureBuffer::D24 || nFormat == PLRenderer::TextureBuffer::D32) {
				glDrawBuffer(GL_NONE);
				glReadBuffer(GL_NONE);
			} else {
				// Get extensions instance
				const Extensions &cExtensions = static_cast<Renderer&>(GetRenderer()).GetContext().GetExtensions();

				// Set draw buffers
				static const GLuint db[16] = { GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT1_EXT, GL_COLOR_ATTACHMENT2_EXT, GL_COLOR_ATTACHMENT3_EXT,
											   GL_COLOR_ATTACHMENT4_EXT, GL_COLOR_ATTACHMENT5_EXT, GL_COLOR_ATTACHMENT6_EXT, GL_COLOR_ATTACHMENT7_EXT,
											   GL_COLOR_ATTACHMENT8_EXT, GL_COLOR_ATTACHMENT9_EXT, GL_COLOR_ATTACHMENT10_EXT, GL_COLOR_ATTACHMENT11_EXT,
											   GL_COLOR_ATTACHMENT12_EXT, GL_COLOR_ATTACHMENT13_EXT, GL_COLOR_ATTACHMENT14_EXT, GL_COLOR_ATTACHMENT15_EXT};
				if (cExtensions.IsGL_ARB_draw_buffers())
					glDrawBuffersARB(m_nMaxColorTargets, db);
				else if (cExtensions.IsGL_ATI_draw_buffers())
					glDrawBuffersATI(m_nMaxColorTargets, db);
			}

		// Else...
		} // ... If there's no frame buffer, we can still 'render to texture' by only using glCopyTexSubImage2D() to
		  // copy the drawn stuff into a texture buffer. But this way, the current framebuffer content is 'overdrawn' and
		  // the texture buffer size we can render in is limited to the screen size.

		// Enable/disable multisample - "shouldn't" have an effect when render to texture, but safe is safe :D
		GetRenderer().SetRenderState(PLRenderer::RenderState::MultisampleEnable, !(GetFlags() & NoMultisampleAntialiasing));

		// Done
		return true;
	}

	// Error!
	return false;
}
开发者ID:ByeDream,项目名称:pixellight,代码行数:60,代码来源:SurfaceTextureBuffer.cpp


示例7: TTF_OpenFont

OptionsMenu::OptionsMenu() {
	ConfigUtility& config = ConfigUtility::GetSingleton();

	//setup the utility objects
	buttonImage.Load(GetRenderer(), config["dir.interface"] + "button_blue.png");
	font = TTF_OpenFont(config["client.font"].c_str(), 12);

	//check that the font loaded
	if (!font) {
		std::ostringstream msg;
		msg << "Failed to load a font file; " << SDL_GetError();
		throw(std::runtime_error(msg.str()));
	}

	//setup the button
	backButton.SetBackgroundTexture(GetRenderer(), buttonImage.GetTexture());
	backButton.SetText(GetRenderer(), font, WHITE, "Back");

	//set the button positions
	backButton.SetX(50);
	backButton.SetY(50);

	//text line
	textLine.SetX(50);
	textLine.SetY(30);
	textLine.SetText(GetRenderer(), font, WHITE, "Am I making any progress?");
}
开发者ID:Ratstail91,项目名称:Tortuga,代码行数:27,代码来源:options_menu.cpp


示例8: switch

int FLmitkComfortWidget::handle(int event) {
  switch(event) {
    case FL_MOUSEWHEEL:
      if (Fl::event_dy() > 0) {
  sliceCtrl->GetSlice()->Next();
      } else  {
  sliceCtrl->GetSlice()->Previous();
      }
      GetRenderer()->Render();
      draw();
      return 1;
      break;
    case FL_PUSH:
      m_LastX = Fl::event_x();
      m_LastY = Fl::event_y();
      return 1;
      break;
    case FL_DRAG:
      int dx = Fl::event_x() - m_LastX;
      int dy = Fl::event_y() - m_LastY;
      m_LastX = Fl::event_x();
      m_LastY = Fl::event_y();
      mitk::LevelWindow lvlWin;
      if (m_Node.IsNotNull() && m_Node->GetLevelWindow(lvlWin,GetRenderer())) {
  lvlWin.SetLevelWindow(lvlWin.GetLevel() + dy, lvlWin.GetWindow() + dx);
  m_Node->SetLevelWindow(lvlWin,GetRenderer());
  m_Node->SetLevelWindow(lvlWin,NULL);
  GetRenderer()->Render();
  draw();
      }
      return 1;
  }
  return FLmitkRenderWindow::handle(event);
}
开发者ID:151706061,项目名称:MITK,代码行数:34,代码来源:FLmitkComfortWidget.cpp


示例9: GetRenderer

 BacteroidsState::~BacteroidsState()
 {
     GetRenderer().GetGraphics()->DestroyShaderProgram(m_playerShader);
     GetRenderer().GetGraphics()->DestroyShaderProgram(m_bacterShader);
     GetRenderer().GetGraphics()->DestroyShaderProgram(m_projectileShader);
     GetRenderer().GetGraphics()->DestroyShaderProgram(m_fontShader);
 }
开发者ID:duudel,项目名称:bacteroids,代码行数:7,代码来源:BacteroidsState.cpp


示例10: GetRenderer

	void VCloudSkySystem::update(const float& timeSinceLastFrame)
	{
		if (!mCreated)
		{
			return;
		}

		GetRenderer()->setShader(mSkydomeShader);

		if (mTimeMultiplier != 0)
		{
			float timemultiplied = timeSinceLastFrame * mTimeMultiplier;

			mTimeOffset += timemultiplied;

			mController->update(timemultiplied);

			if (mStarfield)
			{
				GetApp()->getRenderer()->setShaderConstant1f("uTime", mTimeOffset*0.5f);
			}
		}
				
		GetRenderer()->setShader(mSkydomeShader);
		GetApp()->getRenderer()->setShaderConstant3f("uLightDir", mController->getSunDirection().ToFloatPtr());
		
		mMoonManager->updateMoonPhase(mController->getMoonPhase());
		mCloudsManager->update();
		mVCloudsManager->update(timeSinceLastFrame);
	}
开发者ID:DanielNeander,项目名称:my-3d-engine,代码行数:30,代码来源:VCloudSkySystem.cpp


示例11: GetRenderer

	void CloudLayer::_updateInternalPassParameters()
	{
		GetRenderer()->setShader(mSkyX->mCloudShader);
		GetRenderer()->setShaderConstant1f("uExposure", mSkyX->getAtmosphereManager()->getOptions().Exposure);
		GetRenderer()->setShaderConstant1f("uTime", mSkyX->_getTimeOffset()*mOptions.TimeMultiplier);

		float point = (mSkyX->getController()->getSunDirection().y + 1.0f) / 2.0f;
		GetRenderer()->setShaderConstant3f("uSunColor", mSunGradient.getColor(point).ToFloatPtr());
		GetRenderer()->setShaderConstant3f("uAmbientLuminosity", mAmbientGradient.getColor(point).ToFloatPtr());
		
		//mCloudLayerPass->getFragmentProgramParameters()
		//	->setNamedConstant("uExposure", mSkyX->getAtmosphereManager()->getOptions().Exposure);
		//mCloudLayerPass->getFragmentProgramParameters()
		//	->setNamedConstant("uTime", mSkyX->_getTimeOffset()*mOptions.TimeMultiplier);
		/*
		mCloudLayerPass->getFragmentProgramParameters()
			->setNamedConstant("uSunPosition", -mSkyX->getAtmosphereManager()->getSunDirection()*mSkyX->getMeshManager()->getSkydomeRadius());
		
		noVec3 AmbientColor = noVec3::ZERO;

		noVec3 SunDir   = -mSkyX->getAtmosphereManager()->getSunDirection();
		float Ang = 0;
		for (int k = 0; k < 3; k++)
		{
			noVec2 Coords = noVec2(noMath::Cos(Ang), noMath::Sin(Ang));
			Ang += 2*noMath::PI/3;
			AmbientColor += mSkyX->getAtmosphereManager()->getColorAt(noVec3(Coords.x, mOptions.Height/mSkyX->getMeshManager()->getSkydomeRadius(), Coords.y).normalisedCopy());
		}

		AmbientColor /= 3;

		mCloudLayerPass->getFragmentProgramParameters()
			->setNamedConstant("uAmbientLuminosity", AmbientColor*0.75f);

		float Mult = 1.5f;

		mCloudLayerPass->getFragmentProgramParameters()
			->setNamedConstant("uSunColor", noVec3(
			     noMath::Clamp<float>(AmbientColor.x*Mult, 0, 1),
			     noMath::Clamp<float>(AmbientColor.y*Mult, 0, 1),
			     noMath::Clamp<float>(AmbientColor.z*Mult, 0, 1)));
		*/

		//noVec3 SunDir = mSkyX->getAtmosphereManager()->getSunDirection();
		//if (SunDir.y > 0.15f)
		//{
		//	SunDir = -SunDir;
		//}

	//	mCloudLayerPass->getFragmentProgramParameters()
	//		->setNamedConstant("uSunPosition", -SunDir*mSkyX->getMeshManager()->getSkydomeRadius());

		//float point = (mSkyX->getController()->getSunDirection().y + 1.0f) / 2.0f;

		/*mCloudLayerPass->getFragmentProgramParameters()
		->setNamedConstant("uSunColor", mSunGradient.getColor(point));
		mCloudLayerPass->getFragmentProgramParameters()
		->setNamedConstant("uAmbientLuminosity", mAmbientGradient.getColor(point));*/
	}
开发者ID:DanielNeander,项目名称:my-3d-engine,代码行数:59,代码来源:CloudsManager.cpp


示例12: GetRenderer

void C3DView::OnMouseMove(UINT nFlags, CPoint point) 
{
	if (GetRenderer())
	{
		GetRenderer()->OnMouseMove(nFlags, point.x, point.y);
		ChangeCursor();
	}
	CView::OnMouseMove(nFlags, point);
}
开发者ID:srdp11,项目名称:particles-in-box,代码行数:9,代码来源:3DView.cpp


示例13: RenderFont

void RenderFont(char *message,SDL_Rect &rect,TTF_Font *f,SDL_Color *fg)
{
    SDL_Surface * text;
    SDL_Texture * texture;
    text = TTF_RenderText_Solid(f, message , *fg);
    texture = SDL_CreateTextureFromSurface(GetRenderer(),text);
    SDL_QueryTexture(texture,NULL,NULL,&rect.w,&rect.h);
    SDL_RenderCopy(GetRenderer(),texture,NULL,&rect);

}
开发者ID:jam92,项目名称:IT276-Aard,代码行数:10,代码来源:graphics.c


示例14: GetTextureBuffer

bool SurfaceTextureBuffer::MakeCurrent(uint8 nFace)
{
	// Check whether the data is valid and whether there's a texture buffer
	if (m_cTextureBufferHandler.GetResource() && GetTextureBuffer()) {
		// Set target face
		if (GetTextureBuffer()->GetType() == PLRenderer::Resource::TypeTextureBufferCube)
			m_nFace = nFace;
		else
			m_nFace = 0;

		// Cleanup texture buffer handlers
		for (uint32 i=0; i<m_lstTextureBufferHandler.GetNumOfElements(); i++)
			delete m_lstTextureBufferHandler[i];
		m_lstTextureBufferHandler.Clear();

		// Add primary texture buffer handler
		PLRenderer::ResourceHandler *pTextureBufferHandler = new PLRenderer::ResourceHandler();
		pTextureBufferHandler->SetResource(m_cTextureBufferHandler.GetResource());
		m_lstTextureBufferHandler.Add(pTextureBufferHandler);

		// Frame buffer object used?
		if (m_pFrameBufferObject && m_cTextureBufferHandler.GetResource()) {
			m_pFrameBufferObject->SwitchTarget(static_cast<PLRenderer::TextureBuffer&>(*m_cTextureBufferHandler.GetResource()), 0, nFace);
			m_pFrameBufferObject->Bind();

			// Need rendering to depth only
			PLRenderer::TextureBuffer::EPixelFormat nFormat = GetTextureBuffer()->GetFormat();
			const Extensions &cExtensions = static_cast<Renderer&>(GetRenderer()).GetContext().GetExtensions();
			if (nFormat == PLRenderer::TextureBuffer::D16 || nFormat == PLRenderer::TextureBuffer::D24 || nFormat == PLRenderer::TextureBuffer::D32) {
				// "GL_NV_read_buffer"-extension available?
				if (cExtensions.IsGL_NV_read_buffer())
					glReadBufferNV(GL_NONE);
			} else {
				// "GL_ARB_draw_buffers" & "GL_NV_fbo_color_attachments" extensions available?
				if (cExtensions.IsGL_ARB_draw_buffers() && cExtensions.IsGL_NV_fbo_color_attachments()) {
					// Set draw buffers
					static const GLenum db[16] = { GL_COLOR_ATTACHMENT0_NV, GL_COLOR_ATTACHMENT1_NV, GL_COLOR_ATTACHMENT2_NV, GL_COLOR_ATTACHMENT3_NV,
												   GL_COLOR_ATTACHMENT4_NV, GL_COLOR_ATTACHMENT5_NV, GL_COLOR_ATTACHMENT6_NV, GL_COLOR_ATTACHMENT7_NV,
												   GL_COLOR_ATTACHMENT8_NV, GL_COLOR_ATTACHMENT9_NV, GL_COLOR_ATTACHMENT10_NV, GL_COLOR_ATTACHMENT11_NV,
												   GL_COLOR_ATTACHMENT12_NV, GL_COLOR_ATTACHMENT13_NV, GL_COLOR_ATTACHMENT14_NV, GL_COLOR_ATTACHMENT15_NV};
					glDrawBuffersARB(m_nMaxColorTargets, db);
				}
			}
		}

		// Enable/disable multisample - "shouldn't" have an effect when render to texture, but safe is safe :D
		GetRenderer().SetRenderState(PLRenderer::RenderState::MultisampleEnable, !(GetFlags() & NoMultisampleAntialiasing));

		// Done
		return true;
	}

	// Error!
	return false;
}
开发者ID:ByeDream,项目名称:pixellight,代码行数:55,代码来源:SurfaceTextureBuffer.cpp


示例15:

//[-------------------------------------------------------]
//[ Private virtual PLRenderer::TextureBuffer functions   ]
//[-------------------------------------------------------]
bool TextureBuffer2DArray::MakeCurrent(uint32 nStage)
{
	// Check if there are renderer information
	if (GetRenderer().GetTextureBuffer(nStage) != this) {
		if (!GetRenderer().SetTextureBuffer(nStage, this))
			return true; // Done
	}

	// Done
	return true;
}
开发者ID:ByeDream,项目名称:pixellight,代码行数:14,代码来源:TextureBuffer2DArray.cpp


示例16: RenderView

RenderView3D::RenderView3D( QWidget* parent ) : RenderView( parent )
{
  this->GetRenderWindow()->GetInteractor()->SetDesiredUpdateRate(30);
  this->GetRenderWindow()->GetInteractor()->SetStillUpdateRate(0.01);

 GetRenderWindow()->SetAlphaBitPlanes(0);
 GetRenderWindow()->SetMultiSamples(0);
 GetRenderer()->SetUseDepthPeeling(true);
 GetRenderer()->SetMaximumNumberOfPeels(4);
 GetRenderer()->SetOcclusionRatio(0);

  m_bShowSliceFrames = true;
  m_bShowAxes = true;
  for ( int i = 0; i < 3; i++ )
  {
    m_actorSliceFrames[i] = vtkSmartPointer<vtkActor>::New();
    m_actorSliceFrames[i]->SetMapper( vtkSmartPointer<vtkPolyDataMapper>::New() );
    m_actorSliceFrames[i]->GetProperty()->SetRepresentationToWireframe();
    m_actorSliceFrames[i]->GetProperty()->SetDiffuse( 0.0 );
    m_actorSliceFrames[i]->GetProperty()->SetAmbient( 1.0 );
    m_bSliceVisibility[i] = true;

    m_actorSliceBoundingBox[i] = vtkSmartPointer<vtkActor>::New();
    m_cubeSliceBoundingBox[i] = vtkSmartPointer<vtkCubeSource>::New();
    vtkSmartPointer<vtkPolyDataMapper> mapper = vtkSmartPointer<vtkPolyDataMapper>::New();
    mapper->SetInputConnection( m_cubeSliceBoundingBox[i]->GetOutputPort() );
    m_actorSliceBoundingBox[i]->SetMapper( mapper );
    mapper->Update();
    m_actorSliceBoundingBox[i]->GetProperty()->SetRepresentationToWireframe();
  }
  HighlightSliceFrame( -1 );

  m_cursor3D = new Cursor3D( this );
  m_interactorNavigate = new Interactor3DNavigate( this );
  m_interactorMeasure = new Interactor3DMeasure( this );
  m_interactorVolumeCrop = new Interactor3DVolumeCrop(this);
  connect(m_cursor3D, SIGNAL(Updated()), this, SLOT(RequestRedraw()));

  m_actorScalarBar->SetNumberOfLabels( 4 );

  m_actorAxesActor = vtkSmartPointer<vtkCubeAxesActor>::New();
  m_actorAxesActor->XAxisLabelVisibilityOn();
  m_actorAxesActor->YAxisLabelVisibilityOn();
  m_actorAxesActor->ZAxisLabelVisibilityOn();
  m_actorAxesActor->SetXTitle("");
  m_actorAxesActor->SetYTitle("");
  m_actorAxesActor->SetZTitle("");
  m_actorAxesActor->SetFlyModeToClosestTriad();
  m_actorAxesActor->SetCamera(m_renderer->GetActiveCamera());


  SetInteractionMode(IM_Navigate);
}
开发者ID:neurodebian,项目名称:freesurfer,代码行数:53,代码来源:RenderView3D.cpp


示例17: if

void QmitkSliceWidget::InitWidget(mitk::SliceNavigationController::ViewDirection viewDirection)
{
  m_View = viewDirection;

  mitk::SliceNavigationController *controller = m_RenderWindow->GetSliceNavigationController();

  if (viewDirection == mitk::SliceNavigationController::Axial)
  {
    controller->SetViewDirection(mitk::SliceNavigationController::Axial);
  }
  else if (viewDirection == mitk::SliceNavigationController::Frontal)
  {
    controller->SetViewDirection(mitk::SliceNavigationController::Frontal);
  }
  // init sagittal view
  else
  {
    controller->SetViewDirection(mitk::SliceNavigationController::Sagittal);
  }

  if (m_SlicedGeometry.IsNull())
  {
    return;
  }

  mitk::BaseGeometry::Pointer geometry = static_cast<mitk::BaseGeometry *>(m_SlicedGeometry->Clone().GetPointer());

  const mitk::BoundingBox::Pointer boundingbox = m_DataStorage->ComputeVisibleBoundingBox(GetRenderer(), nullptr);

  if (boundingbox->GetPoints()->Size() > 0)
  {
    // let's see if we have data with a limited live-span ...
    mitk::TimeBounds timebounds = m_DataStorage->ComputeTimeBounds(GetRenderer(), nullptr);

    mitk::ProportionalTimeGeometry::Pointer timeGeometry = mitk::ProportionalTimeGeometry::New();
    timeGeometry->Initialize(geometry, 1);

    {
      timeGeometry->SetFirstTimePoint(timebounds[0]);
      timeGeometry->SetStepDuration(1.0);
    }

    if (timeGeometry->GetBoundingBoxInWorld()->GetDiagonalLength2() >= mitk::eps)
    {
      controller->SetInputWorldTimeGeometry(timeGeometry);
      controller->Update();
    }
  }

  GetRenderer()->GetCameraController()->Fit();
  mitk::RenderingManager::GetInstance()->RequestUpdate(GetRenderer()->GetRenderWindow());
}
开发者ID:Cdebus,项目名称:MITK,代码行数:52,代码来源:QmitkSliceWidget.cpp


示例18: SDL_LockTexture

//-----------------------------------------------------------------------------
void AdScreen::Present(void) {
    int pitch;
    void* pixels;

    SDL_LockTexture(s_pTexture, NULL, &pixels, &pitch);

    SDL_ConvertPixels(
        s_pScreen->w,
        s_pScreen->h,
        s_pScreen->format->format,
        s_pScreen->pixels,
        s_pScreen->pitch,
        SDL_PIXELFORMAT_RGBA8888,
        pixels, pitch
    );

    SDL_UnlockTexture(s_pTexture);

    SDL_RenderCopy(GetRenderer(), s_pTexture, NULL, NULL);
    SDL_RenderPresent(GetRenderer());

    s_iFrames++;

    s_uiCurrentCount = SDL_GetPerformanceCounter();
    s_uiDiffCount    = (s_uiCurrentCount-s_uiLastCount);
    s_uiCountFreq    = SDL_GetPerformanceFrequency();

    s_fElapsedTime = ((float) s_uiDiffCount/(float) s_uiCountFreq);

    if((1.0f/60.0f)-s_fElapsedTime > 0) {
        // NOTE: without this there seems to be a more consistent framerate
        // but on older computers sometimes the vsync doesn't work right
        //SDL_Delay((uint32_t) (1000.0f*((1.0f/60.0f)-s_fElapsedTime)));

        s_fTotTime += 1.0f/60.0f;
    } else {
        s_fTotTime += s_fElapsedTime;
    }

    s_uiLastCount = s_uiCurrentCount;

    if(s_fTotTime >= 1.0f) {
        char strTitle[0x20] = "";
        sprintf(strTitle, "%s, FPS: %d", WINDOW_TITLE, s_iFrames);

        SDL_SetWindowTitle(GetWindow(), strTitle);

        s_fTotTime  = 0;
        s_iFrames = 0;
    }
}
开发者ID:srmeier,项目名称:Avocado,代码行数:52,代码来源:AdScreen.cpp


示例19: Q_ASSERT

vtkRenderer * View::GetRenderer( int level )
{
    Q_ASSERT( level <= 2 );

    if( level == 0 )
        return GetRenderer();
    if( level == 1 )
        return GetOverlayRenderer();
    if( level == 2 )
        return GetOverlayRenderer2();

    // Just in case
    return GetRenderer();
}
开发者ID:IbisNeuronav,项目名称:Ibis,代码行数:14,代码来源:view.cpp


示例20: GetRenderer

void wxGraphicsPathData::AddEllipse( wxDouble x, wxDouble y, wxDouble w, wxDouble h)
{
    wxDouble rw = w/2;
    wxDouble rh = h/2;
    wxDouble xc = x + rw;
    wxDouble yc = y + rh;
    wxGraphicsMatrix m = GetRenderer()->CreateMatrix();
    m.Translate(xc,yc);
    m.Scale(rw/rh,1.0);
    wxGraphicsPath p = GetRenderer()->CreatePath();
    p.AddCircle(0,0,rh);
    p.Transform(m);
    AddPath(p.GetPathData());
}
开发者ID:252525fb,项目名称:rpcs3,代码行数:14,代码来源:graphcmn.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetRepObject函数代码示例发布时间:2022-05-30
下一篇:
C++ GetRemoteAddress函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap