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

Method vtkParallelopipedWidget

Interaction/Widgets/vtkParallelopipedWidget.cxx:27–64  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

25
26//------------------------------------------------------------------------------
27vtkParallelopipedWidget::vtkParallelopipedWidget()
28{
29 // Allow chairs to be created.
30 this->EnableChairCreation = 1;
31
32 // 8 handles for the 8 corners of the piped.
33 this->HandleWidgets = new vtkHandleWidget*[8];
34 for (int i = 0; i < 8; i++)
35 {
36 this->HandleWidgets[i] = vtkHandleWidget::New();
37
38 // The widget gets a higher priority than the handles.
39 this->HandleWidgets[i]->SetPriority(this->Priority - 0.01);
40 this->HandleWidgets[i]->SetParent(this);
41
42 // The piped widget will decide what cursor to show.
43 this->HandleWidgets[i]->ManagesCursorOff();
44 }
45
46 // Define widget events
47 this->CallbackMapper->SetCallbackMethod(vtkCommand::LeftButtonPressEvent, vtkEvent::NoModifier, 0,
48 1, nullptr, vtkParallelopipedWidget::RequestResizeEvent, this,
49 vtkParallelopipedWidget::RequestResizeAlongAnAxisCallback);
50 // Commented out by Will because it is unstable code
51 // this, vtkParallelopipedWidget::RequestResizeCallback);
52 this->CallbackMapper->SetCallbackMethod(vtkCommand::LeftButtonPressEvent, vtkEvent::ShiftModifier,
53 0, 1, nullptr, vtkParallelopipedWidget::RequestResizeAlongAnAxisEvent, this,
54 vtkParallelopipedWidget::RequestResizeAlongAnAxisCallback);
55 this->CallbackMapper->SetCallbackMethod(vtkCommand::LeftButtonPressEvent,
56 vtkEvent::ControlModifier, 0, 1, nullptr, vtkParallelopipedWidget::RequestChairModeEvent, this,
57 vtkParallelopipedWidget::RequestChairModeCallback);
58 this->CallbackMapper->SetCallbackMethod(vtkCommand::LeftButtonReleaseEvent,
59 vtkWidgetEvent::EndSelect, this, vtkParallelopipedWidget::OnLeftButtonUpCallback);
60 this->CallbackMapper->SetCallbackMethod(vtkCommand::MouseMoveEvent, vtkWidgetEvent::Move, this,
61 vtkParallelopipedWidget::OnMouseMoveCallback);
62
63 this->WidgetSet = nullptr;
64}
65
66//------------------------------------------------------------------------------
67vtkParallelopipedWidget::~vtkParallelopipedWidget()

Callers

nothing calls this directly

Calls 4

SetPriorityMethod · 0.80
SetCallbackMethodMethod · 0.80
NewFunction · 0.50
SetParentMethod · 0.45

Tested by

no test coverage detected