Medical Imaging Interaction Toolkit  2018.4.99-b20efe7f
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 _MITK_PLANAR_CIRCLE_H_
14 #define _MITK_PLANAR_CIRCLE_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:
68  PlanarCircle();
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 //_MITK_PLANAR_CIRCLE_H_
unsigned int GetMaximumNumberOfControlPoints() const override
Circle has 2 control points per definition.
#define mitkNewMacro1Param(classname, type)
Definition: mitkCommon.h:72
Base of all data objects.
Definition: mitkBaseData.h:42
double GetMinimumRadius()
Gets the minimum radius.
const unsigned int FEATURE_ID_DIAMETER
DataCollection - Class to facilitate loading/accessing structured data.
void ActivateMinMaxRadiusContstraints(bool active)
double GetMaximumRadius()
Gets the minimum radius.
const unsigned int FEATURE_ID_RADIUS
unsigned int GetMinimumNumberOfControlPoints() const override
Circle has 2 control points per definition.
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:40
void SetMinimumRadius(double radius)
Sets the minimum radius.
#define mitkCloneMacro(classname)
Definition: mitkCommon.h:158
#define MITKPLANARFIGURE_EXPORT
Base-class for geometric planar (2D) figures, such as lines, circles, rectangles, polygons...
Implementation of PlanarFigure representing a circle either through two control points or by one cont...
void SetMaximumRadius(double radius)
Sets the maximum radius.
const unsigned int FEATURE_ID_AREA