Medical Imaging Interaction Toolkit  2018.4.99-08619e4f
Medical Imaging Interaction Toolkit
mitkPlanarDoubleEllipse.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 mitkPlanarDoubleEllipse_h
14 #define mitkPlanarDoubleEllipse_h
15 
17 #include <mitkPlanarFigure.h>
18 
19 namespace mitk
20 {
26  {
27  public:
30 
31  itkFactorylessNewMacro(Self);
32  itkCloneMacro(Self);
33 
34  unsigned int GetNumberOfSegments() const;
35  void SetNumberOfSegments(unsigned int numSegments);
36 
37  unsigned int GetMaximumNumberOfControlPoints() const override;
38  unsigned int GetMinimumNumberOfControlPoints() const override;
39  bool SetControlPoint(unsigned int index, const Point2D &point, bool createIfDoesNotExist = true) override;
40 
41  const unsigned int FEATURE_ID_MAJOR_AXIS;
42  const unsigned int FEATURE_ID_MINOR_AXIS;
43  const unsigned int FEATURE_ID_THICKNESS;
44 
45  static const unsigned int CP_CENTER = 0;
46  static const unsigned int CP_OUTER_MAJOR_AXIS = 1;
47  static const unsigned int CP_OUTER_MINOR_AXIS = 2;
48  static const unsigned int CP_INNER_MAJOR_AXIS = 3;
49 
50  bool Equals(const mitk::PlanarFigure &other) const override;
51 
52  protected:
55  PlanarDoubleEllipse(double fixedRadius, double fixedThickness);
56 
58 
59  mitk::Point2D ApplyControlPointConstraints(unsigned int index, const Point2D &point) override;
60  void EvaluateFeaturesInternal() override;
61  void GenerateHelperPolyLine(double, unsigned int) override;
62  void GeneratePolyLine() override;
63 
64  private:
65  unsigned int m_NumberOfSegments;
66  bool m_ConstrainCircle;
67  bool m_ConstrainThickness;
68  double m_FixedRadius = 0;
69  double m_FixedThickness = 0;
70  bool m_SizeIsFixed = false;
71  };
72 }
73 
74 #endif
Base of all data objects.
Definition: mitkBaseData.h:42
DataCollection - Class to facilitate loading/accessing structured data.
Planar representing a double ellipse. The double ellipse is either represented by 4 control points (c...
#define mitkNewMacro2Param(classname, typea, typeb)
Definition: mitkCommon.h:85
const unsigned int FEATURE_ID_THICKNESS
const unsigned int FEATURE_ID_MAJOR_AXIS
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:40
const unsigned int FEATURE_ID_MINOR_AXIS
#define mitkCloneMacro(classname)
Definition: mitkCommon.h:158
#define MITKPLANARFIGURE_EXPORT
Base-class for geometric planar (2D) figures, such as lines, circles, rectangles, polygons...