------------------------------------------------------------------------------
| 336 | |
| 337 | //------------------------------------------------------------------------------ |
| 338 | void 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 | //------------------------------------------------------------------------------ |
| 357 | void vtkVRControlsHelper::PrintSelf(ostream& os, vtkIndent indent) |