------------------------------------------------------------------------------
| 750 | |
| 751 | //------------------------------------------------------------------------------ |
| 752 | bool 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 | //------------------------------------------------------------------------------ |
| 788 | std::string vtkHeatmapItem::GetTooltipText(float x, float y) |
nothing calls this directly
no test coverage detected