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

Method GetIdAtPos

Views/Infovis/vtkInteractorStyleAreaSelectHover.cxx:115–141  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

113
114//------------------------------------------------------------------------------
115vtkIdType vtkInteractorStyleAreaSelectHover::GetIdAtPos(int x, int y)
116{
117 vtkIdType id = -1;
118
119 vtkRenderer* r = this->CurrentRenderer;
120 if (r == nullptr)
121 {
122 return id;
123 }
124
125 // Use the hardware picker to find a point in world coordinates.
126 this->Picker->Pick(x, y, 0, r);
127 double pos[3];
128 this->Picker->GetPickPosition(pos);
129
130 if (this->Layout)
131 {
132 float posFloat[3];
133 for (int i = 0; i < 3; i++)
134 {
135 posFloat[i] = pos[i];
136 }
137 id = this->Layout->FindVertex(posFloat);
138 }
139
140 return id;
141}
142
143//------------------------------------------------------------------------------
144void vtkInteractorStyleAreaSelectHover::GetBoundingAreaForItem(vtkIdType id, float* sinfo)

Callers 2

OnMouseMoveMethod · 0.95
ConvertSelectionMethod · 0.80

Calls 3

GetPickPositionMethod · 0.80
PickMethod · 0.45
FindVertexMethod · 0.45

Tested by

no test coverage detected