| 58 | } |
| 59 | |
| 60 | bool mitk::PlanarCircle::SetControlPoint(unsigned int index, const Point2D &point, bool /*createIfDoesNotExist*/) |
| 61 | { |
| 62 | // moving center point |
| 63 | if (index == 0) |
| 64 | { |
| 65 | const Point2D ¢erPoint = GetControlPoint(0); |
| 66 | if (!m_RadiusFixed) |
| 67 | { |
| 68 | Point2D boundaryPoint = GetControlPoint(1); |
| 69 | const vnl_vector<ScalarType> vec = (point.GetVnlVector() - centerPoint.GetVnlVector()); |
| 70 | |
| 71 | boundaryPoint[0] += vec[0]; |
| 72 | boundaryPoint[1] += vec[1]; |
| 73 | PlanarFigure::SetControlPoint(1, boundaryPoint); |
| 74 | } |
| 75 | PlanarFigure::SetControlPoint(0, point); |
| 76 | return true; |
| 77 | } |
| 78 | else if (index == 1) |
| 79 | { |
| 80 | PlanarFigure::SetControlPoint(index, point); |
| 81 | return true; |
| 82 | } |
| 83 | return false; |
| 84 | } |
| 85 | |
| 86 | mitk::Point2D mitk::PlanarCircle::ApplyControlPointConstraints(unsigned int index, const Point2D &point) |
| 87 | { |
no outgoing calls