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

Method ComputeMaxLabelLength

Rendering/Annotation/vtkAxisActor.cxx:1371–1388  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1369
1370//-----------------------------------------------------------------------------
1371double vtkAxisActor::ComputeMaxLabelLength()
1372{
1373 double maxXSize = 0;
1374 double maxYSize = 0;
1375 for (int i = 0; i < this->NumberOfLabelsBuilt; i++)
1376 {
1377 vtkTextActorInterfaceInternal* currentLabel = this->LabelProps[i].get();
1378 double bounds[6];
1379 currentLabel->GetBounds(bounds);
1380 double xsize = bounds[1] - bounds[0];
1381 double ysize = bounds[3] - bounds[2];
1382
1383 maxXSize = std::max(xsize, maxXSize);
1384 maxYSize = std::max(ysize, maxYSize);
1385 }
1386
1387 return std::sqrt((maxXSize * maxXSize) + (maxYSize * maxYSize));
1388}
1389
1390//-----------------------------------------------------------------------------
1391double vtkAxisActor::ComputeTitleLength()

Callers 2

BuildAxesMethod · 0.80
ComputeMaxLabelLengthFunction · 0.80

Calls 4

maxFunction · 0.50
sqrtFunction · 0.50
getMethod · 0.45
GetBoundsMethod · 0.45

Tested by

no test coverage detected