Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkPlanarEllipse.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_ELLIPSE_H_
18 #define _MITK_PLANAR_ELLIPSE_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 PlaceFigure(const Point2D &point) override;
44 
45  bool SetControlPoint(unsigned int index, const Point2D &point, bool createIfDoesNotExist = true) override;
46 
48  unsigned int GetMinimumNumberOfControlPoints() const override { return 4; }
50  unsigned int GetMaximumNumberOfControlPoints() const override { return 4; }
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; }
66  void SetTreatAsCircle(bool active) { m_TreatAsCircle = active; }
67  virtual bool Equals(const mitk::PlanarFigure &other) const override;
68 
69  const unsigned int FEATURE_ID_MAJOR_AXIS;
70  const unsigned int FEATURE_ID_MINOR_AXIS;
71  const unsigned int FEATURE_ID_AREA;
72 
73  protected:
74  PlanarEllipse();
75 
77 
79  virtual void GeneratePolyLine() override;
80 
82  virtual void GenerateHelperPolyLine(double mmPerDisplayUnit, unsigned int displayHeight) override;
83 
85  virtual Point2D ApplyControlPointConstraints(unsigned int index, const Point2D &point) override;
86 
88  virtual void EvaluateFeaturesInternal() override;
89 
90  virtual void PrintSelf(std::ostream &os, itk::Indent indent) const override;
91 
92  // Member variables:
93  double m_MinRadius;
94  double m_MaxRadius;
97 
98  private:
99  };
100 
101 } // namespace mitk
102 
103 #endif //_MITK_PLANAR_ELLIPSE_H_
unsigned int GetMinimumNumberOfControlPoints() const override
Ellipse has 3 control points per definition.
void ActivateMinMaxRadiusContstraints(bool active)
const unsigned int FEATURE_ID_MAJOR_AXIS
double GetMaximumRadius()
Gets the minimum radius.
Implementation of PlanarFigure representing a circle through two control points.
Base of all data objects.
Definition: mitkBaseData.h:39
double GetMinimumRadius()
Gets the minimum radius.
DataCollection - Class to facilitate loading/accessing structured data.
void SetMaximumRadius(double radius)
Sets the maximum radius.
unsigned int GetMaximumNumberOfControlPoints() const override
Ellipse has 3 control points per definition.
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:44
const unsigned int FEATURE_ID_AREA
const unsigned int FEATURE_ID_MINOR_AXIS
#define mitkCloneMacro(classname)
Definition: mitkCommon.h:162
#define MITKPLANARFIGURE_EXPORT
void SetMinimumRadius(double radius)
Sets the minimum radius.
Base-class for geometric planar (2D) figures, such as lines, circles, rectangles, polygons...
void SetTreatAsCircle(bool active)
Treat ellipse as circle (equal radii)