------------------------------------------------------------------------------ assumed current handle is set
| 498 | //------------------------------------------------------------------------------ |
| 499 | // assumed current handle is set |
| 500 | void vtkLineWidget::EnablePointWidget() |
| 501 | { |
| 502 | // Set up the point widgets |
| 503 | double x[3]; |
| 504 | if (this->CurrentHandle) // picking the handles |
| 505 | { |
| 506 | if (this->CurrentHandle == this->Handle[0]) |
| 507 | { |
| 508 | this->CurrentPointWidget = this->PointWidget1; |
| 509 | this->LineSource->GetPoint1(x); |
| 510 | } |
| 511 | else |
| 512 | { |
| 513 | this->CurrentPointWidget = this->PointWidget2; |
| 514 | this->LineSource->GetPoint2(x); |
| 515 | } |
| 516 | } |
| 517 | else // picking the line |
| 518 | { |
| 519 | this->CurrentPointWidget = this->PointWidget; |
| 520 | this->LinePicker->GetPickPosition(x); |
| 521 | this->LastPosition[0] = x[0]; |
| 522 | this->LastPosition[1] = x[1]; |
| 523 | this->LastPosition[2] = x[2]; |
| 524 | } |
| 525 | |
| 526 | double bounds[6]; |
| 527 | for (int i = 0; i < 3; i++) |
| 528 | { |
| 529 | bounds[2 * i] = x[i] - 0.1 * this->InitialLength; |
| 530 | bounds[2 * i + 1] = x[i] + 0.1 * this->InitialLength; |
| 531 | } |
| 532 | |
| 533 | // Note: translation mode is disabled and enabled to control |
| 534 | // the proper positioning of the bounding box. |
| 535 | this->CurrentPointWidget->SetInteractor(this->Interactor); |
| 536 | this->CurrentPointWidget->TranslationModeOff(); |
| 537 | this->CurrentPointWidget->SetPlaceFactor(1.0); |
| 538 | this->CurrentPointWidget->PlaceWidget(bounds); |
| 539 | this->CurrentPointWidget->TranslationModeOn(); |
| 540 | this->CurrentPointWidget->SetPosition(x); |
| 541 | this->CurrentPointWidget->SetCurrentRenderer(this->CurrentRenderer); |
| 542 | this->CurrentPointWidget->On(); |
| 543 | } |
| 544 | |
| 545 | //------------------------------------------------------------------------------ |
| 546 | // assumed current handle is set |
no test coverage detected