本文整理汇总了C++中baserenderer::Pointer::GetTimeStep方法的典型用法代码示例。如果您正苦于以下问题:C++ Pointer::GetTimeStep方法的具体用法?C++ Pointer::GetTimeStep怎么用?C++ Pointer::GetTimeStep使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类baserenderer::Pointer
的用法示例。
在下文中一共展示了Pointer::GetTimeStep方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
bool mitk::AffineDataInteractor3D::ColorizeSurface(BaseRenderer::Pointer renderer, double scalar)
{
BaseData::Pointer data = this->GetDataNode()->GetData();
if(data.IsNull())
{
MITK_ERROR << "AffineInteractor3D: No data object present!";
return false;
}
// Get the timestep to also support 3D+t
int timeStep = 0;
if (renderer.IsNotNull())
timeStep = renderer->GetTimeStep(data);
// If data is an mitk::Surface, extract it
Surface::Pointer surface = dynamic_cast< Surface* >(data.GetPointer());
vtkPolyData* polyData = NULL;
if (surface.IsNotNull())
polyData = surface->GetVtkPolyData(timeStep);
if (polyData == NULL)
{
MITK_ERROR << "AffineInteractor3D: No poly data present!";
return false;
}
vtkPointData* pointData = polyData->GetPointData();
if (pointData == NULL)
{
MITK_ERROR << "AffineInteractor3D: No point data present!";
return false;
}
vtkDataArray* scalars = pointData->GetScalars();
if (scalars == NULL)
{
MITK_ERROR << "AffineInteractor3D: No scalars for point data present!";
return false;
}
for (unsigned int i = 0; i < pointData->GetNumberOfTuples(); ++i)
{
scalars->SetComponent(i, 0, scalar);
}
polyData->Modified();
pointData->Update();
return true;
}