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

Method GetBoundingBox

Rendering/Core/vtkTextActor.cxx:127–158  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

125
126//------------------------------------------------------------------------------
127void vtkTextActor::GetBoundingBox(vtkViewport* vport, double bbox[4])
128{
129 if (this->UpdateRectangle(vport) && this->RectanglePoints &&
130 this->RectanglePoints->GetNumberOfPoints() >= 4)
131 {
132 double x[3];
133 this->RectanglePoints->GetPoint(0, x);
134 bbox[0] = bbox[1] = x[0];
135 bbox[2] = bbox[3] = x[1];
136 for (int i = 1; i < this->RectanglePoints->GetNumberOfPoints(); ++i)
137 {
138 this->RectanglePoints->GetPoint(i, x);
139
140 if (bbox[0] > x[0])
141 bbox[0] = x[0];
142 else if (bbox[1] < x[0])
143 bbox[1] = x[0];
144
145 if (bbox[2] > x[1])
146 bbox[2] = x[1];
147 else if (bbox[3] < x[1])
148 bbox[3] = x[1];
149 }
150 // Use pixel centers rather than pixel corners for the coordinates.
151 --bbox[1];
152 --bbox[3];
153 }
154 else
155 {
156 vtkErrorMacro("UpdateRectangle failed to do so");
157 }
158}
159
160//------------------------------------------------------------------------------
161void vtkTextActor::GetSize(vtkViewport* vport, double size[2])

Callers 13

GetSizeMethod · 0.95
PlaceWidgetExtendedMethod · 0.45
BuildRepresentationMethod · 0.45
PrepareRenderMethod · 0.45
LabelSizesForArrayMethod · 0.45
ComputeLabelBoundsMethod · 0.45
PrepareRenderMethod · 0.45
UpdateQuadMethod · 0.45
GetImageBoundingBoxMethod · 0.45
SetLabelPositions2DMethod · 0.45

Calls 3

UpdateRectangleMethod · 0.95
GetNumberOfPointsMethod · 0.45
GetPointMethod · 0.45

Tested by

no test coverage detected