| 69 | } |
| 70 | |
| 71 | void mitk::LabelAnnotation3D::UpdateVtkAnnotation(mitk::BaseRenderer *renderer) |
| 72 | { |
| 73 | if (m_LabelCoordinates.IsNull()) |
| 74 | { |
| 75 | MITK_WARN << "No pointset defined to print labels!"; |
| 76 | return; |
| 77 | } |
| 78 | LocalStorage *ls = this->m_LSH.GetLocalStorage(renderer); |
| 79 | |
| 80 | if (ls->IsGenerateDataRequired(renderer, this)) |
| 81 | { |
| 82 | vtkSmartPointer<vtkPoints> points = vtkSmartPointer<vtkPoints>::New(); |
| 83 | |
| 84 | auto pointsetsize = (size_t)m_LabelCoordinates->GetSize(); |
| 85 | ls->m_Labels->SetNumberOfValues(pointsetsize); |
| 86 | ls->m_Sizes->SetNumberOfValues(pointsetsize); |
| 87 | |
| 88 | for (size_t i = 0; i < pointsetsize; i++) |
| 89 | { |
| 90 | mitk::Point3D coordinate = m_LabelCoordinates->GetPoint(i); |
| 91 | points->InsertNextPoint(coordinate[0] + GetOffsetVector()[0], |
| 92 | coordinate[1] + GetOffsetVector()[1], |
| 93 | coordinate[2] + GetOffsetVector()[2]); |
| 94 | if (m_LabelVector.size() > i) |
| 95 | ls->m_Labels->SetValue(i, m_LabelVector[i]); |
| 96 | else |
| 97 | ls->m_Labels->SetValue(i, ""); |
| 98 | |
| 99 | if (m_PriorityVector.size() > i) |
| 100 | ls->m_Sizes->SetValue(i, m_PriorityVector[i]); |
| 101 | else |
| 102 | ls->m_Sizes->SetValue(i, 1); |
| 103 | } |
| 104 | |
| 105 | ls->m_Points->SetPoints(points); |
| 106 | ls->m_PointSetToLabelHierarchyFilter->Update(); |
| 107 | ls->m_LabelMapper->Update(); |
| 108 | |
| 109 | float color[3] = {1, 1, 1}; |
| 110 | float opacity = 1.0; |
| 111 | GetColor(color); |
| 112 | GetOpacity(opacity); |
| 113 | ls->m_LabelsActor->GetProperty()->SetColor(color[0], color[1], color[2]); |
| 114 | ls->m_LabelsActor->GetProperty()->SetOpacity(opacity); |
| 115 | ls->UpdateGenerateDataTime(); |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | vtkProp *mitk::LabelAnnotation3D::GetVtkProp(BaseRenderer *renderer) const |
| 120 | { |
nothing calls this directly
no test coverage detected