Medical Imaging Interaction Toolkit  2018.4.99-b7f3afaa
Medical Imaging Interaction Toolkit
mitkPlanarPolygon.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_POLYGON_H_
14 #define _MITK_PLANAR_POLYGON_H_
15 
16 #include "mitkPlanarFigure.h"
18 
19 namespace mitk
20 {
21  class PlaneGeometry;
22 
28  {
29  public:
31 
32  itkFactorylessNewMacro(Self);
33 
34  itkCloneMacro(Self);
35 
37  virtual void SetClosed(bool closed);
38 
39  itkBooleanMacro(Closed); // Calls SetClosed(); no need to re-implement
40 
46  // virtual void Initialize();
47 
49  unsigned int GetMinimumNumberOfControlPoints() const override { return 3; }
51  unsigned int GetMaximumNumberOfControlPoints() const override { return 1000; }
52  std::vector<mitk::Point2D> CheckForLineIntersection(const Point2D &p1, const Point2D &p2) const;
53 
54  bool Equals(const mitk::PlanarFigure &other) const override;
55 
56  protected:
57  PlanarPolygon();
58 
60 
62  void GeneratePolyLine() override;
63 
65  void GenerateHelperPolyLine(double mmPerDisplayUnit, unsigned int displayHeight) override;
66 
68  void EvaluateFeaturesInternal() override;
69 
70  bool CheckForLineIntersection(const mitk::Point2D &p1,
71  const mitk::Point2D &p2,
72  const mitk::Point2D &p3,
73  const mitk::Point2D &p4,
74  Point2D &intersection) const;
75  bool CheckForLineIntersection(const mitk::Point2D &p1,
76  const mitk::Point2D &p2,
77  const mitk::Point2D &p3,
78  const mitk::Point2D &p4) const;
79 
80  void PrintSelf(std::ostream &os, itk::Indent indent) const override;
81 
82  const unsigned int FEATURE_ID_CIRCUMFERENCE;
83  const unsigned int FEATURE_ID_AREA;
84 
85  private:
86  };
87 
88 } // namespace mitk
89 
90 #endif //_MITK_PLANAR_POLYGON_H_
Base of all data objects.
Definition: mitkBaseData.h:37
DataCollection - Class to facilitate loading/accessing structured data.
Implementation of PlanarFigure representing a polygon with two or more control points.
unsigned int GetMaximumNumberOfControlPoints() const override
Polygon maximum number of control points is principally not limited.
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:40
const unsigned int FEATURE_ID_CIRCUMFERENCE
unsigned int GetMinimumNumberOfControlPoints() const override
Place figure in its minimal configuration (a point at least) onto the given 2D geometry.
#define mitkCloneMacro(classname)
Definition: mitkCommon.h:158
#define MITKPLANARFIGURE_EXPORT
Base-class for geometric planar (2D) figures, such as lines, circles, rectangles, polygons...
const unsigned int FEATURE_ID_AREA