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

Method Update

Modules/ContourModel/src/Rendering/mitkContourModelMapper3D.cpp:70–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68}
69
70void mitk::ContourModelMapper3D::Update(mitk::BaseRenderer *renderer)
71{
72 bool visible = true;
73 GetDataNode()->GetVisibility(visible, renderer, "visible");
74
75 auto *data = static_cast<mitk::ContourModel *>(GetDataNode()->GetData());
76 if (data == nullptr)
77 {
78 return;
79 }
80
81 // Calculate time step of the input data for the specified renderer (integer value)
82 this->CalculateTimeStep(renderer);
83
84 LocalStorage *localStorage = m_LSH.GetLocalStorage(renderer);
85 // Check if time step is valid
86 const TimeGeometry *dataTimeGeometry = data->GetTimeGeometry();
87 if ((dataTimeGeometry == nullptr) || (dataTimeGeometry->CountTimeSteps() == 0) ||
88 (!dataTimeGeometry->IsValidTimePoint(renderer->GetTime())) || (this->GetTimestep() == TIMESTEP_INVALID))
89 {
90 // clear the rendered polydata
91 localStorage->m_Mapper->SetInputData(vtkSmartPointer<vtkPolyData>::New());
92 return;
93 }
94
95 const DataNode *node = this->GetDataNode();
96 data->UpdateOutputInformation();
97
98 // check if something important has changed and we need to rerender
99 if ((localStorage->m_LastUpdateTime < node->GetMTime()) // was the node modified?
100 ||
101 (localStorage->m_LastUpdateTime < data->GetPipelineMTime()) // Was the data modified?
102 ||
103 (localStorage->m_LastUpdateTime <
104 renderer->GetCurrentWorldPlaneGeometryUpdateTime()) // was the geometry modified?
105 ||
106 (localStorage->m_LastUpdateTime < renderer->GetCurrentWorldPlaneGeometry()->GetMTime()) ||
107 (localStorage->m_LastUpdateTime < node->GetPropertyList()->GetMTime()) // was a property modified?
108 ||
109 (localStorage->m_LastUpdateTime < node->GetPropertyList(renderer)->GetMTime()))
110 {
111 this->GenerateDataForRenderer(renderer);
112 }
113
114 // since we have checked that nothing important has changed, we can set
115 // m_LastUpdateTime to the current time
116 localStorage->m_LastUpdateTime.Modified();
117}
118
119vtkSmartPointer<vtkPolyData> mitk::ContourModelMapper3D::CreateVtkPolyDataFromContour(mitk::ContourModel *inputContour)
120{

Callers 6

FillContourInSlice2Method · 0.45
MitkRenderMethod · 0.45

Calls 14

GetVisibilityMethod · 0.80
CalculateTimeStepMethod · 0.80
GetTimeMethod · 0.80
NewFunction · 0.50
GetDataMethod · 0.45
GetLocalStorageMethod · 0.45
CountTimeStepsMethod · 0.45
IsValidTimePointMethod · 0.45
GetDataNodeMethod · 0.45
GetMTimeMethod · 0.45

Tested by

no test coverage detected