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

Method GenerateDataForRenderer

Modules/MapperExt/src/mitkSplineVtkMapper3D.cpp:53–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53void mitk::SplineVtkMapper3D::GenerateDataForRenderer(mitk::BaseRenderer *renderer)
54{
55 BaseLocalStorage *ls = m_LSH.GetLocalStorage(renderer);
56
57 // only update spline if UpdateSpline has not been called from
58 // external, e.g. by the SplineMapper2D. But call it the first time when m_SplineUpdateTime = 0 and m_LastUpdateTime =
59 // 0.
60 if (m_SplineUpdateTime < ls->GetLastGenerateDataTime() || m_SplineUpdateTime == 0)
61 {
62 this->UpdateSpline();
63 this->ApplyAllProperties(renderer, m_SplinesActor);
64 }
65
66 if (m_SplinesAvailable)
67 {
68 if (!m_SplinesAddedToAssembly)
69 {
70 m_SplineAssembly->AddPart(m_SplinesActor);
71 m_SplinesAddedToAssembly = true;
72 }
73 }
74 else
75 {
76 if (m_SplinesAddedToAssembly)
77 {
78 m_SplineAssembly->RemovePart(m_SplinesActor);
79 m_SplinesAddedToAssembly = false;
80 }
81 }
82
83 bool visible = true;
84 GetDataNode()->GetVisibility(visible, renderer, "visible");
85
86 if (!visible)
87 {
88 m_SplinesActor->VisibilityOff();
89 m_SplineAssembly->VisibilityOff();
90 }
91 else
92 {
93 m_SplinesActor->VisibilityOn();
94 m_SplineAssembly->VisibilityOn();
95
96 // remove the PointsAssembly if it was added in superclass. No need to display points and spline!
97 if (m_SplineAssembly->GetParts()->IsItemPresent(m_PointsAssembly))
98 m_SplineAssembly->RemovePart(m_PointsAssembly);
99 }
100 // if the properties have been changed, then refresh the properties
101 if ((m_SplineUpdateTime < this->m_DataNode->GetPropertyList()->GetMTime()) ||
102 (m_SplineUpdateTime < this->m_DataNode->GetPropertyList(renderer)->GetMTime()))
103 this->ApplyAllProperties(renderer, m_SplinesActor);
104}
105
106void mitk::SplineVtkMapper3D::ApplyAllProperties(BaseRenderer *renderer, vtkActor *actor)
107{

Callers

nothing calls this directly

Calls 9

UpdateSplineMethod · 0.95
ApplyAllPropertiesMethod · 0.95
GetVisibilityMethod · 0.80
GetLocalStorageMethod · 0.45
AddPartMethod · 0.45
RemovePartMethod · 0.45
GetPartsMethod · 0.45
GetMTimeMethod · 0.45
GetPropertyListMethod · 0.45

Tested by

no test coverage detected