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


C++ Mapper::MitkRender方法代码示例

本文整理汇总了C++中Mapper::MitkRender方法的典型用法代码示例。如果您正苦于以下问题:C++ Mapper::MitkRender方法的具体用法?C++ Mapper::MitkRender怎么用?C++ Mapper::MitkRender使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mapper的用法示例。


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

示例1:

/*!
\brief

Called by the vtkMitkRenderProp in order to start MITK rendering process.
*/
int mitk::VtkPropRenderer::Render(mitk::VtkPropRenderer::RenderType type)
{
  // Do we have objects to render?
  if (this->GetEmptyWorldGeometry())
    return 0;

  if (m_DataStorage.IsNull())
    return 0;

  // Update mappers and prepare mapper queue
  if (type == VtkPropRenderer::Opaque)
    this->PrepareMapperQueue();

  // go through the generated list and let the sorted mappers paint
  for (auto it = m_MappersMap.cbegin(); it != m_MappersMap.cend(); it++)
  {
    Mapper *mapper = (*it).second;
    mapper->MitkRender(this, type);
  }

  // Render text
  if (type == VtkPropRenderer::Overlay)
  {
    if (m_TextCollection.size() > 0)
    {
      m_TextRenderer->SetViewport(this->GetVtkRenderer()->GetViewport());
      for (auto it = m_TextCollection.begin(); it != m_TextCollection.end(); ++it)
        m_TextRenderer->AddViewProp((*it).second);
      m_TextRenderer->Render();
    }
  }
  return 1;
}
开发者ID:Cdebus,项目名称:MITK,代码行数:38,代码来源:mitkVtkPropRenderer.cpp

示例2: if

/*!
\brief

Called by the vtkMitkRenderProp in order to start MITK rendering process.
*/
int mitk::VtkPropRenderer::Render(mitk::VtkPropRenderer::RenderType type)
{
  // Do we have objects to render?
  if ( this->GetEmptyWorldGeometry())
    return 0;

  if ( m_DataStorage.IsNull())
    return 0;

  // Update mappers and prepare mapper queue
  if (type == VtkPropRenderer::Opaque)
    this->PrepareMapperQueue();

  //go through the generated list and let the sorted mappers paint
  bool lastVtkBased = true;
  //bool sthVtkBased = false;

  for(MappersMapType::iterator it = m_MappersMap.begin(); it != m_MappersMap.end(); it++)
  {
    Mapper * mapper = (*it).second;

    VtkMapper* vtkmapper = dynamic_cast<VtkMapper*>(mapper);

    if(vtkmapper)
    {
      //sthVtkBased = true;
      if(!lastVtkBased)
      {
        Disable2DOpenGL();
        lastVtkBased = true;
      }
    }
    else if(lastVtkBased)
    {
      Enable2DOpenGL();
      lastVtkBased = false;
    }

    mapper->MitkRender(this, type);
  }

  this->UpdateOverlays();

  if (lastVtkBased == false)
    Disable2DOpenGL();

  // Render text
  if (type == VtkPropRenderer::Overlay)
  {
    if (m_TextCollection.size() > 0)
    {
      m_TextRenderer->SetViewport( this->GetVtkRenderer()->GetViewport() );
      for (TextMapType::iterator it = m_TextCollection.begin(); it != m_TextCollection.end() ; it++)
        m_TextRenderer->AddViewProp((*it).second);
      m_TextRenderer->Render();
    }
  }
  return 1;
}
开发者ID:GHfangxin,项目名称:MITK,代码行数:64,代码来源:mitkVtkPropRenderer.cpp


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