Medical Imaging Interaction Toolkit  2025.12.02
Medical Imaging Interaction Toolkit
mitkPlanarCircle.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 mitkPlanarCircle_h
14 #define mitkPlanarCircle_h
15 
16 #include "mitkPlanarFigure.h"
18 
19 namespace mitk
20 {
21  class PlaneGeometry;
22 
29  {
30  public:
33  itkFactorylessNewMacro(Self);
34 
35  itkCloneMacro(Self);
36 
42  // virtual void Initialize();
43 
44  bool SetControlPoint(unsigned int index, const Point2D &point, bool createIfDoesNotExist = false) override;
45 
47  unsigned int GetMinimumNumberOfControlPoints() const override { return (m_RadiusFixed) ? 1 : 2; }
49  unsigned int GetMaximumNumberOfControlPoints() const override { return (m_RadiusFixed) ? 1 : 2; }
52  void SetMinimumRadius(double radius) { m_MinRadius = radius; }
55  double GetMinimumRadius() { return m_MinRadius; }
58  void SetMaximumRadius(double radius) { m_MaxRadius = radius; }
61  double GetMaximumRadius() { return m_MaxRadius; }
62  void ActivateMinMaxRadiusContstraints(bool active) { m_MinMaxRadiusContraintsActive = active; }
63  bool SetCurrentControlPoint(const Point2D &point) override;
64 
65  bool Equals(const mitk::PlanarFigure &other) const override;
66 
67  protected:
70  PlanarCircle(double fixedRadius);
71 
73 
75  void GeneratePolyLine() override;
76 
78  void GenerateHelperPolyLine(double mmPerDisplayUnit, unsigned int displayHeight) override;
79 
81  Point2D ApplyControlPointConstraints(unsigned int index, const Point2D &point) override;
82 
84  void EvaluateFeaturesInternal() override;
85 
86  void PrintSelf(std::ostream &os, itk::Indent indent) const override;
87 
88  // Feature identifiers
89  const unsigned int FEATURE_ID_RADIUS;
90  const unsigned int FEATURE_ID_DIAMETER;
91  const unsigned int FEATURE_ID_AREA;
92 
93  // Member variables:
94  double m_MinRadius;
95  double m_MaxRadius;
97  //indicate if the circle is created with fixed radius. The radius is stored in m_MinRadius
99 
100  private:
101  };
102 
103 } // namespace mitk
104 
105 #endif
#define MITKPLANARFIGURE_EXPORT
Implementation of PlanarFigure representing a circle either through two control points or by one cont...
void PrintSelf(std::ostream &os, itk::Indent indent) const override
const unsigned int FEATURE_ID_RADIUS
void EvaluateFeaturesInternal() override
Calculates feature quantities of the planar figure.
mitkClassMacro(PlanarCircle, PlanarFigure)
double GetMinimumRadius()
Gets the minimum radius.
bool Equals(const mitk::PlanarFigure &other) const override
Compare two PlanarFigure objects Note: all subclasses have to implement the method on their own.
unsigned int GetMaximumNumberOfControlPoints() const override
Circle has 2 control points per definition.
const unsigned int FEATURE_ID_AREA
unsigned int GetMinimumNumberOfControlPoints() const override
Circle has 2 control points per definition.
void ActivateMinMaxRadiusContstraints(bool active)
void GeneratePolyLine() override
Generates the poly-line representation of the planar figure.
double GetMaximumRadius()
Gets the minimum radius.
void GenerateHelperPolyLine(double mmPerDisplayUnit, unsigned int displayHeight) override
Generates the poly-lines that should be drawn the same size regardless of zoom.
PlanarCircle(double fixedRadius)
const unsigned int FEATURE_ID_DIAMETER
void SetMaximumRadius(double radius)
Sets the maximum radius.
bool SetCurrentControlPoint(const Point2D &point) override
mitkNewMacro1Param(PlanarCircle, double)
bool SetControlPoint(unsigned int index, const Point2D &point, bool createIfDoesNotExist=false) override
Place figure in its minimal configuration (a point at least) onto the given 2D geometry.
void SetMinimumRadius(double radius)
Sets the minimum radius.
Point2D ApplyControlPointConstraints(unsigned int index, const Point2D &point) override
Spatially constrain control points of second (orthogonal) line.
Base-class for geometric planar (2D) figures, such as lines, circles, rectangles, polygons,...
Find image slices visible on a given plane.