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

Method BuildRepresentation

Rendering/VR/vtkVRControlsHelper.cxx:338–354  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

336
337//------------------------------------------------------------------------------
338void vtkVRControlsHelper::BuildRepresentation()
339{
340 // Compute text size in world coordinates
341 int bbox[4] = { 0, 0, 0, 0 };
342 this->TextActor->GetBoundingBox(bbox);
343
344 double PPI = 450; // Screen resolution in pixels per inch
345 double FontSizeFactor = 1.0 / PPI; // Map font size to world coordinates
346
347 double textSize[2] = { static_cast<double>(bbox[1] - bbox[0]),
348 static_cast<double>(bbox[3] - bbox[2]) };
349
350 double textFrameWidth = this->TextActor->GetTextProperty()->GetFrameWidth();
351
352 this->FrameSize[0] = (textSize[0] - 2.0 * textFrameWidth) * FontSizeFactor;
353 this->FrameSize[1] = (textSize[1] - 2.0 * textFrameWidth) * FontSizeFactor;
354}
355
356//------------------------------------------------------------------------------
357void vtkVRControlsHelper::PrintSelf(ostream& os, vtkIndent indent)

Callers 5

AddTooltipForInputMethod · 0.45
ToggleDrawControlsMethod · 0.45
SetDrawControlsMethod · 0.45
__init__Method · 0.45

Calls 2

GetBoundingBoxMethod · 0.45
GetTextPropertyMethod · 0.45

Tested by 1

__init__Method · 0.36