MCPcopy Create free account
hub / github.com/Kitware/VTK / vtkCaptionActor2D

Method vtkCaptionActor2D

Rendering/Annotation/vtkCaptionActor2D.cxx:41–162  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

39
40//------------------------------------------------------------------------------
41vtkCaptionActor2D::vtkCaptionActor2D()
42{
43 // Positioning information
44 this->AttachmentPointCoordinate = vtkCoordinate::New();
45 this->AttachmentPointCoordinate->SetCoordinateSystemToWorld();
46 this->AttachmentPointCoordinate->SetValue(0.0, 0.0, 0.0);
47
48 this->PositionCoordinate->SetCoordinateSystemToDisplay();
49 this->PositionCoordinate->SetReferenceCoordinate(this->AttachmentPointCoordinate);
50 this->PositionCoordinate->SetValue(static_cast<double>(10), static_cast<double>(10));
51
52 // This sets up the Position2Coordinate
53 this->vtkActor2D::SetWidth(0.25);
54 this->vtkActor2D::SetHeight(0.10);
55
56 this->Border = 1;
57 this->Leader = 1;
58 this->AttachEdgeOnly = 0;
59 this->ThreeDimensionalLeader = 1;
60 this->LeaderGlyphSize = 0.025;
61 this->MaximumLeaderGlyphSize = 20;
62
63 this->LeaderGlyphConnectionHolder = vtkCaptionActor2DConnection::New();
64
65 // Control font properties
66 this->Padding = 3;
67
68 this->CaptionTextProperty = vtkTextProperty::New();
69 this->CaptionTextProperty->SetBold(1);
70 this->CaptionTextProperty->SetItalic(1);
71 this->CaptionTextProperty->SetShadow(1);
72 this->CaptionTextProperty->SetFontFamily(VTK_ARIAL);
73 this->CaptionTextProperty->SetJustification(VTK_TEXT_LEFT);
74 this->CaptionTextProperty->SetVerticalJustification(VTK_TEXT_BOTTOM);
75
76 // What is actually drawn
77 this->TextActor = vtkTextActor::New();
78 this->TextActor->GetPositionCoordinate()->SetCoordinateSystemToDisplay();
79 this->TextActor->GetPositionCoordinate()->SetReferenceCoordinate(nullptr);
80 this->TextActor->GetPosition2Coordinate()->SetCoordinateSystemToDisplay();
81 this->TextActor->GetPosition2Coordinate()->SetReferenceCoordinate(nullptr);
82 this->TextActor->SetTextScaleModeToProp();
83 this->TextActor->SetTextProperty(this->CaptionTextProperty);
84
85 this->BorderPolyData = vtkPolyData::New();
86 vtkPoints* pts = vtkPoints::New();
87 pts->SetNumberOfPoints(4);
88 this->BorderPolyData->SetPoints(pts);
89 pts->Delete();
90 vtkCellArray* border = vtkCellArray::New();
91 border->InsertNextCell(5);
92 border->InsertCellPoint(0);
93 border->InsertCellPoint(1);
94 border->InsertCellPoint(2);
95 border->InsertCellPoint(3);
96 border->InsertCellPoint(0);
97 this->BorderPolyData->SetLines(border);
98 border->Delete();

Callers 1

runCaseMethod · 0.80

Calls 15

InsertCellPointMethod · 0.80
SetLinesMethod · 0.80
SetVectorsMethod · 0.80
SetScaleFactorMethod · 0.80
DeleteMethod · 0.65
NewFunction · 0.50
SetValueMethod · 0.45
SetTextPropertyMethod · 0.45
SetNumberOfPointsMethod · 0.45
SetPointsMethod · 0.45
InsertNextCellMethod · 0.45

Tested by 1

runCaseMethod · 0.64