Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef _MITK_PLANAR_POLYGON_H_
18 #define _MITK_PLANAR_POLYGON_H_
19 
20 #include "mitkPlanarFigure.h"
22 
23 namespace mitk
24 {
25  class PlaneGeometry;
26 
32  {
33  public:
35 
36  itkFactorylessNewMacro(Self) itkCloneMacro(Self)
37 
38 
39  virtual void SetClosed(bool closed);
40 
41  itkBooleanMacro(Closed); // Calls SetClosed(); no need to re-implement
42 
48  // virtual void Initialize();
49 
51  unsigned int GetMinimumNumberOfControlPoints() const override { return 3; }
53  unsigned int GetMaximumNumberOfControlPoints() const override { return 1000; }
54  std::vector<mitk::Point2D> CheckForLineIntersection(const Point2D &p1, const Point2D &p2) const;
55 
56  virtual bool Equals(const mitk::PlanarFigure &other) const override;
57 
58  protected:
59  PlanarPolygon();
60 
61  mitkCloneMacro(Self);
62 
64  virtual void GeneratePolyLine() override;
65 
67  virtual void GenerateHelperPolyLine(double mmPerDisplayUnit, unsigned int displayHeight) override;
68 
70  virtual void EvaluateFeaturesInternal() override;
71 
72  bool CheckForLineIntersection(const mitk::Point2D &p1,
73  const mitk::Point2D &p2,
74  const mitk::Point2D &p3,
75  const mitk::Point2D &p4,
76  Point2D &intersection) const;
77  bool CheckForLineIntersection(const mitk::Point2D &p1,
78  const mitk::Point2D &p2,
79  const mitk::Point2D &p3,
80  const mitk::Point2D &p4) const;
81 
82  virtual void PrintSelf(std::ostream &os, itk::Indent indent) const override;
83 
84  const unsigned int FEATURE_ID_CIRCUMFERENCE;
85  const unsigned int FEATURE_ID_AREA;
86 
87  private:
88  };
89 
90 } // namespace mitk
91 
92 #endif //_MITK_PLANAR_POLYGON_H_
Base of all data objects.
Definition: mitkBaseData.h:39
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:44
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:162
#define MITKPLANARFIGURE_EXPORT
Base-class for geometric planar (2D) figures, such as lines, circles, rectangles, polygons...
const unsigned int FEATURE_ID_AREA