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

Method GetTreeMapIdAtPos

Views/Infovis/vtkInteractorStyleTreeMapHover.cxx:164–190  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162}
163
164vtkIdType vtkInteractorStyleTreeMapHover::GetTreeMapIdAtPos(int x, int y)
165{
166 vtkIdType id = -1;
167
168 vtkRenderer* r = this->CurrentRenderer;
169 if (r == nullptr)
170 {
171 return id;
172 }
173
174 // Use the hardware picker to find a point in world coordinates.
175 this->Picker->Pick(x, y, 0, r);
176 double pos[3];
177 this->Picker->GetPickPosition(pos);
178
179 if (this->Layout != nullptr)
180 {
181 float posFloat[3];
182 for (int i = 0; i < 3; i++)
183 {
184 posFloat[i] = pos[i];
185 }
186 id = Layout->FindVertex(posFloat);
187 }
188
189 return id;
190}
191
192void vtkInteractorStyleTreeMapHover::GetBoundingBoxForTreeMapItem(vtkIdType id, float* binfo)
193{

Callers 1

OnMouseMoveMethod · 0.95

Calls 3

GetPickPositionMethod · 0.80
PickMethod · 0.45
FindVertexMethod · 0.45

Tested by

no test coverage detected