Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkPlanarSubdivisionPolygon.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_SUBDIVISION_POLYGON_H_
18 #define _MITK_PLANAR_SUBDIVISION_POLYGON_H_
19 
20 #include "mitkPlanarFigure.h"
21 #include "mitkPlanarPolygon.h"
23 
24 namespace mitk
25 {
26  class PlaneGeometry;
27 
33  {
34  public:
36 
37  itkFactorylessNewMacro(Self) itkCloneMacro(Self)
38 
39 
40  unsigned int GetMinimumNumberOfControlPoints() const override
41  {
42  return 3;
43  }
44 
46  unsigned int GetMaximumNumberOfControlPoints() const override { return 1000; }
48  unsigned int GetSubdivisionRounds() const { return m_SubdivisionRounds; }
49  void SetSubdivisionRounds(int subdivisionRounds) { m_SubdivisionRounds = subdivisionRounds; }
54  int GetControlPointForPolylinePoint(int indexOfPolylinePoint, int polyLineIndex) const;
55 
61  float GetTensionParameter() const { return m_TensionParameter; }
62  void SetTensionParameter(float tensionParameter) { m_TensionParameter = tensionParameter; }
63  std::vector<mitk::Point2D> CheckForLineIntersection(const Point2D &p1, const Point2D &p2) const;
64 
65  void IncreaseSubdivisions();
66  void DecreaseSubdivisions();
67 
68  virtual bool Equals(const mitk::PlanarFigure &other) const override;
69 
70  protected:
72 
73  mitkCloneMacro(Self);
74 
76  virtual void GeneratePolyLine() override;
77 
80 
81  private:
82  };
83 
84 } // namespace mitk
85 
86 #endif //_MITK_PLANAR_SUBDIVISION_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.
Implementation of PlanarFigure representing a polygon with two or more control points.
float GetTensionParameter() const
Parameter w_tension defines the tension. the higher w_tension, the lower the "tension" on points...
unsigned int GetMaximumNumberOfControlPoints() const override
Polygon maximum number of control points is principally not limited.
unsigned int GetSubdivisionRounds() const
How many times should we generate a round of subdivisions?
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:44
void SetSubdivisionRounds(int subdivisionRounds)
#define mitkCloneMacro(classname)
Definition: mitkCommon.h:162
#define MITKPLANARFIGURE_EXPORT
Base-class for geometric planar (2D) figures, such as lines, circles, rectangles, polygons...
void SetTensionParameter(float tensionParameter)