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

Method ComputerAutoCenterTranslation

Rendering/Annotation/vtkProp3DAxisFollower.cxx:385–420  ·  view source on GitHub ↗

------------------------------------------------------------------------------ VTK_DEPRECATED_IN_9_6_0

Source from the content-addressed store, hash-verified

383//------------------------------------------------------------------------------
384// VTK_DEPRECATED_IN_9_6_0
385void vtkProp3DAxisFollower::ComputerAutoCenterTranslation(
386 const double& vtkNotUsed(autoScaleFactor), double translation[3])
387{
388 if (!translation)
389 {
390 vtkErrorMacro("ERROR: Invalid or nullptr translation\n");
391 return;
392 }
393
394 const double* bounds = this->GetProp3D()->GetBounds();
395
396 // Offset by half of width.
397 double halfWidth = (bounds[1] - bounds[0]) * 0.5 * this->Scale[0];
398
399 if (this->TextUpsideDown == 1)
400 {
401 halfWidth = -halfWidth;
402 }
403
404 if (this->Axis->GetAxisType() == vtkAxisActor::VTK_AXIS_TYPE_X)
405 {
406 translation[0] = translation[0] - halfWidth;
407 }
408 else if (this->Axis->GetAxisType() == vtkAxisActor::VTK_AXIS_TYPE_Y)
409 {
410 translation[1] = translation[1] - halfWidth;
411 }
412 else if (this->Axis->GetAxisType() == vtkAxisActor::VTK_AXIS_TYPE_Z)
413 {
414 translation[2] = translation[2] - halfWidth;
415 }
416 else
417 {
418 // Do nothing.
419 }
420}
421
422//------------------------------------------------------------------------------
423int vtkProp3DAxisFollower::TestDistanceVisibility()

Callers

nothing calls this directly

Calls 2

GetBoundsMethod · 0.45
GetProp3DMethod · 0.45

Tested by

no test coverage detected