Medical Imaging Interaction Toolkit  2018.4.99-18ddd2ed
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 (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_ELLIPSE_H_
14 #define _MITK_PLANAR_ELLIPSE_H_
15 
16 #include "mitkPlanarFigure.h"
18 
19 namespace mitk
20 {
21  class PlaneGeometry;
22 
28  {
29  public:
31  itkFactorylessNewMacro(Self);
32  itkCloneMacro(Self);
33 
39  void PlaceFigure(const Point2D &point) override;
40 
41  bool SetControlPoint(unsigned int index, const Point2D &point, bool createIfDoesNotExist = true) override;
42 
44  unsigned int GetMinimumNumberOfControlPoints() const override { return 4; }
46  unsigned int GetMaximumNumberOfControlPoints() const override { return 4; }
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; }
62  void SetTreatAsCircle(bool active) { m_TreatAsCircle = active; }
63  bool Equals(const mitk::PlanarFigure &other) const override;
64 
65  const unsigned int FEATURE_ID_MAJOR_AXIS;
66  const unsigned int FEATURE_ID_MINOR_AXIS;
67  const unsigned int FEATURE_ID_AREA;
68 
69  protected:
70  PlanarEllipse();
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  // Member variables:
89  double m_MinRadius;
90  double m_MaxRadius;
93 
94  private:
95  };
96 
97 } // namespace mitk
98 
99 #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:42
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:40
const unsigned int FEATURE_ID_AREA
const unsigned int FEATURE_ID_MINOR_AXIS
#define mitkCloneMacro(classname)
Definition: mitkCommon.h:158
#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)