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

Method ComputeStringBounds

IO/ExportPDF/vtkPDFContextDevice2D.cxx:1277–1293  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1275
1276//------------------------------------------------------------------------------
1277void vtkPDFContextDevice2D::ComputeStringBounds(const vtkStdString& string, float bounds[4])
1278{
1279 vtkNew<vtkMatrix3x3> mat;
1280 this->GetMatrix(mat);
1281 TextHelper helper(this->Impl->Document, this->Impl->Page, this->TextProp, string, mat);
1282 if (!helper.Valid)
1283 {
1284 vtkErrorMacro("Error determining bounding box for string '" << string << "'.");
1285 std::fill(bounds, bounds + 4, 0.f);
1286 return;
1287 }
1288
1289 bounds[0] = 0.f;
1290 bounds[1] = 0.f;
1291 bounds[2] = helper.BBoxWidth;
1292 bounds[3] = helper.BBoxHeight;
1293}
1294
1295//------------------------------------------------------------------------------
1296void vtkPDFContextDevice2D::ComputeJustifiedStringBounds(const char* string, float bounds[4])

Callers 3

DrawStringMethod · 0.95
PaintMethod · 0.45

Calls 2

GetMatrixMethod · 0.95
fillFunction · 0.50

Tested by 1

PaintMethod · 0.36