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

Method ComputeInteractionState

Interaction/Widgets/vtkBoxRepresentation.cxx:1407–1482  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1405
1406//------------------------------------------------------------------------------
1407int vtkBoxRepresentation::ComputeInteractionState(int X, int Y, int modify)
1408{
1409 // Okay, we can process this. Try to pick handles first;
1410 // if no handles picked, then pick the bounding box.
1411 if (!this->Renderer || !this->Renderer->IsInViewport(X, Y))
1412 {
1413 this->InteractionState = vtkBoxRepresentation::Outside;
1414 return this->InteractionState;
1415 }
1416
1417 // Try and pick a handle first
1418 this->LastPicker = nullptr;
1419 this->CurrentHandle = nullptr;
1420
1421 vtkAssemblyPath* path = this->GetAssemblyPath(X, Y, 0., this->HandlePicker);
1422
1423 if (path != nullptr)
1424 {
1425 this->ValidPick = 1;
1426 this->LastPicker = this->HandlePicker;
1427 this->CurrentHandle = reinterpret_cast<vtkActor*>(path->GetFirstNode()->GetViewProp());
1428 if (this->CurrentHandle == this->Handle[0])
1429 {
1430 this->InteractionState = vtkBoxRepresentation::MoveF0;
1431 }
1432 else if (this->CurrentHandle == this->Handle[1])
1433 {
1434 this->InteractionState = vtkBoxRepresentation::MoveF1;
1435 }
1436 else if (this->CurrentHandle == this->Handle[2])
1437 {
1438 this->InteractionState = vtkBoxRepresentation::MoveF2;
1439 }
1440 else if (this->CurrentHandle == this->Handle[3])
1441 {
1442 this->InteractionState = vtkBoxRepresentation::MoveF3;
1443 }
1444 else if (this->CurrentHandle == this->Handle[4])
1445 {
1446 this->InteractionState = vtkBoxRepresentation::MoveF4;
1447 }
1448 else if (this->CurrentHandle == this->Handle[5])
1449 {
1450 this->InteractionState = vtkBoxRepresentation::MoveF5;
1451 }
1452 else if (this->CurrentHandle == this->Handle[6])
1453 {
1454 this->InteractionState = vtkBoxRepresentation::Translating;
1455 }
1456 }
1457 else // see if the hex is picked
1458 {
1459 path = this->GetAssemblyPath(X, Y, 0., this->HexPicker);
1460
1461 if (path != nullptr)
1462 {
1463 this->LastPicker = this->HexPicker;
1464 this->ValidPick = 1;

Callers 15

MoveActionMethod · 0.45
SelectActionMethod · 0.45
MoveActionMethod · 0.45
ModifyEventActionMethod · 0.45
SelectActionMethod · 0.45
TranslateActionMethod · 0.45
ScaleActionMethod · 0.45
MoveActionMethod · 0.45
MovePlaneActionMethod · 0.45
MoveActionMethod · 0.45
MoveActionMethod · 0.45

Calls 4

IsInViewportMethod · 0.80
GetFirstNodeMethod · 0.80
GetAssemblyPathMethod · 0.45
GetViewPropMethod · 0.45

Tested by

no test coverage detected