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

Method MouseMoveEvent

Views/Infovis/vtkHeatmapItem.cxx:752–785  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

750
751//------------------------------------------------------------------------------
752bool vtkHeatmapItem::MouseMoveEvent(const vtkContextMouseEvent& event)
753{
754 if (event.GetButton() == vtkContextMouseEvent::NO_BUTTON)
755 {
756 float pos[3];
757 vtkNew<vtkMatrix3x3> inverse;
758 pos[0] = event.GetPos().GetX();
759 pos[1] = event.GetPos().GetY();
760 pos[2] = 0;
761 this->GetScene()->GetTransform()->GetInverse(inverse);
762 inverse->MultiplyPoint(pos, pos);
763 if (pos[0] <= this->MaxX && pos[0] >= this->MinX && pos[1] <= this->MaxY &&
764 pos[1] >= this->MinY)
765 {
766 this->Tooltip->SetPosition(pos[0], pos[1]);
767
768 std::string tooltipText = this->GetTooltipText(pos[0], pos[1]);
769 if (!tooltipText.empty())
770 {
771 this->Tooltip->SetText(tooltipText);
772 this->Tooltip->SetVisible(true);
773 this->Scene->SetDirty(true);
774 return true;
775 }
776 }
777 bool shouldRepaint = this->Tooltip->GetVisible();
778 this->Tooltip->SetVisible(false);
779 if (shouldRepaint)
780 {
781 this->Scene->SetDirty(true);
782 }
783 }
784 return false;
785}
786
787//------------------------------------------------------------------------------
788std::string vtkHeatmapItem::GetTooltipText(float x, float y)

Callers

nothing calls this directly

Calls 11

GetTooltipTextMethod · 0.95
SetDirtyMethod · 0.80
GetVisibleMethod · 0.80
GetXMethod · 0.45
GetInverseMethod · 0.45
GetTransformMethod · 0.45
GetSceneMethod · 0.45
MultiplyPointMethod · 0.45
SetPositionMethod · 0.45
emptyMethod · 0.45
SetTextMethod · 0.45

Tested by

no test coverage detected