MCPcopy Create free account
hub / github.com/MITK/MITK / GetNearHandle

Method GetNearHandle

Modules/QtWidgetsExt/src/QmitkColorTransferFunctionCanvas.cpp:113–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111}
112
113int QmitkColorTransferFunctionCanvas::GetNearHandle(int x, int, unsigned int maxSquaredDistance)
114{
115 for (int i = 0; i < this->GetFunctionSize(); i++)
116 {
117 std::pair<int, int> point = this->FunctionToCanvas(std::make_pair(GetFunctionX(i), (double)0.0));
118 if ((unsigned int)((point.first - x) * (point.first - x)) < maxSquaredDistance)
119 {
120 return i;
121 }
122 }
123 return -1;
124}
125
126void QmitkColorTransferFunctionCanvas::DoubleClickOnHandle(int handle)
127{

Callers

nothing calls this directly

Calls 2

FunctionToCanvasMethod · 0.80
GetFunctionXFunction · 0.50

Tested by

no test coverage detected