Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
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) itkCloneMacro(Self)
33 
34 
35  virtual void SetClosed(bool closed);
36 
37  itkBooleanMacro(Closed); // Calls SetClosed(); no need to re-implement
38 
44  // virtual void Initialize();
45 
47  unsigned int GetMinimumNumberOfControlPoints() const override { return 3; }
49  unsigned int GetMaximumNumberOfControlPoints() const override { return 1000; }
50  std::vector<mitk::Point2D> CheckForLineIntersection(const Point2D &p1, const Point2D &p2) const;
51 
52  bool Equals(const mitk::PlanarFigure &other) const override;
53 
54  protected:
55  PlanarPolygon();
56 
58 
60  void GeneratePolyLine() override;
61 
63  void GenerateHelperPolyLine(double mmPerDisplayUnit, unsigned int displayHeight) override;
64 
66  void EvaluateFeaturesInternal() override;
67 
68  bool CheckForLineIntersection(const mitk::Point2D &p1,
69  const mitk::Point2D &p2,
70  const mitk::Point2D &p3,
71  const mitk::Point2D &p4,
72  Point2D &intersection) const;
73  bool CheckForLineIntersection(const mitk::Point2D &p1,
74  const mitk::Point2D &p2,
75  const mitk::Point2D &p3,
76  const mitk::Point2D &p4) const;
77 
78  void PrintSelf(std::ostream &os, itk::Indent indent) const override;
79 
80  const unsigned int FEATURE_ID_CIRCUMFERENCE;
81  const unsigned int FEATURE_ID_AREA;
82 
83  private:
84  };
85 
86 } // namespace mitk
87 
88 #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