------------------------------------------------------------------------------
| 22 | |
| 23 | //------------------------------------------------------------------------------ |
| 24 | vtkLineWidget2::vtkLineWidget2() |
| 25 | { |
| 26 | this->WidgetState = vtkLineWidget2::Start; |
| 27 | this->ManagesCursor = 1; |
| 28 | this->CurrentHandle = 0; |
| 29 | |
| 30 | // The widgets for moving the end points. They observe this widget (i.e., |
| 31 | // this widget is the parent to the handles). |
| 32 | this->Point1Widget = vtkHandleWidget::New(); |
| 33 | this->Point1Widget->SetPriority(this->Priority - 0.01); |
| 34 | this->Point1Widget->SetParent(this); |
| 35 | this->Point1Widget->ManagesCursorOff(); |
| 36 | |
| 37 | this->Point2Widget = vtkHandleWidget::New(); |
| 38 | this->Point2Widget->SetPriority(this->Priority - 0.01); |
| 39 | this->Point2Widget->SetParent(this); |
| 40 | this->Point2Widget->ManagesCursorOff(); |
| 41 | |
| 42 | this->LineHandle = vtkHandleWidget::New(); |
| 43 | this->LineHandle->SetPriority(this->Priority - 0.01); |
| 44 | this->LineHandle->SetParent(this); |
| 45 | this->LineHandle->ManagesCursorOff(); |
| 46 | |
| 47 | // Define widget events |
| 48 | this->CallbackMapper->SetCallbackMethod( |
| 49 | vtkCommand::LeftButtonPressEvent, vtkWidgetEvent::Select, this, vtkLineWidget2::SelectAction); |
| 50 | this->CallbackMapper->SetCallbackMethod(vtkCommand::LeftButtonReleaseEvent, |
| 51 | vtkWidgetEvent::EndSelect, this, vtkLineWidget2::EndSelectAction); |
| 52 | this->CallbackMapper->SetCallbackMethod(vtkCommand::MiddleButtonPressEvent, |
| 53 | vtkWidgetEvent::Translate, this, vtkLineWidget2::TranslateAction); |
| 54 | this->CallbackMapper->SetCallbackMethod(vtkCommand::MiddleButtonReleaseEvent, |
| 55 | vtkWidgetEvent::EndTranslate, this, vtkLineWidget2::EndSelectAction); |
| 56 | this->CallbackMapper->SetCallbackMethod( |
| 57 | vtkCommand::RightButtonPressEvent, vtkWidgetEvent::Scale, this, vtkLineWidget2::ScaleAction); |
| 58 | this->CallbackMapper->SetCallbackMethod(vtkCommand::RightButtonReleaseEvent, |
| 59 | vtkWidgetEvent::EndScale, this, vtkLineWidget2::EndSelectAction); |
| 60 | this->CallbackMapper->SetCallbackMethod( |
| 61 | vtkCommand::MouseMoveEvent, vtkWidgetEvent::Move, this, vtkLineWidget2::MoveAction); |
| 62 | |
| 63 | this->KeyEventCallbackCommand = vtkCallbackCommand::New(); |
| 64 | this->KeyEventCallbackCommand->SetClientData(this); |
| 65 | this->KeyEventCallbackCommand->SetCallback(vtkLineWidget2::ProcessKeyEvents); |
| 66 | } |
| 67 | |
| 68 | //------------------------------------------------------------------------------ |
| 69 | vtkLineWidget2::~vtkLineWidget2() |
nothing calls this directly
no test coverage detected