| 60 | } |
| 61 | |
| 62 | bool mitk::PlanarCross::ResetOnPointSelect() |
| 63 | { |
| 64 | if (this->GetSingleLineMode()) |
| 65 | { |
| 66 | // In single line mode --> nothing to reset |
| 67 | return false; |
| 68 | } |
| 69 | |
| 70 | switch (m_SelectedControlPoint) |
| 71 | { |
| 72 | default: |
| 73 | // Nothing selected --> nothing to reset |
| 74 | return false; |
| 75 | case 0: |
| 76 | // Control point 0 selected: exchange points 0 and 1 |
| 77 | { |
| 78 | const Point2D tmpPoint = this->GetControlPoint(0); |
| 79 | this->SetControlPoint(0, this->GetControlPoint(1)); |
| 80 | this->SetControlPoint(1, tmpPoint); |
| 81 | } |
| 82 | // FALLTHRU! |
| 83 | case 1: |
| 84 | // Control point 0 or 1 selected: reset number of control points to two |
| 85 | this->ResetNumberOfControlPoints(2); |
| 86 | this->SelectControlPoint(1); |
| 87 | return true; |
| 88 | case 2: |
| 89 | // Control point 2 selected: replace point 0 with point 3 and point 1 with point 2 |
| 90 | this->SetControlPoint(0, this->GetControlPoint(3)); |
| 91 | this->SetControlPoint(1, this->GetControlPoint(2)); |
| 92 | |
| 93 | // Adjust selected control point, reset number of control points to two |
| 94 | this->ResetNumberOfControlPoints(2); |
| 95 | this->SelectControlPoint(1); |
| 96 | return true; |
| 97 | case 3: |
| 98 | // Control point 3 selected: replace point 0 with point 2 and point 1 with point 3 |
| 99 | |
| 100 | this->SetControlPoint(0, this->GetControlPoint(2)); |
| 101 | this->SetControlPoint(1, this->GetControlPoint(3)); |
| 102 | |
| 103 | // Adjust selected control point, reset number of control points to two |
| 104 | this->ResetNumberOfControlPoints(2); |
| 105 | this->SelectControlPoint(1); |
| 106 | return true; |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | unsigned int mitk::PlanarCross::GetNumberOfFeatures() const |
| 111 | { |