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

Method HitVertex

Views/Infovis/vtkGraphItem.cxx:348–360  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

346}
347
348vtkIdType vtkGraphItem::HitVertex(const vtkVector2f& pos)
349{
350 vtkIdType numVert = static_cast<vtkIdType>(this->Internal->VertexPositions.size());
351 for (vtkIdType v = 0; v < numVert; ++v)
352 {
353 if ((pos - this->Internal->VertexPositions[v]).Norm() <
354 this->Internal->VertexSizes[v] / this->Internal->CurrentScale[0] / 2.0)
355 {
356 return v;
357 }
358 }
359 return -1;
360}
361
362bool vtkGraphItem::MouseMoveEvent(const vtkContextMouseEvent& event)
363{

Callers 5

ProcessEventsMethod · 0.95
MouseMoveEventMethod · 0.95
MouseButtonPressEventMethod · 0.95
MouseWheelEventMethod · 0.95
HitMethod · 0.95

Calls 2

NormMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected