Medical Imaging Interaction Toolkit  2016.11.0
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef _MITK_PLANAR_CIRCLE_H_
18 #define _MITK_PLANAR_CIRCLE_H_
19 
20 #include "mitkPlanarFigure.h"
22 
23 namespace mitk
24 {
25  class PlaneGeometry;
26 
32  {
33  public:
35 
36  itkFactorylessNewMacro(Self) itkCloneMacro(Self)
37 
38 
43  // virtual void Initialize();
44 
45  bool SetControlPoint(unsigned int index, const Point2D &point, bool createIfDoesNotExist = false) override;
46 
48  unsigned int GetMinimumNumberOfControlPoints() const override { return 2; }
50  unsigned int GetMaximumNumberOfControlPoints() const override { return 2; }
53  void SetMinimumRadius(double radius) { m_MinRadius = radius; }
56  double GetMinimumRadius() { return m_MinRadius; }
59  void SetMaximumRadius(double radius) { m_MaxRadius = radius; }
62  double GetMaximumRadius() { return m_MaxRadius; }
63  void ActivateMinMaxRadiusContstraints(bool active) { m_MinMaxRadiusContraintsActive = active; }
64  virtual bool SetCurrentControlPoint(const Point2D &point) override;
65 
66  virtual bool Equals(const mitk::PlanarFigure &other) const override;
67 
68  protected:
69  PlanarCircle();
70 
71  mitkCloneMacro(Self);
72 
74  virtual void GeneratePolyLine() override;
75 
77  virtual void GenerateHelperPolyLine(double mmPerDisplayUnit, unsigned int displayHeight) override;
78 
80  virtual Point2D ApplyControlPointConstraints(unsigned int index, const Point2D &point) override;
81 
83  virtual void EvaluateFeaturesInternal() override;
84 
85  virtual void PrintSelf(std::ostream &os, itk::Indent indent) const override;
86 
87  // Feature identifiers
88  const unsigned int FEATURE_ID_RADIUS;
89  const unsigned int FEATURE_ID_DIAMETER;
90  const unsigned int FEATURE_ID_AREA;
91 
92  // Member variables:
93  double m_MinRadius;
94  double m_MaxRadius;
96 
97  private:
98  };
99 
100 } // namespace mitk
101 
102 #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:39
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:44
void SetMinimumRadius(double radius)
Sets the minimum radius.
#define mitkCloneMacro(classname)
Definition: mitkCommon.h:162
#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