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

Method EnablePointWidget

Interaction/Widgets/vtkLineWidget.cxx:500–543  ·  view source on GitHub ↗

------------------------------------------------------------------------------ assumed current handle is set

Source from the content-addressed store, hash-verified

498//------------------------------------------------------------------------------
499// assumed current handle is set
500void 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

Callers 2

OnLeftButtonDownMethod · 0.95
OnMiddleButtonDownMethod · 0.95

Calls 7

GetPickPositionMethod · 0.80
GetPoint1Method · 0.45
GetPoint2Method · 0.45
SetInteractorMethod · 0.45
PlaceWidgetMethod · 0.45
SetPositionMethod · 0.45
SetCurrentRendererMethod · 0.45

Tested by

no test coverage detected