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

Method MitkRender

Modules/ContourModel/src/Rendering/mitkContourModelSetMapper2D.cpp:29–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27}
28
29void mitk::ContourModelSetMapper2D::MitkRender(mitk::BaseRenderer *renderer, mitk::VtkPropRenderer::RenderType /*type*/)
30{
31 BaseLocalStorage *ls = m_LSH.GetLocalStorage(renderer);
32
33 mitk::DataNode::Pointer dataNode = this->GetDataNode();
34 bool visible = true;
35 dataNode->GetVisibility(visible, nullptr);
36
37 if (!visible)
38 return;
39
40 mitk::ContourModelSet::Pointer input = this->GetInput();
41
42 auto centerOfViewPointZ = renderer->GetCurrentWorldPlaneGeometry()->GetCenter()[2];
43 auto it = input->Begin();
44
45 auto end = input->End();
46
47 while (it != end)
48 {
49 //we have the assumption that each contour model vertex has the same z coordinate
50 auto currentZValue = (*it)->GetVertexAt(0)->Coordinates[2];
51 double acceptedDeviationInMM = 5.0;
52 //only draw contour if it is visible
53 if (currentZValue - acceptedDeviationInMM < centerOfViewPointZ && currentZValue + acceptedDeviationInMM > centerOfViewPointZ){
54 this->DrawContour(it->GetPointer(), renderer);
55 }
56 ++it;
57 }
58
59 if (input->GetSize() < 1)
60 return;
61
62 ls->UpdateGenerateDataTime();
63}
64
65mitk::ContourModelSet *mitk::ContourModelSetMapper2D::GetInput(void)
66{

Callers

nothing calls this directly

Calls 11

GetInputMethod · 0.95
GetVisibilityMethod · 0.80
GetCenterMethod · 0.80
DrawContourMethod · 0.80
GetPointerMethod · 0.80
GetLocalStorageMethod · 0.45
GetDataNodeMethod · 0.45
BeginMethod · 0.45
EndMethod · 0.45
GetVertexAtMethod · 0.45
GetSizeMethod · 0.45

Tested by

no test coverage detected