本文整理汇总了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;
}
示例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;
}