Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
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 
28  {
29  public:
31 
32  itkFactorylessNewMacro(Self) itkCloneMacro(Self)
33 
34 
39  // virtual void Initialize();
40 
41  bool SetControlPoint(unsigned int index, const Point2D &point, bool createIfDoesNotExist = false) override;
42 
44  unsigned int GetMinimumNumberOfControlPoints() const override { return 2; }
46  unsigned int GetMaximumNumberOfControlPoints() const override { return 2; }
49  void SetMinimumRadius(double radius) { m_MinRadius = radius; }
52  double GetMinimumRadius() { return m_MinRadius; }
55  void SetMaximumRadius(double radius) { m_MaxRadius = radius; }
58  double GetMaximumRadius() { return m_MaxRadius; }
59  void ActivateMinMaxRadiusContstraints(bool active) { m_MinMaxRadiusContraintsActive = active; }
60  bool SetCurrentControlPoint(const Point2D &point) override;
61 
62  bool Equals(const mitk::PlanarFigure &other) const override;
63 
64  protected:
65  PlanarCircle();
66 
68 
70  void GeneratePolyLine() override;
71 
73  void GenerateHelperPolyLine(double mmPerDisplayUnit, unsigned int displayHeight) override;
74 
76  Point2D ApplyControlPointConstraints(unsigned int index, const Point2D &point) override;
77 
79  void EvaluateFeaturesInternal() override;
80 
81  void PrintSelf(std::ostream &os, itk::Indent indent) const override;
82 
83  // Feature identifiers
84  const unsigned int FEATURE_ID_RADIUS;
85  const unsigned int FEATURE_ID_DIAMETER;
86  const unsigned int FEATURE_ID_AREA;
87 
88  // Member variables:
89  double m_MinRadius;
90  double m_MaxRadius;
92 
93  private:
94  };
95 
96 } // namespace mitk
97 
98 #endif //_MITK_PLANAR_CIRCLE_H_
unsigned int GetMaximumNumberOfControlPoints() const override
Circle has 2 control points per definition.
Base of all data objects.
Definition: mitkBaseData.h:37
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 through two control points.
void SetMaximumRadius(double radius)
Sets the maximum radius.
const unsigned int FEATURE_ID_AREA