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

Method CreateCaptionActor

Modules/ROI/src/mitkROIMapperHelper.cpp:48–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46}
47
48vtkSmartPointer<vtkCaptionActor2D> mitk::ROIMapperHelper::CreateCaptionActor(const std::string& caption, const Point3D& attachmentPoint, vtkProperty* property, const DataNode* dataNode, const BaseRenderer* renderer)
49{
50 auto captionActor = vtkSmartPointer<vtkCaptionActor2D>::New();
51 captionActor->SetPosition(property->GetLineWidth() * 0.5, property->GetLineWidth() * 0.5);
52 captionActor->GetTextActor()->SetTextScaleModeToNone();
53 captionActor->SetAttachmentPoint(attachmentPoint[0], attachmentPoint[1], attachmentPoint[2]);
54 captionActor->SetCaption(caption.c_str());
55 captionActor->BorderOff();
56 captionActor->LeaderOff();
57
58 auto* textProperty = captionActor->GetCaptionTextProperty();
59 textProperty->SetColor(property->GetColor());
60 textProperty->SetOpacity(property->GetOpacity());
61 textProperty->ShadowOff();
62
63 int fontSize = 16;
64 dataNode->GetIntProperty("font.size", fontSize, renderer);
65 textProperty->SetFontSize(fontSize);
66
67 bool bold = false;
68 dataNode->GetBoolProperty("font.bold", bold, renderer);
69 textProperty->SetBold(bold);
70
71 bool italic = false;
72 dataNode->GetBoolProperty("font.italic", italic, renderer);
73 textProperty->SetItalic(italic);
74
75 return captionActor;
76}
77
78std::string mitk::ROIMapperHelper::ParseCaption(const std::string& captionTemplate, const ROI::Element& roi, TimeStepType t)
79{

Callers

nothing calls this directly

Calls 10

GetLineWidthMethod · 0.80
NewFunction · 0.50
SetPositionMethod · 0.45
SetColorMethod · 0.45
GetColorMethod · 0.45
SetOpacityMethod · 0.45
GetOpacityMethod · 0.45
GetIntPropertyMethod · 0.45
SetFontSizeMethod · 0.45
GetBoolPropertyMethod · 0.45

Tested by

no test coverage detected