| 143 | } |
| 144 | |
| 145 | void mitk::PlanarCircle::GeneratePolyLine() |
| 146 | { |
| 147 | // TODO: start circle at specified boundary point... |
| 148 | |
| 149 | // clear the PolyLine-Contrainer, it will be reconstructed soon enough... |
| 150 | this->ClearPolyLines(); |
| 151 | |
| 152 | const Point2D ¢erPoint = GetControlPoint(0); |
| 153 | |
| 154 | double radius = m_MinRadius; |
| 155 | |
| 156 | if (!m_RadiusFixed) |
| 157 | { |
| 158 | const Point2D &boundaryPoint = GetControlPoint(1); |
| 159 | radius = centerPoint.EuclideanDistanceTo(boundaryPoint); |
| 160 | } |
| 161 | |
| 162 | // Generate poly-line with 64 segments |
| 163 | for (int t = 0; t < 64; ++t) |
| 164 | { |
| 165 | const double alpha = (double)t * vnl_math::pi / 32.0; |
| 166 | |
| 167 | // construct the new polyline point ... |
| 168 | Point2D polyLinePoint; |
| 169 | polyLinePoint[0] = centerPoint[0] + radius * cos(alpha); |
| 170 | polyLinePoint[1] = centerPoint[1] + radius * sin(alpha); |
| 171 | |
| 172 | // ... and append it to the PolyLine. |
| 173 | // No extending supported here, so we can set the index of the PolyLineElement to '0' |
| 174 | this->AppendPointToPolyLine(0, polyLinePoint); |
| 175 | } |
| 176 | } |
| 177 | |
| 178 | void mitk::PlanarCircle::GenerateHelperPolyLine(double /*mmPerDisplayUnit*/, unsigned int /*displayHeight*/) |
| 179 | { |
nothing calls this directly
no test coverage detected