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

Method MouseMoveEvent

Views/Infovis/vtkGraphItem.cxx:362–404  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

360}
361
362bool 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
406bool vtkGraphItem::MouseEnterEvent(const vtkContextMouseEvent& vtkNotUsed(event))
407{

Callers 1

OnMouseMoveMethod · 0.45

Calls 10

HitVertexMethod · 0.95
VertexTooltipMethod · 0.95
PlaceTooltipMethod · 0.95
SetDirtyMethod · 0.80
GetVisibleMethod · 0.80
emptyMethod · 0.45
SetTextMethod · 0.45
SetAlphaMethod · 0.45
SetPointMethod · 0.45
GetPointsMethod · 0.45

Tested by

no test coverage detected