| 360 | } |
| 361 | |
| 362 | bool vtkGraphItem::MouseMoveEvent(const vtkContextMouseEvent& event) |
| 363 | { |
| 364 | this->Internal->LastMousePos = event.GetPos(); |
| 365 | if (event.GetButton() == vtkContextMouseEvent::NO_BUTTON) |
| 366 | { |
| 367 | vtkIdType v = this->HitVertex(event.GetPos()); |
| 368 | this->Scene->SetDirty(true); |
| 369 | if (v < 0) |
| 370 | { |
| 371 | this->Tooltip->SetVisible(false); |
| 372 | return true; |
| 373 | } |
| 374 | std::string text = this->VertexTooltip(v); |
| 375 | if (text.empty()) |
| 376 | { |
| 377 | this->Tooltip->SetVisible(false); |
| 378 | return true; |
| 379 | } |
| 380 | this->PlaceTooltip(v); |
| 381 | this->Tooltip->SetText(text); |
| 382 | this->Tooltip->SetVisible(true); |
| 383 | return true; |
| 384 | } |
| 385 | if (event.GetButton() == vtkContextMouseEvent::LEFT_BUTTON) |
| 386 | { |
| 387 | if (this->Layout->GetFixed() >= 0) |
| 388 | { |
| 389 | this->Layout->SetAlpha(this->Internal->LayoutAlphaStart); |
| 390 | this->Graph->GetPoints()->SetPoint( |
| 391 | this->Layout->GetFixed(), event.GetPos()[0], event.GetPos()[1], 0.0); |
| 392 | } |
| 393 | return true; |
| 394 | } |
| 395 | |
| 396 | if (this->Tooltip->GetVisible()) |
| 397 | { |
| 398 | vtkIdType v = this->HitVertex(event.GetPos()); |
| 399 | this->PlaceTooltip(v); |
| 400 | this->Scene->SetDirty(true); |
| 401 | } |
| 402 | |
| 403 | return false; |
| 404 | } |
| 405 | |
| 406 | bool vtkGraphItem::MouseEnterEvent(const vtkContextMouseEvent& vtkNotUsed(event)) |
| 407 | { |
no test coverage detected