Medical Imaging Interaction Toolkit  2024.06.00
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 mitkPlanarPolygon_h
14 #define mitkPlanarPolygon_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 
59  mitkCloneMacro(Self);
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
MitkPlanarFigureExports.h
mitk::PlanarFigure
Base-class for geometric planar (2D) figures, such as lines, circles, rectangles, polygons,...
Definition: mitkPlanarFigure.h:50
MITKPLANARFIGURE_EXPORT
#define MITKPLANARFIGURE_EXPORT
Definition: MitkPlanarFigureExports.h:15
mitkPlanarFigure.h
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::PlanarPolygon::GetMinimumNumberOfControlPoints
unsigned int GetMinimumNumberOfControlPoints() const override
Place figure in its minimal configuration (a point at least) onto the given 2D geometry.
Definition: mitkPlanarPolygon.h:49
mitk::Point< ScalarType, 2 >
mitk::PlanarPolygon::GetMaximumNumberOfControlPoints
unsigned int GetMaximumNumberOfControlPoints() const override
Polygon maximum number of control points is principally not limited.
Definition: mitkPlanarPolygon.h:51
mitk::PlanarPolygon::FEATURE_ID_CIRCUMFERENCE
const unsigned int FEATURE_ID_CIRCUMFERENCE
Definition: mitkPlanarPolygon.h:82
mitk::BaseData
Base of all data objects.
Definition: mitkBaseData.h:42
mitkCloneMacro
#define mitkCloneMacro(classname)
Definition: mitkCommon.h:154
mitk::PlanarPolygon::FEATURE_ID_AREA
const unsigned int FEATURE_ID_AREA
Definition: mitkPlanarPolygon.h:83
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
mitk::PlanarPolygon
Implementation of PlanarFigure representing a polygon with two or more control points.
Definition: mitkPlanarPolygon.h:27