Medical Imaging Interaction Toolkit  2025.12.02
Medical Imaging Interaction Toolkit
mitkPlanarDoubleEllipse.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef mitkPlanarDoubleEllipse_h
14 #define mitkPlanarDoubleEllipse_h
15 
17 #include <mitkPlanarFigure.h>
18 
19 namespace mitk
20 {
26  {
27  public:
30 
31  itkFactorylessNewMacro(Self);
32  itkCloneMacro(Self);
33 
34  unsigned int GetNumberOfSegments() const;
35  void SetNumberOfSegments(unsigned int numSegments);
36 
37  unsigned int GetMaximumNumberOfControlPoints() const override;
38  unsigned int GetMinimumNumberOfControlPoints() const override;
39  bool SetControlPoint(unsigned int index, const Point2D &point, bool createIfDoesNotExist = true) override;
40 
41  const unsigned int FEATURE_ID_MAJOR_AXIS;
42  const unsigned int FEATURE_ID_MINOR_AXIS;
43  const unsigned int FEATURE_ID_THICKNESS;
44 
45  static const unsigned int CP_CENTER = 0;
46  static const unsigned int CP_OUTER_MAJOR_AXIS = 1;
47  static const unsigned int CP_OUTER_MINOR_AXIS = 2;
48  static const unsigned int CP_INNER_MAJOR_AXIS = 3;
49 
50  bool Equals(const mitk::PlanarFigure &other) const override;
51 
52  protected:
55  PlanarDoubleEllipse(double fixedRadius, double fixedThickness);
56 
58 
59  mitk::Point2D ApplyControlPointConstraints(unsigned int index, const Point2D &point) override;
60  void EvaluateFeaturesInternal() override;
61  void GenerateHelperPolyLine(double, unsigned int) override;
62  void GeneratePolyLine() override;
63 
64  private:
65  unsigned int m_NumberOfSegments;
66  bool m_ConstrainCircle;
67  bool m_ConstrainThickness;
68  double m_FixedRadius = 0;
69  double m_FixedThickness = 0;
70  bool m_SizeIsFixed = false;
71  };
72 }
73 
74 #endif
#define MITKPLANARFIGURE_EXPORT
Planar representing a double ellipse. The double ellipse is either represented by 4 control points (c...
void EvaluateFeaturesInternal() override
Calculates quantities of all features of this planar figure. Must be implemented in sub-classes.
mitkNewMacro2Param(PlanarDoubleEllipse, double, double) static Pointer New()
unsigned int GetMaximumNumberOfControlPoints() const override
Returns the maximum number of control points allowed for this figure (e.g. 3 for triangles).
bool Equals(const mitk::PlanarFigure &other) const override
Compare two PlanarFigure objects Note: all subclasses have to implement the method on their own.
void GeneratePolyLine() override
Generates the poly-line representation of the planar figure. Must be implemented in sub-classes.
PlanarDoubleEllipse(double fixedRadius, double fixedThickness)
void SetNumberOfSegments(unsigned int numSegments)
unsigned int GetNumberOfSegments() const
unsigned int GetMinimumNumberOfControlPoints() const override
Returns the minimum number of control points needed to represent this figure.
mitk::Point2D ApplyControlPointConstraints(unsigned int index, const Point2D &point) override
Allow sub-classes to apply constraints on control points.
bool SetControlPoint(unsigned int index, const Point2D &point, bool createIfDoesNotExist=true) override
const unsigned int FEATURE_ID_MINOR_AXIS
void GenerateHelperPolyLine(double, unsigned int) override
Generates the poly-lines that should be drawn the same size regardless of zoom. Must be implemented i...
const unsigned int FEATURE_ID_MAJOR_AXIS
mitkClassMacro(PlanarDoubleEllipse, PlanarFigure)
const unsigned int FEATURE_ID_THICKNESS
Base-class for geometric planar (2D) figures, such as lines, circles, rectangles, polygons,...
Find image slices visible on a given plane.