| 27 | } |
| 28 | |
| 29 | void 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 | |
| 65 | mitk::ContourModelSet *mitk::ContourModelSetMapper2D::GetInput(void) |
| 66 | { |
nothing calls this directly
no test coverage detected