MCPcopy Create free account
hub / github.com/MITK/MITK / UpdatePaths

Method UpdatePaths

Modules/Core/src/Rendering/mitkVtkPropRenderer.cpp:483–519  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

481}
482
483void mitk::VtkPropRenderer::UpdatePaths()
484{
485 if (m_DataStorage.IsNull())
486 {
487 return;
488 }
489
490 if (GetMTime() > m_PathTime || (m_Paths != nullptr && m_Paths->GetMTime() > m_PathTime))
491 {
492 // Create the list to hold all the paths
493 m_Paths = vtkSmartPointer<vtkAssemblyPaths>::New();
494
495 DataStorage::SetOfObjects::ConstPointer objects = m_DataStorage->GetAll();
496 for (auto iter = objects->begin(); iter != objects->end(); ++iter)
497 {
498 vtkSmartPointer<vtkAssemblyPath> onePath = vtkSmartPointer<vtkAssemblyPath>::New();
499 Mapper *mapper = (*iter)->GetMapper(BaseRenderer::Standard3D);
500 if (mapper)
501 {
502 auto *vtkmapper = dynamic_cast<VtkMapper *>(mapper);
503
504 if (nullptr != vtkmapper)
505 {
506 vtkProp *prop = vtkmapper->GetVtkProp(this);
507 if (prop && prop->GetVisibility())
508 {
509 // add to assembly path
510 onePath->AddNode(prop, prop->GetMatrix());
511 m_Paths->AddItem(onePath);
512 }
513 }
514 }
515 }
516
517 m_PathTime.Modified();
518 }
519}
520
521int mitk::VtkPropRenderer::GetNumberOfPaths()
522{

Callers 1

InitPathTraversalMethod · 0.95

Calls 13

GetAllMethod · 0.80
GetMapperMethod · 0.80
GetVisibilityMethod · 0.80
GetMatrixMethod · 0.80
AddItemMethod · 0.80
NewFunction · 0.50
IsNullMethod · 0.45
GetMTimeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
GetVtkPropMethod · 0.45
AddNodeMethod · 0.45

Tested by

no test coverage detected