36 this->ClearPolyLines();
38 this->AppendPointToPolyLine(0, this->GetControlPoint(0));
39 this->AppendPointToPolyLine(0, this->GetControlPoint(1));
46 if (this->GetNumberOfControlPoints() != 2)
48 m_HelperPolyLinesToBePainted->SetElement(0,
false);
49 m_HelperPolyLinesToBePainted->SetElement(1,
false);
54 this->ClearHelperPolyLines();
56 m_HelperPolyLinesToBePainted->SetElement(0,
true);
57 m_HelperPolyLinesToBePainted->SetElement(1,
true);
60 float scaleFactor = 0.015;
61 if (m_ArrowTipScaleFactor > 0.0)
63 scaleFactor = m_ArrowTipScaleFactor;
65 double nonScalingLength = displayHeight * mmPerDisplayUnit * scaleFactor;
68 const Point2D p1 = this->GetControlPoint(0);
69 const Point2D p2 = this->GetControlPoint(1);
74 double degrees = 100.0;
76 temp[0] = n1[0] * cos(degrees) - n1[1] * sin(degrees);
77 temp[1] = n1[0] * sin(degrees) + n1[1] * cos(degrees);
79 temp2[0] = n1[0] * cos(-degrees) - n1[1] * sin(-degrees);
80 temp2[1] = n1[0] * sin(-degrees) + n1[1] * cos(-degrees);
82 this->AppendPointToHelperPolyLine(0, p1);
83 this->AppendPointToHelperPolyLine(0,
Point2D(p1 - temp * nonScalingLength));
84 this->AppendPointToHelperPolyLine(1, p1);
85 this->AppendPointToHelperPolyLine(1,
Point2D(p1 - temp2 * nonScalingLength));
91 const Point3D &p0 = this->GetWorldControlPoint(0);
92 const Point3D &p1 = this->GetWorldControlPoint(1);
93 double length = p0.EuclideanDistanceTo(p1);
95 this->SetQuantity(FEATURE_ID_LENGTH, length);
100 Superclass::PrintSelf(os, indent);
105 m_ArrowTipScaleFactor = scale;
116 return Superclass::Equals(other);
Point< ScalarType, 2 > Point2D
virtual void GenerateHelperPolyLine(double mmPerDisplayUnit, unsigned int displayHeight) override
Generates the poly-lines that should be drawn the same size regardless of zoom.
virtual void PrintSelf(std::ostream &os, itk::Indent indent) const override
void SetArrowTipScaleFactor(float scale)
virtual void GeneratePolyLine() override
Generates the poly-line representation of the planar figure.
virtual void EvaluateFeaturesInternal() override
Calculates feature quantities of the planar figure.
float m_ArrowTipScaleFactor
MITKCORE_EXPORT const ScalarType eps
virtual bool Equals(const mitk::PlanarFigure &other) const override
Compare two PlanarFigure objects Note: all subclasses have to implement the method on their own...
Implementation of PlanarFigure representing an arrow through two control points.