50 double radius = centerPoint.EuclideanDistanceTo(boundaryPointOne);
51 if (radius > centerPoint.EuclideanDistanceTo(boundaryPointTwo))
53 radius = centerPoint.EuclideanDistanceTo(boundaryPointTwo);
57 double nonScalingRadius = displayHeight * mmPerDisplayUnit * 0.05;
59 if (nonScalingRadius > radius)
66 radius = nonScalingRadius;
72 Vector2D v0 = boundaryPointOne - centerPoint;
73 Vector2D v1 = boundaryPointTwo - centerPoint;
78 v0[0] = v0[0] * cos(0.001) - v0[1] * sin(0.001);
79 v0[1] = v0[0] * sin(0.001) + v0[1] * cos(0.001);
82 double testAngle = acos(v0 * v1);
85 if (angle > testAngle)
87 v1[0] = v0[0] * cos(-0.001) - v0[1] * sin(-0.001);
88 v1[1] = v0[0] * sin(-0.001) + v0[1] * cos(-0.001);
92 if (acos(v0 * v2) > acos(v1 * v2))
94 testAngle = acos(v1 * v2);
98 testAngle = -acos(v1 * v2);
103 v0[0] = v1[0] * cos(-0.001) - v1[1] * sin(-0.001);
104 v0[1] = v1[0] * sin(-0.001) + v1[1] * cos(-0.001);
107 if (acos(v0 * v2) < acos(v1 * v2))
109 testAngle = acos(v1 * v2);
113 testAngle = -acos(v1 * v2);
117 for (
int t = 0; t < 16; ++t)
119 double alpha = (double)t * angle / 15.0 + testAngle;
122 polyLinePoint[0] = centerPoint[0] + radius * cos(alpha);
123 polyLinePoint[1] = centerPoint[1] + radius * sin(alpha);
147 double angle = acos(v0 * v1);
154 Superclass::PrintSelf(os, indent);
162 return Superclass::Equals(other);
bool Equals(const mitk::PlanarFigure &other) const override
Compare two PlanarFigure objects Note: all subclasses have to implement the method on their own...
void PrintSelf(std::ostream &os, itk::Indent indent) const override
Implementation of PlanarFigure to display an angle through three control points.
void GenerateHelperPolyLine(double mmPerDisplayUnit, unsigned int displayHeight) override
Generates the poly-lines that should be drawn the same size regardless of zoom.
void GeneratePolyLine() override
Generates the poly-line representation of the planar figure.
void EvaluateFeaturesInternal() override
Calculates feature quantities of the planar figure.
const unsigned int FEATURE_ID_ANGLE