| 130 | } |
| 131 | |
| 132 | int QmitkPiecewiseFunctionCanvas::GetNearHandle(int x, int y, unsigned int maxSquaredDistance) |
| 133 | { |
| 134 | double *dp = m_PiecewiseFunction->GetDataPointer(); |
| 135 | for (int i = 0; i < m_PiecewiseFunction->GetSize(); i++) |
| 136 | { |
| 137 | std::pair<int, int> point = this->FunctionToCanvas(std::make_pair(dp[i * 2], dp[i * 2 + 1])); |
| 138 | if ((unsigned int)((point.first - x) * (point.first - x) + (point.second - y) * (point.second - y)) <= |
| 139 | maxSquaredDistance) |
| 140 | { |
| 141 | return i; |
| 142 | } |
| 143 | } |
| 144 | return -1; |
| 145 | } |
| 146 | |
| 147 | void QmitkPiecewiseFunctionCanvas::MoveFunctionPoint(int index, std::pair<double, double> pos) |
| 148 | { |
nothing calls this directly
no test coverage detected