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

Method Update

Modules/Multilabel/src/mitkLabelSetImageVtkMapper2D.cpp:671–722  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

669}
670
671void mitk::LabelSetImageVtkMapper2D::Update(mitk::BaseRenderer *renderer)
672{
673 bool visible = true;
674 const DataNode *node = this->GetDataNode();
675 node->GetVisibility(visible, renderer, "visible");
676
677 if (!visible)
678 return;
679
680 auto *image = dynamic_cast<mitk::MultiLabelSegmentation *>(node->GetData());
681
682 if (image == nullptr || image->IsInitialized() == false)
683 return;
684
685 // Calculate time step of the image data for the specified renderer (integer value)
686 this->CalculateTimeStep(renderer);
687
688 // Check if time step is valid
689 const TimeGeometry *dataTimeGeometry = image->GetTimeGeometry();
690 if ((dataTimeGeometry == nullptr) || (dataTimeGeometry->CountTimeSteps() == 0) ||
691 (!dataTimeGeometry->IsValidTimeStep(this->GetTimestep())))
692 {
693 return;
694 }
695
696 image->UpdateOutputInformation();
697 LocalStorage *localStorage = m_LSH.GetLocalStorage(renderer);
698
699 // check if something important has changed and we need to re-render
700
701 if (localStorage->m_LabelLookupTable.IsNull() ||
702 (localStorage->m_LabelLookupTable->GetMTime() < image->GetLookupTable()->GetMTime()) ||
703 (localStorage->m_LastDataUpdateTime < image->GetMTime()) ||
704 (localStorage->m_LastDataUpdateTime < image->GetPipelineMTime()) ||
705 (localStorage->m_LastDataUpdateTime < renderer->GetCurrentWorldPlaneGeometryUpdateTime()) ||
706 (localStorage->m_LastDataUpdateTime < renderer->GetCurrentWorldPlaneGeometry()->GetMTime()) ||
707 (localStorage->m_LastPropertyUpdateTime < node->GetPropertyList()->GetMTime()) ||
708 (localStorage->m_LastPropertyUpdateTime < node->GetPropertyList(renderer)->GetMTime()) ||
709 (localStorage->m_LastPropertyUpdateTime < image->GetPropertyList()->GetMTime()) ||
710 (this->GetOpacityFactor() != localStorage->m_LastOpacityFactor))
711 {
712 this->GenerateDataForRenderer(renderer);
713 localStorage->m_LastPropertyUpdateTime.Modified();
714 }
715 else if ((localStorage->m_LastPropertyUpdateTime < node->GetPropertyList()->GetMTime()) ||
716 (localStorage->m_LastPropertyUpdateTime < node->GetPropertyList(renderer)->GetMTime()) ||
717 (localStorage->m_LastPropertyUpdateTime < image->GetPropertyList()->GetMTime()))
718 {
719 this->GenerateDataForRenderer(renderer);
720 localStorage->m_LastPropertyUpdateTime.Modified();
721 }
722}
723
724// set the two points defining the textured plane according to the dimension and spacing
725void mitk::LabelSetImageVtkMapper2D::GeneratePlane(mitk::BaseRenderer *renderer, double planeBounds[6])

Callers 2

GenerateImageSliceMethod · 0.45

Calls 15

GetOpacityFactorMethod · 0.95
GetVisibilityMethod · 0.80
CalculateTimeStepMethod · 0.80
GetDataNodeMethod · 0.45
GetDataMethod · 0.45
IsInitializedMethod · 0.45
CountTimeStepsMethod · 0.45
IsValidTimeStepMethod · 0.45
GetLocalStorageMethod · 0.45
IsNullMethod · 0.45

Tested by

no test coverage detected