------------------------------------------------------------------------------
| 417 | |
| 418 | //------------------------------------------------------------------------------ |
| 419 | void vtkVRPanelRepresentation::PlaceWidget(double bds[6]) |
| 420 | { |
| 421 | this->TextActor->GetUserMatrix()->Identity(); |
| 422 | if (this->CoordinateSystem == World) |
| 423 | { |
| 424 | // center the planel |
| 425 | this->TextActor->SetPosition( |
| 426 | 0.5 * (bds[0] + bds[1]), 0.5 * (bds[2] + bds[3]), 0.5 * (bds[4] + bds[5])); |
| 427 | |
| 428 | double length = sqrt((bds[1] - bds[0]) * (bds[1] - bds[0]) + |
| 429 | (bds[3] - bds[2]) * (bds[3] - bds[2]) + (bds[5] - bds[4]) * (bds[5] - bds[4])); |
| 430 | this->TextActor->SetScale(length / 700.0, length / 700.0, length / 700.0); |
| 431 | this->LastScale = length; |
| 432 | } |
| 433 | |
| 434 | if (this->CoordinateSystem != World) |
| 435 | { |
| 436 | double scale = sqrt((bds[1] - bds[0]) * (bds[1] - bds[0]) + |
| 437 | (bds[3] - bds[2]) * (bds[3] - bds[2]) + (bds[5] - bds[4]) * (bds[5] - bds[4])); |
| 438 | this->TextActor->SetScale(scale / 700.0, scale / 700.0, scale / 700.0); |
| 439 | this->LastScale = scale; |
| 440 | this->TextActor->SetPosition(0.0, 0.0, -0.5 * scale); |
| 441 | } |
| 442 | } |
| 443 | |
| 444 | void vtkVRPanelRepresentation::PlaceWidgetExtended( |
| 445 | const double* bds, const double* normal, const double* upvec, double scale) |