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

Method ComplexInteraction

Interaction/Widgets/vtkTensorRepresentation.cxx:471–527  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

469
470//------------------------------------------------------------------------------
471void vtkTensorRepresentation::ComplexInteraction(
472 vtkRenderWindowInteractor*, vtkAbstractWidget*, unsigned long, void* calldata)
473{
474 vtkEventData* edata = static_cast<vtkEventData*>(calldata);
475 vtkEventDataDevice3D* edd = edata->GetAsEventDataDevice3D();
476 if (edd)
477 {
478 // all others
479 double eventPos[3];
480 edd->GetWorldPosition(eventPos);
481 double eventDir[4];
482 edd->GetWorldOrientation(eventDir);
483
484 double* prevPickPoint = this->LastEventPosition;
485 double* pickPoint = eventPos;
486
487 if (this->InteractionState == vtkTensorRepresentation::MoveF0)
488 {
489 this->MoveMinusXFace(prevPickPoint, pickPoint, true);
490 }
491
492 else if (this->InteractionState == vtkTensorRepresentation::MoveF1)
493 {
494 this->MovePlusXFace(prevPickPoint, pickPoint, true);
495 }
496
497 else if (this->InteractionState == vtkTensorRepresentation::MoveF2)
498 {
499 this->MoveMinusYFace(prevPickPoint, pickPoint, true);
500 }
501
502 else if (this->InteractionState == vtkTensorRepresentation::MoveF3)
503 {
504 this->MovePlusYFace(prevPickPoint, pickPoint, true);
505 }
506
507 else if (this->InteractionState == vtkTensorRepresentation::MoveF4)
508 {
509 this->MoveMinusZFace(prevPickPoint, pickPoint, true);
510 }
511
512 else if (this->InteractionState == vtkTensorRepresentation::MoveF5)
513 {
514 this->MovePlusZFace(prevPickPoint, pickPoint, true);
515 }
516
517 else if (this->InteractionState == vtkTensorRepresentation::Translating)
518 {
519 this->UpdatePose(this->LastEventPosition, this->LastEventOrientation, eventPos, eventDir);
520 }
521
522 // Book keeping
523 std::copy(eventPos, eventPos + 3, this->LastEventPosition);
524 std::copy(eventDir, eventDir + 4, this->LastEventOrientation);
525 this->Modified();
526 }
527}
528

Callers

nothing calls this directly

Calls 11

MoveMinusXFaceMethod · 0.95
MovePlusXFaceMethod · 0.95
MoveMinusYFaceMethod · 0.95
MovePlusYFaceMethod · 0.95
MoveMinusZFaceMethod · 0.95
MovePlusZFaceMethod · 0.95
UpdatePoseMethod · 0.95
copyFunction · 0.50
GetWorldPositionMethod · 0.45
ModifiedMethod · 0.45

Tested by

no test coverage detected